:root {
  --bg: #eceff1;
  --bg-2: #e4e9ec;
  --text: #0b1014;
  --text-2: #33424d;
  --muted: #71808a;
  --line: rgba(11,16,20,.10);
  --line-soft: rgba(11,16,20,.06);
  --blue: #0077c8;
  --cyan: #49c9f2;
  --teal: #0cb9a5;
  --yellow: #f2c84b;
  --nav-active-fg: #ffffff;
  --max: 77.5rem;

  /* Licat semantic scale — backed by Open Props 1.7.23 */
  --space-1: var(--size-1);
  --space-2: var(--size-2);
  --space-3: var(--size-3);
  --space-4: var(--size-4);
  --space-5: var(--size-5);
  --space-6: var(--size-6);
  --space-7: var(--size-7);
  --space-8: var(--size-8);
  --space-9: var(--size-9);
  --space-10: var(--size-10);

  --radius-control: var(--radius-2);
  --radius-card: var(--radius-3);
  --radius-panel: var(--radius-4);
  --radius-pill: var(--radius-round);

  --ease-ui: var(--ease-3);
  --ease-emphasized: var(--ease-5);

  --apple-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  /* Neutral material, tinted by the existing blue/teal environment beneath it. */
  --apple-glass-blur: 18px;
  --apple-glass-saturate: 145%;
  --apple-glass-bg-ultra-thin: rgba(245,250,253,.58);
  --apple-glass-bg-regular: rgba(249,252,255,.71);
  --apple-glass-bg-thick: rgba(252,254,255,.86);
  --apple-glass-border: rgba(255,255,255,.78);
  --apple-glass-sheen: rgba(255,255,255,.54);
  --apple-glass-inner-rim: inset 0 1px 0 rgba(255,255,255,.94), inset 0 -1px 0 rgba(38,74,99,.13);
  --apple-glass-shadow: 0 16px 36px rgba(29,55,70,.11), 0 3px 10px rgba(29,55,70,.04);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(72,198,240,.13), transparent 24%),
    radial-gradient(circle at 88% 34%, rgba(10,185,165,.10), transparent 25%),
    linear-gradient(180deg, #f0f3f5 0%, var(--bg) 48%, #f5f7f8 100%);
  font-family: var(--apple-font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .42;
  background:
    radial-gradient(circle at 1px 1px, rgba(13,31,41,.045) 1px, transparent 1.35px) 0 0 / 22px 22px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
a:focus-visible { outline: 3px solid rgba(0,119,200,.26); outline-offset: 4px; }
.shell { width: min(var(--max), calc(100% - 2.625rem)); margin: 0 auto; }

/* Apple material: kept as material, not composition */
.apple-glass-base {
  border: 1px solid var(--apple-glass-border);
  box-shadow: var(--apple-glass-shadow), var(--apple-glass-inner-rim);
  backdrop-filter: blur(var(--apple-glass-blur)) saturate(var(--apple-glass-saturate));
  -webkit-backdrop-filter: blur(var(--apple-glass-blur)) saturate(var(--apple-glass-saturate));
  transform: translateZ(0);
}
.apple-glass-ultra-thin { background: var(--apple-glass-bg-ultra-thin); }
.apple-glass-regular { background: var(--apple-glass-bg-regular); }
.apple-glass-thick { background: var(--apple-glass-bg-thick); }

/* ───────────────────────── Header / floating capsule */
.site-header {
  position: fixed;
  top: .875rem;
  left: 0;
  right: 0;
  z-index: 80;
  width: min(var(--max), calc(100% - 2.625rem));
  margin: 0 auto;
  border-radius: var(--radius-pill);
  /* The leading highlight catches light without an optical distortion shader. */
  background:
    linear-gradient(122deg, var(--apple-glass-sheen), rgba(255,255,255,0) 58%),
    var(--apple-glass-bg-ultra-thin);
  box-shadow: 0 15px 42px rgba(25,56,81,.15), var(--apple-glass-inner-rim);
}
.site-header .shell { width: 100%; }
.nav {
  min-height: 4.375rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) .625rem var(--space-2) .875rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  flex-shrink: 0;
}
.brand img {
  width: 2.375rem;
  height: 2.375rem;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: .8125rem; letter-spacing: .08em; }
.brand small { margin-top: var(--space-1); color: var(--muted); font: 700 .5625rem/1 var(--apple-font-family); letter-spacing: .13em; }

.nav-links {
  --nav-indicator-x: .1875rem;
  --nav-indicator-w: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .1875rem;
  min-width: 0;
  padding: .1875rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: 40%;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-indicator {
  position: absolute;
  z-index: 0;
  top: .1875rem;
  left: 0;
  width: var(--nav-indicator-w);
  height: calc(100% - .375rem);
  border-radius: var(--radius-pill);
  background: var(--text);
  box-shadow:
    0 6px 18px rgba(0,0,0,.13),
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(0,0,0,.14);
  opacity: 0;
  transform: translate3d(var(--nav-indicator-x),0,0);
  pointer-events: none;
  will-change: transform, width;
  transition:
    transform .46s cubic-bezier(.16,1,.3,1),
    width .46s cubic-bezier(.16,1,.3,1),
    opacity .18s ease,
    background-color .3s cubic-bezier(.16,1,.3,1);
}
.nav-links.nav-ready .nav-indicator { opacity: 1; }
.nav-links.nav-instant .nav-indicator { transition: none; }

.nav-pill {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  padding: .625rem .9375rem;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  background: transparent;
  font-size: .8125rem;
  font-weight: 620;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition:
    color .32s cubic-bezier(.16,1,.3,1),
    transform .25s ease,
    opacity .25s ease;
}
.nav-pill > span {
  width: var(--space-1);
  height: var(--space-1);
  border-radius: 50%;
  background: currentColor;
  opacity: .38;
  transition: opacity .25s ease, background-color .25s ease, transform .25s ease;
}
.nav-pill:hover { transform: translateY(-1px); }
.nav-pill.active { color: var(--nav-active-fg); }
.nav-pill.active > span {
  opacity: 1;
  background: var(--cyan);
  transform: scale(1.15);
}

.nav-actions { display: flex; align-items: center; gap: var(--space-2); }

.theme-toggle {
  width: 2.625rem;
  height: 2.625rem;
  flex: 0 0 2.625rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--apple-glass-border);
  border-radius: 50%;
  color: var(--text);
  background:
    linear-gradient(130deg, var(--apple-glass-sheen), transparent 66%),
    var(--apple-glass-bg-regular);
  box-shadow: 0 6px 18px rgba(29,55,70,.10), var(--apple-glass-inner-rim);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  cursor: pointer;
  transform: translateZ(0);
  transition:
    background-color .3s cubic-bezier(.16,1,.3,1),
    color .3s cubic-bezier(.16,1,.3,1),
    border-color .3s cubic-bezier(.16,1,.3,1),
    box-shadow .3s cubic-bezier(.16,1,.3,1);
}
.theme-toggle:hover {
  background:
    linear-gradient(130deg, var(--apple-glass-sheen), transparent 66%),
    var(--apple-glass-bg-thick);
  box-shadow: 0 9px 21px rgba(29,55,70,.14), var(--apple-glass-inner-rim);
}
.theme-toggle-track {
  position: relative;
  width: 1.1875rem;
  height: 1.1875rem;
  display: block;
}
.theme-icon {
  position: absolute;
  inset: 0;
  width: 1.1875rem;
  height: 1.1875rem;
  transition:
    opacity .28s cubic-bezier(.16,1,.3,1),
    transform .42s cubic-bezier(.16,1,.3,1);
}
.theme-icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-icon-moon { opacity: 0; transform: rotate(-55deg) scale(.55); }
:root[data-theme="dark"] .theme-icon-sun { opacity: 0; transform: rotate(55deg) scale(.55); }
:root[data-theme="dark"] .theme-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

.lang {
  display: inline-flex;
  padding: .1875rem;
  border: 1px solid var(--apple-glass-border);
  border-radius: var(--radius-pill);
  background: var(--apple-glass-bg-regular);
  box-shadow: inset 0 1px 0 var(--apple-glass-sheen), 0 2px 7px rgba(29,55,70,.06);
}
.lang a {
  min-width: 2.125rem;
  padding: var(--space-2) .5625rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  text-align: center;
  font-size: .6875rem;
  font-weight: 750;
}
.lang a[aria-current="page"] {
  color: #fff;
  background: var(--text);
  box-shadow: 0 3px 10px rgba(18,34,47,.19), inset 0 1px 0 rgba(255,255,255,.25);
}
.github-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: .3125rem .3125rem .3125rem .875rem;
  border: 1px solid var(--apple-glass-border);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(125deg, var(--apple-glass-sheen), transparent 66%),
    var(--apple-glass-bg-regular);
  box-shadow: 0 5px 18px rgba(29,55,70,.10), var(--apple-glass-inner-rim);
  font-size: .8125rem;
  font-weight: 650;
}
.github-mark { width: var(--space-3); height: var(--space-3); }
.github-cta b {
  width: 2.125rem;
  height: 2.125rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--text);
  font-size: var(--space-3);
}

