:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --ink: #151515;
  --muted: #5c625f;
  --line: #c9c7bf;
  --line-strong: #151515;
  --accent: #2457d6;
  --accent-ink: #ffffff;
  --accent-soft: #dbe5ff;
  --signal: #126c49;
  --signal-soft: #d9eee5;
  --inverse: #17191c;
  --inverse-ink: #f7f4ec;
  --grid: rgba(21, 21, 21, 0.07);
  --shadow: 8px 8px 0 rgba(21, 21, 21, 0.14);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --max-width: 1240px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111315;
  --surface: #191c1f;
  --surface-strong: #202429;
  --ink: #f3f0e8;
  --muted: #b0b5b3;
  --line: #3a4044;
  --line-strong: #f3f0e8;
  --accent: #85a7ff;
  --accent-ink: #101b3a;
  --accent-soft: #27375e;
  --signal: #72d7ab;
  --signal-soft: #183b2e;
  --inverse: #f0ede5;
  --inverse-ink: #17191c;
  --grid: rgba(255, 255, 255, 0.055);
  --shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button,
a { touch-action: manipulation; }

button { font: inherit; }

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 8px;
  transform: translateY(-150%);
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.section-shell,
.site-header,
.site-footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand-mark-small { width: 34px; height: 34px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color 180ms var(--ease);
}

.site-nav a:hover { color: var(--ink); }

.theme-toggle {
  justify-self: end;
  min-width: 84px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.theme-toggle:hover { background: var(--accent-soft); }

.theme-icon { width: 18px; height: 18px; }
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

.hero {
  min-height: min(780px, calc(100dvh - 88px));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .72fr);
  align-items: center;
  gap: clamp(48px, 7vw, 104px);
  padding-block: clamp(72px, 10vw, 136px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.eyebrow span {
  min-width: 36px;
  color: var(--accent);
}

.hero h1,
.section-heading h2,
.notes-intro h2,
.now-title-block h2,
.closing h2,
.error-card h1 {
  margin: 0;
  font-size: clamp(2.75rem, 6.9vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-lede {
  max-width: 650px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.button svg,
.card-link svg,
.text-link svg { width: 20px; height: 20px; }

.button-primary {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--line-strong);
}

.button-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line-strong); }
.button-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line-strong); }
.button-secondary { background: var(--surface); }
.button-secondary:hover { background: var(--accent-soft); }

.signal-card {
  overflow: hidden;
  color: var(--inverse-ink);
  background: var(--inverse);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transform: rotate(1.25deg);
}

.signal-head,
.signal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.signal-head { border-bottom: 1px solid color-mix(in srgb, var(--inverse-ink) 28%, transparent); }

.signal-dot { display: flex; align-items: center; gap: 7px; }
.signal-dot span { width: 8px; height: 8px; background: #72d7ab; border-radius: 50%; box-shadow: 0 0 0 4px rgba(114, 215, 171, .12); }
.signal-body { padding: clamp(28px, 4vw, 48px); }
.signal-kicker { margin: 0 0 20px; color: #aeb7c2; font-family: var(--font-mono); font-size: 12px; }
.signal-body h2 { margin: 0; font-size: clamp(1.55rem, 2.5vw, 2.35rem); line-height: 1.2; letter-spacing: -.04em; }
.signal-list { margin: 34px 0 0; padding: 0; list-style: none; border-top: 1px solid color-mix(in srgb, var(--inverse-ink) 24%, transparent); }
.signal-list li { display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 15px 0; border-bottom: 1px solid color-mix(in srgb, var(--inverse-ink) 18%, transparent); font-size: 14px; }
.signal-list span { color: #72d7ab; font-family: var(--font-mono); }
.signal-foot { color: #aeb7c2; border-top: 1px solid color-mix(in srgb, var(--inverse-ink) 28%, transparent); }

.ticker {
  overflow: hidden;
  color: var(--accent-ink);
  background: var(--accent);
  border-block: 1px solid var(--line-strong);
}

.ticker-track {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.ticker i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }

.content-section { padding-block: clamp(88px, 11vw, 152px); }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .5fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 56px;
}

.section-heading h2,
.notes-intro h2,
.now-title-block h2,
.closing h2 { font-size: clamp(2.5rem, 5vw, 5rem); }
.section-heading > p,
.notes-intro > p:last-child,
.now-title-block > p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  grid-column: span 6;
  min-height: 490px;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease);
}

.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); background: var(--surface-strong); }
.project-featured { grid-column: span 7; }
.project-grid .project-card:nth-child(2) { grid-column: span 5; }
.project-draft { grid-column: 4 / span 6; cursor: default; background: transparent; border-style: dashed; }
.project-draft:hover { transform: none; box-shadow: none; background: transparent; }

