:root {
  color-scheme: light;
  --paper: #f6f6f2;
  --surface: #ffffff;
  --surface-soft: #eeeeea;
  --ink: #15171a;
  --muted: #69707a;
  --line: rgba(21, 23, 26, 0.1);
  --accent: #2f64d6;
  --max: 1180px;
  --gap: 14px;
  --radius: 8px;
  --gutter: clamp(16px, 3.2vw, 46px);
  font-family:
    Inter, "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Noto Sans SC",
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-lang="zh"] [data-i18n="en"],
body[data-lang="en"] [data-i18n="zh"] {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 14px;
  top: 12px;
  z-index: 80;
  transform: translateY(-140%);
  background: var(--ink);
  color: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  left: 50%;
  top: 14px;
  z-index: 70;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: min(var(--max), calc(100% - 28px));
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 246, 242, 0.84);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 720;
}

.brand-mark {
  width: 7px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.nav-links a,
.lang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(21, 23, 26, 0.62);
  font-size: 0.84rem;
  font-weight: 640;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(21, 23, 26, 0.05);
  color: var(--ink);
}

.lang-switch {
  justify-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
}

.lang-button {
  min-width: 46px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lang-button.is-active {
  background: var(--ink);
  color: #fff;
}

.bento-main {
  padding-top: 84px;
}

.bento-hero,
.bento-section,
.section-heading,
.contact-section,
.site-footer {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin: 0 auto;
}

.bento-hero {
  min-height: calc(100svh - 84px);
  display: flex;
  align-items: stretch;
}

.bento-grid {
  display: grid;
  gap: var(--gap);
  width: 100%;
}

.hero-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(110px, auto);
}

.tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.intro-tile {
  grid-column: span 5;
  grid-row: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  padding: clamp(24px, 4vw, 44px);
}

.image-tile {
  background: var(--surface-soft);
}

.image-tile picture,
.image-tile img {
  width: 100%;
  height: 100%;
}

.image-tile img {
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
}

.hero-image-tile {
  grid-column: span 7;
  grid-row: span 5;
  min-height: 660px;
}

.note-tile {
  grid-column: span 3;
  min-height: 154px;
  padding: 20px;
}

.accent-tile {
  background: #15171a;
  color: #fff;
}

.accent-tile h2,
.accent-tile p,
.accent-tile span {
  color: inherit;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.7rem, 5.8vw, 5.8rem);
  font-weight: 620;
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2.65rem);
  font-weight: 590;
  line-height: 1.08;
}

h3 {
  font-size: clamp(1.08rem, 1.45vw, 1.45rem);
  font-weight: 610;
  line-height: 1.16;
}

.lead {
  max-width: 520px;
  margin: 24px 0 0;
  color: #47515f;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  line-height: 1.76;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.link-row a,
.mail-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
}

.link-row a::after,
.mail-link::after {
  content: "";
  width: 15px;
  height: 1px;
  margin-left: 10px;
  background: currentColor;
  transition: transform 180ms ease;
}

.link-row a:hover::after,
.mail-link:hover::after {
  transform: translateX(5px);
}

.note-tile > span,
.metric-tile p,
.time-tile time {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.note-tile h2 {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
}

.note-tile p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.section-heading {
  padding: clamp(62px, 9vw, 118px) 0 clamp(34px, 6vw, 70px);
}

.section-heading h2 {
  max-width: 820px;
}

.bento-section {
  scroll-margin-top: 84px;
  padding: clamp(38px, 6vw, 78px) 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title h2 {
  max-width: 560px;
}

.work-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 156px;
}

.tall-image {
  grid-column: span 5;
  grid-row: span 5;
}

.wide-image {
  grid-column: span 7;
  grid-row: span 3;
}

.text-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 3vw, 34px);
}

.work-grid .text-tile {
  grid-column: span 7;
  grid-row: span 2;
}

.text-tile p:not(.eyebrow),
.time-tile p {
  margin: 18px 0 0;
  color: #566171;
  font-size: 0.92rem;
  line-height: 1.72;
}

.muted-tile {
  background: #ecebe6;
}

.plugin-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 156px;
}

.plugin-copy {
  grid-column: span 5;
  grid-row: span 3;
}

.plugin-image {
  grid-column: span 7;
  grid-row: span 4;
}

.metric-tile {
  grid-column: span 5;
  grid-row: span 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 32px);
  background: #e8edf8;
}

.metric-tile > span {
  color: var(--ink);
  font-size: clamp(1.65rem, 3.6vw, 3.2rem);
  font-weight: 620;
  line-height: 0.95;
}

.metric-tile p {
  margin: 0;
  color: var(--muted);
}

.timeline-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.time-tile {
  min-height: 250px;
  padding: 22px;
}

.time-tile h3 {
  margin-top: 32px;
  font-size: 1.03rem;
}

.contact-section {
  scroll-margin-top: 84px;
  padding: clamp(42px, 8vw, 108px) 0;
}

.contact-tile {
  min-height: 300px;
  display: grid;
  align-content: center;
  padding: clamp(26px, 5vw, 56px);
  background: #15171a;
  color: #fff;
}

.contact-tile h2,
.contact-tile .eyebrow,
.contact-tile .mail-link {
  color: inherit;
}

.contact-tile h2 {
  max-width: 820px;
}

.mail-link {
  width: fit-content;
  margin-top: 26px;
  color: inherit;
  font-size: clamp(0.98rem, 1.7vw, 1.34rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 0.84rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 560ms ease,
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-links {
    display: none;
  }

  .hero-grid,
  .work-grid,
  .plugin-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .intro-tile,
  .hero-image-tile,
  .note-tile,
  .tall-image,
  .wide-image,
  .work-grid .text-tile,
  .plugin-copy,
  .plugin-image,
  .metric-tile {
    grid-column: span 6;
  }

  .intro-tile {
    min-height: 420px;
  }

  .hero-image-tile {
    min-height: auto;
    aspect-ratio: 4 / 3;
  }

  .tall-image,
  .wide-image,
  .plugin-image {
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .note-tile {
    min-height: 132px;
  }

  .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --gap: 10px;
    --gutter: 12px;
    --radius: 7px;
  }

  body {
    font-size: 13.5px;
  }

  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    min-height: 52px;
  }

  .brand-mark {
    height: 22px;
  }

  .lang-button {
    min-width: 42px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .bento-main {
    padding-top: 72px;
  }

  .intro-tile {
    min-height: 360px;
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.4rem, 12vw, 3.25rem);
  }

  h2 {
    font-size: clamp(1.32rem, 6.2vw, 2rem);
  }

  h3 {
    font-size: 1.05rem;
  }

  .lead {
    margin-top: 18px;
    font-size: 0.9rem;
    line-height: 1.68;
  }

  .link-row {
    margin-top: 24px;
  }

  .section-heading {
    padding: 50px 0 28px;
  }

  .bento-section {
    padding: 30px 0;
  }

  .section-title {
    display: block;
    margin-bottom: 12px;
  }

  .text-tile,
  .time-tile,
  .metric-tile {
    padding: 18px;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .time-tile {
    min-height: 190px;
  }

  .contact-tile {
    min-height: 260px;
    padding: 24px;
  }

  .site-footer {
    display: grid;
    width: calc(100% - var(--gutter) * 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