/* ───────────────────────── Hero */
.hero-wrap {
  position: relative;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.56), transparent 32%),
    linear-gradient(180deg, rgba(232,242,247,.84), rgba(238,243,245,.48));
}
.hero {
  position: relative;
  z-index: 7;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(8.25rem, 14vh, 10.75rem);
  padding-bottom: clamp(3.375rem, 7vh, 5.25rem);
}

.hero-ghost {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 1.6px rgba(12,32,43,.075);
  font-size: clamp(11.25rem, 23vw, 24.375rem);
  font-weight: 900;
  line-height: .78;
  letter-spacing: -.07em;
}

.system-flow {
  position: absolute;
  z-index: 4;
  top: 4vh;
  right: -9vw;
  width: min(1980px, 118vw);
  height: min(780px, 68vh);
  pointer-events: none;
  filter: drop-shadow(0 28px 50px rgba(43,125,167,.10));
  will-change: transform;
}
.system-flow svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.flow-ribbon-shadow,
.flow-ribbon-back,
.flow-ribbon-main,
.flow-ribbon-front {
  stroke: none;
}
.flow-ribbon-shadow { opacity: .82; }
.flow-ribbon-back { opacity: .88; }
.flow-ribbon-main { opacity: .95; }
.flow-ribbon-front { opacity: .72; }
.flow-rim {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.flow-glow {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  will-change: transform;
}
.flow-glow-a {
  width: 720px;
  height: 720px;
  top: -130px;
  right: -120px;
  background: radial-gradient(circle, rgba(54,194,244,.31), transparent 69%);
}
.flow-glow-b {
  width: 560px;
  height: 560px;
  top: 36%;
  right: 18%;
  background: radial-gradient(circle, rgba(21,198,170,.20), transparent 70%);
}

/* The landscape is now an immersive environment layer, not a card. */
.hero-scene {
  position: absolute;
  z-index: 2;
  inset: 0 0 0 36%;
  width: auto;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  opacity: .76;
  box-shadow: none;
  transform: translateZ(0);
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 8%, #000 36%, #000 100%);
  mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 8%, #000 36%, #000 100%);
}
.hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(238,243,245,.44) 0%, transparent 34%),
    linear-gradient(180deg, rgba(230,240,245,.06), rgba(230,240,245,.08) 65%, rgba(236,241,244,.44) 100%);
  pointer-events: none;
}
.hero-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(236,241,244,.54));
  pointer-events: none;
}
.hero-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
  filter: saturate(.86) contrast(.96) brightness(1.04);
  transform: scale(1.035);
  will-change: transform;
}