.project-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-index,
.project-status,
.access-label { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.project-index,
.project-status { color: var(--muted); }
.access-label { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; color: var(--signal); background: var(--signal-soft); border-radius: 999px; }
.access-label svg { width: 14px; height: 14px; }
.project-icon { width: 78px; height: 78px; display: grid; place-items: center; margin: 48px 0 42px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 50%; }
.project-icon svg { width: 38px; height: 38px; }
.project-copy { max-width: 560px; }
.project-copy h3 { margin: 8px 0 14px; font-size: clamp(2rem, 3.5vw, 3.5rem); line-height: 1; letter-spacing: -.05em; }
.project-copy p:last-child { margin: 0; color: var(--muted); font-size: 1rem; }
.card-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 30px; font-weight: 750; }
.project-card:not(.project-draft):hover .card-link svg { transform: translateX(5px); }
.card-link svg { transition: transform 180ms var(--ease); }

.notes-section {
  color: var(--inverse-ink);
  background: var(--inverse);
  border-block: 1px solid var(--line-strong);
}

.notes-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1fr); gap: clamp(64px, 10vw, 150px); }
.eyebrow-light { color: #aeb7c2; }
.notes-intro > p:last-child { max-width: 440px; margin-top: 28px; color: #bfc5cc; }
.timeline { margin: 0; padding: 0; list-style: none; border-top: 1px solid color-mix(in srgb, var(--inverse-ink) 28%, transparent); }
.timeline li { display: grid; grid-template-columns: 100px 1fr; gap: 32px; padding: 32px 0; border-bottom: 1px solid color-mix(in srgb, var(--inverse-ink) 22%, transparent); }
.timeline time { color: #72d7ab; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.timeline h3 { margin: 0 0 8px; font-size: 1.3rem; line-height: 1.35; }
.timeline p { margin: 0; color: #bfc5cc; }

.now-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1fr); gap: clamp(64px, 9vw, 136px); }
.now-title-block > p:last-child { max-width: 520px; margin-top: 28px; }
.now-list { border-top: 1px solid var(--line-strong); }
.now-list article { display: grid; grid-template-columns: 70px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.now-number { color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.now-list h3 { margin: 0 0 8px; font-size: 1.35rem; }
.now-list p { margin: 0; color: var(--muted); }

.closing { padding-block: clamp(48px, 8vw, 112px) clamp(104px, 13vw, 176px); }
.closing h2 { max-width: 950px; }
.text-link { width: max-content; min-height: 48px; display: inline-flex; align-items: center; gap: 12px; margin-top: 36px; color: var(--accent); font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.text-link svg { transition: transform 180ms var(--ease); }
.text-link:hover svg { transform: translateX(5px); }

.site-footer {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-block: 32px;
  border-top: 1px solid var(--line-strong);
}
.site-footer > div { display: flex; align-items: center; gap: 14px; }
.site-footer p { margin: 0; color: var(--muted); font-size: 13px; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.error-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.error-card { width: min(680px, 100%); padding: clamp(32px, 7vw, 72px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.error-card h1 { font-size: clamp(3.2rem, 9vw, 6.5rem); }
.error-card > p:not(.eyebrow) { max-width: 500px; margin: 28px 0; color: var(--muted); font-size: 1.1rem; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .signal-card { width: min(560px, 92%); margin-inline: auto; transform: rotate(.5deg); }
  .section-heading,
  .notes-layout,
  .now-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; gap: 24px; }
  .project-featured,
  .project-grid .project-card:nth-child(2),
  .project-draft { grid-column: span 12; }
  .project-card { min-height: 450px; }
  .notes-layout,
  .now-grid { gap: 56px; }
}

@media (max-width: 600px) {
  .section-shell,
  .site-header,
  .site-footer { width: min(calc(100% - 28px), var(--max-width)); }
  .site-header { min-height: 76px; gap: 12px; }
  .brand { gap: 9px; font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .theme-toggle { min-width: 48px; width: 48px; padding: 8px; }
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hero { min-height: auto; padding-block: 72px 88px; gap: 64px; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.5rem); }
  .hero-lede { line-height: 1.7; }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .signal-card { width: 96%; }
  .signal-body { padding: 28px 24px; }
  .signal-foot { flex-wrap: wrap; }
  .ticker-track { justify-content: flex-start; gap: 12px; }
  .content-section { padding-block: 88px; }
  .section-heading { margin-bottom: 36px; }
  .project-grid { gap: 16px; }
  .project-card { min-height: 440px; padding: 24px; }
  .project-icon { width: 66px; height: 66px; margin: 40px 0 36px; }
  .project-icon svg { width: 32px; height: 32px; }
  .project-topline { align-items: flex-start; }
  .access-label { max-width: 140px; text-align: right; }
  .notes-layout,
  .now-grid { gap: 48px; }
  .timeline li { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .now-list article { grid-template-columns: 44px 1fr; gap: 12px; }
  .site-footer { align-items: flex-start; flex-direction: column; padding-block: 36px; }
  .site-footer > div { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #555; }
  :root[data-theme="dark"] { --line: #c9c9c9; }
}