.eyebrow {
  position: relative;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: .5625rem;
  margin: 0 0 clamp(1.125rem,2.4vh,1.75rem);
  color: var(--text-2);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.eyebrow::before {
  content: "";
  width: .75rem;
  height: 1px;
  background: currentColor;
}
.eyebrow::after {
  content: "";
  width: var(--space-1);
  height: var(--space-1);
  margin-left: .1875rem;
  border-radius: 50%;
  background: var(--teal);
}

.hero-title {
  position: relative;
  z-index: 6;
  margin: 0;
  max-width: min(73.75rem, 90vw);
  color: var(--text);
  font-size: clamp(4.5rem, 7.45vw, 7.75rem);
  font-weight: 840;
  line-height: .90;
  letter-spacing: -.062em;
}
html[lang="zh-CN"] .hero-title {
  font-size: clamp(4.875rem, 8.4vw, 8.5rem);
  line-height: .92;
  letter-spacing: -.06em;
}
.hero-line {
  display: flex;
  align-items: center;
  gap: clamp(.625rem,1.15vw,1.25rem);
  min-height: .95em;
}
.hero-line:not(.hero-line-mixed) { overflow: hidden; }
.hero-word { display: inline-block; will-change: transform, opacity; }
.hero-accent { color: var(--blue); }
.hero-line-mixed { flex-wrap: wrap; }
.hero-inline-note {
  width: min(16.25rem, 18vw);
  margin-right: var(--space-1);
  color: var(--text-2);
  font-size: clamp(.6875rem,.86vw,.875rem);
  font-weight: 440;
  line-height: 1.42;
  letter-spacing: 0;
}
.hero-paren {
  display: inline-block;
  color: var(--text);
  font-size: .72em;
  font-weight: 420;
  line-height: 1;
}
.hero-logo-token {
  width: clamp(3.375rem, 4.5vw, 4.5rem);
  height: clamp(3.375rem, 4.5vw, 4.5rem);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.90);
  box-shadow: 0 12px 26px rgba(26,71,95,.13), inset 0 1px 0 rgba(255,255,255,.95);
}
.hero-logo-token img { width: 86%; height: 86%; object-fit: contain; }
.hero-signal {
  display: inline-flex;
  align-items: center;
  min-height: clamp(2.875rem, 4vw, 4rem);
  padding: 0 1.125rem;
  border-radius: var(--radius-pill);
  color: #fff;
  background: linear-gradient(135deg, #0a85c4, #0aa897);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 18px 30px rgba(0,119,200,.16);
  font-size: clamp(.625rem,.76vw,.75rem);
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.hero-badge {
  position: absolute;
  z-index: 9;
  left: 53%;
  top: 61%;
  width: 7.375rem;
  height: 7.375rem;
  will-change: transform;
}
.hero-badge > svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: ring-spin 18s linear infinite; }
.hero-badge text { fill: var(--text-2); font-size: .5rem; font-weight: 720; letter-spacing: .125rem; }
.hero-badge defs path { fill: none; }
.hero-badge > span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.25rem;
  height: 2.25rem;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  box-shadow: 0 6px 15px rgba(0,0,0,.08), inset 0 1px 0 #fff;
}
.hero-badge img { width: 1.875rem; height: 1.875rem; object-fit: contain; }
@keyframes ring-spin { to { transform: rotate(360deg); } }

.hero-bottom {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr minmax(20.625rem, 25.625rem);
  align-items: end;
  gap: 3.5rem;
  margin-top: clamp(2.625rem, 6vh, 4.5rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .625rem; }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 1.375rem;
  padding: var(--space-2) var(--space-2) var(--space-2) 1.25rem;
  border: 1px solid var(--apple-glass-border);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(125deg, var(--apple-glass-sheen), transparent 60%),
    var(--apple-glass-bg-regular);
  box-shadow: 0 9px 26px rgba(24,65,87,.13), var(--apple-glass-inner-rim);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  font-size: .8125rem;
  font-weight: 670;
}
.hero-cta b {
  width: 2.125rem;
  height: 2.125rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}
.hero-cta-dark {
  color: #fff;
  border-color: rgba(255,255,255,.2);
  background: var(--text);
  box-shadow: 0 10px 28px rgba(15,32,43,.19), inset 0 1px 0 rgba(255,255,255,.2);
}
.hero-cta:not(.hero-cta-dark):hover,
.github-cta:hover { box-shadow: 0 12px 28px rgba(24,65,87,.16), var(--apple-glass-inner-rim); }
.theme-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hero-cta-dark b { color: var(--text); }

.hero-resources {
  position: relative;
  z-index: 9;
  display: grid;
  border-top: 1px solid rgba(12,32,43,.16);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.hero-resource {
  display: grid;
  grid-template-columns: 5.125rem 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem var(--space-1);
  border-bottom: 1px solid rgba(12,32,43,.16);
  color: var(--muted);
  transition: color .22s ease, padding .22s ease;
}
.hero-resource span { font-size: .625rem; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.hero-resource strong { color: currentColor; font-size: .8125rem; font-weight: 680; }
.hero-resource b { font-size: .9375rem; }
.hero-resource:hover,
.hero-resource.active { color: var(--text); padding-left: var(--space-2); }

/* ───────────────────────── Sections */
.section { padding: 6.5rem 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2.125rem;
  margin-bottom: 2.125rem;
}
.kicker {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: .625rem;
  font-weight: 780;
  letter-spacing: .22em;
}
.section h2 {
  margin: 0;
  font-size: clamp(2.5rem,4.6vw,4rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.section-note { max-width: 26.875rem; margin: 0; color: var(--muted); text-align: right; font-size: .8125rem; line-height: 1.7; }

/* Purposeful colour behind the project glass; not a page-wide neon wash. */
#projects {
  background:
    radial-gradient(ellipse at 18% 25%, rgba(73,174,217,.16), transparent 50%),
    radial-gradient(ellipse at 88% 84%, rgba(231,188,152,.13), transparent 48%);
}

/* Bento project composition */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0,1fr));
  gap: var(--space-3);
}
.project {
  position: relative;
  min-height: 18.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5625rem;
  border-radius: 1.5rem;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.project:nth-child(1),
.project:nth-child(4),
.project:nth-child(5),
.project:nth-child(8) { grid-column: span 7; }
.project:nth-child(2),
.project:nth-child(3),
.project:nth-child(6),
.project:nth-child(7) { grid-column: span 5; }
.project:nth-child(1),
.project:nth-child(4) { min-height: 20.625rem; }
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 95% 5%, rgba(70,165,205,.14), transparent 37%),
    linear-gradient(140deg, rgba(255,255,255,.32), transparent 47%);
}
.project::after {
  position: absolute;
  right: 1.25rem;
  bottom: -1.375rem;
  color: rgba(18,47,63,.055);
  font-size: 7.25rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.08em;
}
.project:nth-child(1)::after { content: "01"; }
.project:nth-child(2)::after { content: "02"; }
.project:nth-child(3)::after { content: "03"; }
.project:nth-child(4)::after { content: "04"; }
.project:nth-child(5)::after { content: "05"; }
.project:nth-child(6)::after { content: "06"; }
.project:nth-child(7)::after { content: "07"; }
.project:nth-child(8)::after { content: "08"; }
.project > * { position: relative; z-index: 1; }
.project:hover {
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 23px 49px rgba(29,66,86,.17), var(--apple-glass-inner-rim);
}
.project-top { display: flex; justify-content: space-between; align-items: start; }
.project-icon {
  width: 3.125rem;
  height: 3.125rem;
  display: grid;
  place-items: center;
  border-radius: .9375rem;
  color: #096b99;
  background: rgba(226,245,252,.74);
  border: 1px solid var(--apple-glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.93), inset 0 -1px 0 rgba(33,103,133,.10);
}
.project-icon svg { width: var(--space-5); height: var(--space-5); }
.project-arrow { color: #80919b; font-size: var(--space-4); }
.project h3 { margin: 1.625rem 0 .625rem; font-size: clamp(1.1875rem,1.7vw,1.5625rem); line-height: 1.08; letter-spacing: -.025em; }
.project p { max-width: 40.625rem; margin: 0; color: #62717b; font-size: .84375rem; line-height: 1.72; }
.tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.1875rem; }
.tag {
  padding: .3125rem var(--space-2);
  border-radius: var(--radius-pill);
  color: #3f7189;
  background: rgba(235,247,251,.72);
  border: 1px solid rgba(255,255,255,.80);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
  font-size: .625rem;
  font-weight: 720;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4375rem .75rem;
  margin-top: auto;
  padding-top: var(--space-5);
  color: #71818b;
  font-size: .65625rem;
  font-weight: 650;
}
.project-meta span + span::before { content: "•"; margin-right: .75rem; color: #b7c3c9; }

/* Journey */
.journey {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.22);
  border-top: 1px solid rgba(255,255,255,.68);
  border-bottom: 1px solid rgba(255,255,255,.68);
}
.journey::before {
  content: "BUILD / ITERATE / MAINTAIN";
  position: absolute;
  right: -1.25rem;
  top: 1.125rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(15,37,49,.06);
  font-size: clamp(4.375rem,11vw,10.625rem);
  font-weight: 900;
  letter-spacing: -.06em;
  white-space: nowrap;
  pointer-events: none;
}
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: var(--space-8);
  margin-top: 2.625rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 1.0625rem;
  left: 1.0625rem;
  right: 1.0625rem;
  height: 1px;
  background: rgba(31,92,122,.24);
}
.phase { position: relative; padding-top: 3.25rem; }
.phase-dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06709f;
  background: rgba(237,249,252,.82);
  border: 5px solid #eef2f4;
  box-shadow: 0 0 0 1px rgba(44,160,197,.25);
  font-size: .625rem;
  font-weight: 850;
}
.phase time { color: var(--muted); font-size: .6875rem; font-weight: 760; letter-spacing: .04em; }
.phase h3 { margin: .6875rem 0 .4375rem; font-size: 1.125rem; }
.phase p { margin: 0; color: #76858e; font-size: .8125rem; line-height: 1.7; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-3); }
.principle {
  min-height: 11.5rem;
  position: relative;
  padding: 1.625rem 1.5625rem 1.5rem 4.875rem;
  border-radius: 1.375rem;
  transform-style: preserve-3d;
  will-change: transform;
}
.principle-icon {
  position: absolute;
  left: var(--space-5);
  top: 1.625rem;
  width: 2.375rem;
  height: 2.375rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #087ca9;
  background: rgba(226,246,252,.76);
}
.principle-no { position: absolute; right: 1.25rem; top: 1.0625rem; color: #b7c3c9; font-size: .625rem; font-weight: 800; }
.principle h3 { margin: var(--space-1) 0 var(--space-2); font-size: var(--space-4); letter-spacing: -.02em; }
.principle p { margin: 0; color: #75848d; font-size: .8125rem; line-height: 1.65; }

/* Footer */
.site-footer {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}
.footer-row {
  min-height: 8rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
}
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand img { width: 2.75rem; height: 2.75rem; object-fit: contain; }
.footer-brand strong { display:block; font-size:.75rem; letter-spacing:.06em; }
.footer-brand small { display:block; margin-top:var(--space-1); color:var(--muted); font-size:.6875rem; }
.footer-links { display:flex; gap:var(--space-4); color:var(--text-2); font-size:.75rem; }
.footer-note { justify-self:end; max-width:17.5rem; color:var(--muted); text-align:right; font-size:.75rem; }

/* Dark material */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101416;
  --bg-2: #171c1f;
  --text: #f5f5f7;
  --text-2: #d1d1d6;
  --muted: #9ea7ad;
  --line: rgba(255,255,255,.12);
  --line-soft: rgba(255,255,255,.07);
  --blue: #38a7ff;
  --nav-active-fg: #111111;
  --apple-glass-bg-ultra-thin: rgba(25,37,45,.66);
  --apple-glass-bg-regular: rgba(28,40,48,.76);
  --apple-glass-bg-thick: rgba(30,43,52,.87);
  --apple-glass-border: rgba(228,244,255,.20);
  --apple-glass-sheen: rgba(231,248,255,.12);
  --apple-glass-inner-rim: inset 0 1px 0 rgba(235,248,255,.23), inset 0 -1px 0 rgba(0,0,0,.28);
  --apple-glass-shadow: 0 17px 39px rgba(0,0,0,.28), 0 3px 10px rgba(0,0,0,.12);
}
:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 5%, rgba(44,153,224,.12), transparent 24%),
    radial-gradient(circle at 88% 34%, rgba(13,186,165,.09), transparent 25%),
    linear-gradient(180deg,#101416,#13191c 48%,#0d1113);
}
:root[data-theme="dark"] body::before { opacity: .20; filter: invert(1); }
:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .hero-logo-token,
:root[data-theme="dark"] .hero-badge > span { background: rgba(255,255,255,.94); }
:root[data-theme="dark"] .github-cta b,
:root[data-theme="dark"] .hero-cta-dark { background: #f5f5f7; color: #111; }
:root[data-theme="dark"] .github-cta {
  background:
    linear-gradient(125deg, var(--apple-glass-sheen), transparent 66%),
    var(--apple-glass-bg-regular);
}
:root[data-theme="dark"] .theme-toggle {
  color: #f5f5f7;
  background:
    linear-gradient(130deg, var(--apple-glass-sheen), transparent 66%),
    var(--apple-glass-bg-regular);
  border-color: var(--apple-glass-border);
  box-shadow: 0 7px 20px rgba(0,0,0,.24), var(--apple-glass-inner-rim);
}
:root[data-theme="dark"] .theme-toggle:hover { background: var(--apple-glass-bg-thick); }
:root[data-theme="dark"] .lang { background: var(--apple-glass-bg-regular); }
:root[data-theme="dark"] .lang a[aria-current="page"] {
  background: #f5f5f7; color: #111;
  box-shadow: 0 3px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.55);
}
:root[data-theme="dark"] .hero-ghost { -webkit-text-stroke-color: rgba(255,255,255,.055); }
:root[data-theme="dark"] .system-flow {
  opacity: .72;
  filter: drop-shadow(0 24px 44px rgba(0,0,0,.20));
}
:root[data-theme="dark"] .flow-ribbon-shadow { opacity: .46; }
:root[data-theme="dark"] .flow-ribbon-back { opacity: .64; }
:root[data-theme="dark"] .flow-ribbon-main { opacity: .78; }
:root[data-theme="dark"] .flow-ribbon-front { opacity: .56; }
:root[data-theme="dark"] .flow-rim { opacity: .34; }
:root[data-theme="dark"] .hero-wrap {
  background:
    radial-gradient(circle at 14% 22%, rgba(20,36,45,.58), transparent 32%),
    linear-gradient(180deg, #0f171b, #101416);
}
:root[data-theme="dark"] .hero-scene { opacity:.56; }
:root[data-theme="dark"] .hero-scene::before {
  background:
    linear-gradient(90deg, rgba(16,20,22,.54) 0%, transparent 36%),
    linear-gradient(180deg, rgba(16,20,22,.08), rgba(16,20,22,.10) 65%, rgba(16,20,22,.52) 100%);
}
:root[data-theme="dark"] .hero-scene::after {
  background: linear-gradient(180deg, transparent, rgba(16,20,22,.62));
}
:root[data-theme="dark"] .hero-scene img { filter: saturate(.74) contrast(1.04) brightness(.60); }
:root[data-theme="dark"] .hero-resource,
:root[data-theme="dark"] .hero-resources { border-color: rgba(255,255,255,.13); }
:root[data-theme="dark"] .hero-cta {
  background: linear-gradient(125deg, var(--apple-glass-sheen), transparent 62%), var(--apple-glass-bg-regular);
  border-color: var(--apple-glass-border);
}
:root[data-theme="dark"] .hero-cta-dark {
  color: #111;
  background: #f5f5f7;
  border-color: transparent;
}
:root[data-theme="dark"] .hero-cta b { background:#f5f5f7; color:#111; }
:root[data-theme="dark"] .hero-cta-dark b { background:#111; color:#fff; }
:root[data-theme="dark"] .project p,
:root[data-theme="dark"] .project-meta,
:root[data-theme="dark"] .phase p,
:root[data-theme="dark"] .phase time,
:root[data-theme="dark"] .principle p,
:root[data-theme="dark"] .section-note { color: var(--muted); }
:root[data-theme="dark"] .project::after { color: rgba(255,255,255,.04); }
:root[data-theme="dark"] .tag { color:#b8dff3; background:rgba(41,151,255,.09); border-color:rgba(255,255,255,.08); }
:root[data-theme="dark"] .journey { background:rgba(0,0,0,.12); border-color:rgba(255,255,255,.08); }
:root[data-theme="dark"] .journey::before { -webkit-text-stroke-color: rgba(255,255,255,.04); }
:root[data-theme="dark"] .phase-dot { border-color:#13191c; background:rgba(41,151,255,.13); color:#7ec8ff; }
:root[data-theme="dark"] #projects {
  background:
    radial-gradient(ellipse at 18% 25%, rgba(61,151,194,.13), transparent 52%),
    radial-gradient(ellipse at 88% 84%, rgba(149,117,87,.10), transparent 48%);
}

/* Fallback */
@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .apple-glass-ultra-thin,
  .apple-glass-regular,
  .apple-glass-thick,
  .hero-cta,
  .theme-toggle,
  .lang,
  .github-cta { background: rgba(250,253,255,.97); }

  :root[data-theme="dark"] .apple-glass-ultra-thin,
  :root[data-theme="dark"] .apple-glass-regular,
  :root[data-theme="dark"] .apple-glass-thick,
  :root[data-theme="dark"] .hero-cta,
  :root[data-theme="dark"] .theme-toggle,
  :root[data-theme="dark"] .lang,
  :root[data-theme="dark"] .github-cta { background: rgba(28,36,42,.97); }
  .hero-cta-dark { background: #0b1014; color: #fff; }
  :root[data-theme="dark"] .hero-cta-dark { background: #f5f5f7; color: #111; }
}

/* Responsive */
@media (max-width: 1050px) {
  .site-header { border-radius: 1.75rem; }
  .nav {
    grid-template-columns: 1fr auto;
    row-gap: .1875rem;
    padding-bottom: .5625rem;
  }
  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
    padding: .1875rem;
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: clamp(9.75rem, 17vh, 11.75rem);
  }
  .hero-title { font-size: clamp(4rem, 8.4vw, 6rem); }
  html[lang="zh-CN"] .hero-title { font-size: clamp(4.375rem, 9.3vw, 6.75rem); }
  .hero-inline-note { width: 13.4375rem; }
  .hero-badge { left: 58%; top: 61%; }
  .system-flow {
    top: 2vh;
    right: -32vw;
    width: 146vw;
    height: 62vh;
  }
  .hero-scene { left: 43%; opacity: .62; }
  .project:nth-child(n) { grid-column: span 6; }
}

@media (max-width: 760px) {
  .shell { width:min(var(--max),calc(100% - 1.75rem)); }

  .site-header {
    position: fixed;
    top: .625rem;
    width: calc(100% - 1.25rem);
    margin: 0 auto;
    border-radius: 1.5rem;
  }
  .nav { min-height:3.875rem; padding:.4375rem .5rem .5625rem .6875rem; row-gap: var(--space-1); }
  .brand img { width:2.125rem; height:2.125rem; }
  .nav-links {
    margin-top: .125rem;
    padding-inline: .1875rem;
    scroll-padding-inline: 34%;
  }
  .nav-pill { padding: .5625rem .8125rem; font-size: .75rem; }
  .theme-toggle { width:2.375rem; height:2.375rem; flex-basis:2.375rem; }
  .theme-toggle-track,.theme-icon { width:1.0625rem; height:1.0625rem; }
  .github-cta span,.github-mark { display:none; }
  .github-cta { padding:var(--space-1); background:transparent; box-shadow:none; }
  .lang a { min-width:1.875rem; padding:.4375rem; }

  .hero-wrap {
    min-height: 100svh;
    min-height: 100dvh;
  }
  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    justify-content: flex-start;
    padding-top: clamp(9.25rem, 18vh, 11rem);
    padding-bottom: 2.75rem;
  }

  .system-flow {
    top: 8px;
    right: -470px;
    width: 1120px;
    height: 470px;
    opacity: .88;
  }
  .flow-glow-a { width:430px; height:430px; right:-130px; top:-40px; }
  .flow-glow-b { width:340px; height:340px; top:34%; right:-60px; }

  .hero-ghost {
    top: 45%;
    font-size: clamp(8.25rem, 42vw, 11.875rem);
    opacity: .74;
  }

  .hero-scene {
    inset: auto -38% 0 32%;
    width: auto;
    height: 48%;
    opacity: .48;
    -webkit-mask-image:
      linear-gradient(90deg, transparent 0%, rgba(0,0,0,.28) 15%, #000 46%, #000 100%);
    mask-image:
      linear-gradient(90deg, transparent 0%, rgba(0,0,0,.28) 15%, #000 46%, #000 100%);
  }
  .hero-scene img {
    object-position: 63% center;
    transform: scale(1.06);
  }

  .eyebrow { margin-bottom:1.125rem; font-size:.5625rem; }
  .hero-title {
    max-width: 100%;
    font-size: clamp(3.125rem, 14.8vw, 4.5rem);
    line-height:.92;
  }
  html[lang="zh-CN"] .hero-title {
    max-width: 100%;
    font-size: clamp(3.25rem, 15.2vw, 4.625rem);
    line-height:.94;
  }
  .hero-line { gap:var(--space-2); }
  .hero-line-mixed { margin:.3125rem 0; }
  .hero-inline-note {
    order:5;
    width:100%;
    max-width:20.625rem;
    margin:.625rem 0 var(--space-1);
    font-size:.6875rem;
    line-height:1.5;
  }
  .hero-logo-token { width:2.875rem; height:2.875rem; }
  .hero-signal { min-height:2.625rem; padding:0 .75rem; font-size:.5625rem; }
  .hero-badge { display:none; }

  .hero-bottom {
    grid-template-columns:1fr;
    gap:1.875rem;
    margin-top: auto;
    padding-top: 2.375rem;
  }
  .hero-resources { max-width:100%; }

  .section { padding:4.25rem 0; }
  .section-head { align-items:start; flex-direction:column; gap:.9375rem; }
  .section-note { text-align:left; }
  .projects { grid-template-columns:1fr; }
  /* Repeated content cards stay readable without sampling many backdrops on small GPUs. */
  .project,
  .principle { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--apple-glass-bg-thick); }
  .project:nth-child(n) { grid-column:1; min-height:17.1875rem; }
  .timeline { grid-template-columns:1fr; gap:0; }
  .timeline::before { top:1.0625rem; bottom:1.875rem; left:1.0625rem; right:auto; width:1px; height:auto; }
  .phase { padding:0 0 2.375rem 3.625rem; }
  .phase-dot { top:-.25rem; }
  .principles { grid-template-columns:1fr; }
  .footer-row { min-height:0; padding:1.875rem 0; grid-template-columns:1fr; gap:var(--space-4); }
  .footer-note { justify-self:start; text-align:left; }
}

@media (max-width: 430px) {
  .brand span { display:none; }
  .hero {
    padding-top: 9.375rem;
  }
  .hero-title { font-size: clamp(2.875rem, 14.2vw, 4rem); }
  html[lang="zh-CN"] .hero-title { font-size: clamp(3rem, 14.6vw, 4.125rem); }
  .hero-paren { font-size:.62em; }
  .hero-logo-token { width:2.625rem; height:2.625rem; }
  .hero-signal { min-height:2.375rem; padding:0 .5625rem; }
  .hero-actions { width:100%; }
  .hero-cta { flex:1; justify-content:space-between; }
  .hero-resource { grid-template-columns:4.5rem 1fr auto; }
}

#projects,
#journey,
#principles { scroll-margin-top: 9.375rem; }

@supports (animation-timeline: view(inline)) {
  @media (max-width: 1050px) {
    .nav-pill {
      animation: nav-picker-focus linear both;
      animation-timeline: view(inline);
      animation-range: entry 15% cover 50%;
    }
    @keyframes nav-picker-focus {
      from { opacity: .62; transform: scale(.95); }
      to { opacity: 1; transform: scale(1); }
    }
  }
}

/* Accessibility: avoid translucency when the user requests stable high-contrast surfaces. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .apple-glass-base,
  .hero-cta,
  .theme-toggle,
  .lang,
  .github-cta { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header, .project, .principle, .hero-cta:not(.hero-cta-dark), .theme-toggle, .lang, .github-cta {
    background: #f5f9fc;
    border-color: #8497a4;
  }
  :root[data-theme="dark"] .site-header,
  :root[data-theme="dark"] .project,
  :root[data-theme="dark"] .principle,
  :root[data-theme="dark"] .hero-cta:not(.hero-cta-dark),
  :root[data-theme="dark"] .theme-toggle,
  :root[data-theme="dark"] .lang,
  :root[data-theme="dark"] .github-cta {
    background: #202d35;
    border-color: #8aabbf;
  }
}

@media (forced-colors: active) {
  .apple-glass-base, .hero-cta, .theme-toggle, .github-cta, .lang, .tag {
    color: CanvasText;
    background: Canvas;
    border: 1px solid CanvasText;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-indicator { background: Highlight; box-shadow: none; }
  .nav-pill.active { color: HighlightText; }
  .lang a[aria-current="page"] { color: HighlightText; background: Highlight; }
}

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

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .36s;
  animation-timing-function: cubic-bezier(.16,1,.3,1);
}
