:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5c5c5c;
  --soft: #3d3d3d;
  --line: #e6e6e6;
  --line-strong: #d2d2d2;
  --surface: #f6f6f6;
  --band: #f4f4f4;
  --card: #ffffff;
  --btn-bg: #111111;
  --btn-fg: #ffffff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  --sans: Inter, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
  --radius: 20px;
  --header-h: 76px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c0c0c;
    --fg: #f4f4f4;
    --muted: #b0b0b0;
    --soft: #d0d0d0;
    --line: #2a2a2a;
    --line-strong: #3d3d3d;
    --surface: #161616;
    --band: #111111;
    --card: #141414;
    --btn-bg: #f4f4f4;
    --btn-fg: #111111;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

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

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 40;
  transform: translateY(-160%);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.skip:focus { transform: none; }

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; }

h1 em, h2 em { font-style: normal; color: var(--soft); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 48px));
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.spark { font-weight: 400; }

.brand-name .spark {
  font-size: 0.62em;
  margin-left: 1px;
  vertical-align: super;
}

.brand-meta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav > a:not(.btn) {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav > a:not(.btn):hover {
  color: var(--fg);
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn span { transition: transform 0.2s ease; }

.btn:hover span { transform: translate(2px, -1px); }

.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}

.btn-ghost:hover { background: var(--surface); }

.nav-github { min-height: 40px; padding: 0 16px; }

/* Hero */

.hero { padding: 40px 0 4px; }

.hero .kicker { display: flex; align-items: center; gap: 10px; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  flex: none;
}

.hero h1 {
  margin: 14px 0 0;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 38rem;
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}

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

.stat-panel {
  margin-top: 56px;
  padding: 32px 36px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
}

.stat-top, .stat-bottom, .figure-top, .figure-foot, .project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.project-top span { white-space: nowrap; }

.stat-top b { font-weight: 500; color: var(--fg); margin-left: 8px; }

.stat-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-top: 28px;
}

.stat-label { margin: 0 0 8px; letter-spacing: 0.12em; font-size: 12px; font-weight: 500; color: var(--muted); }

.stat-value {
  margin: 0;
  font-size: clamp(4.2rem, 8vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.stat-value span { font-size: 0.62em; letter-spacing: -0.04em; }

.stat-value small { font-size: 0.28em; margin-left: 4px; letter-spacing: 0; }

.stat-note {
  margin: 0;
  max-width: 16rem;
  text-align: right;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.stat-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  align-items: flex-end;
}

.stat-bottom span { text-align: right; line-height: 1.6; }

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 36px;
}

.mini-bars i {
  display: block;
  width: 6px;
  height: 30%;
  background: var(--fg);
  border-radius: 2px;
}

.mini-bars i:nth-child(3n) { height: 65%; }
.mini-bars i:nth-child(4n) { height: 100%; }
.mini-bars i:nth-child(5n) { height: 48%; }

.hero-index {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Intro */

.intro { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.intro-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr auto;
  gap: 48px;
  align-items: start;
  padding: 72px 0;
}

.intro-inner p {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.intro-inner p strong { font-weight: 500; }

.intro-inner div {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  padding-top: 6px;
}

.intro-mark {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.7;
  color: var(--muted);
  padding-top: 8px;
}

/* Sections */

.section { padding: 112px 0; }

.projects { padding-top: 40px; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.section-head h2, .more-heading h3 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.2;
}

.section-head > p, .more-heading > p {
  margin: 0;
  max-width: 36rem;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  overflow: hidden;
}

.feature-info { padding: 36px 40px 32px; display: flex; flex-direction: column; }

.feature-info .btn { align-self: flex-start; margin-top: 24px; }

.feature-info h3 {
  margin: 28px 0 14px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.2;
}

.feature-info > p:not(.disclaimer) {
  margin: 20px 0 0;
  max-width: 40rem;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.tags span {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.feature-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
}

.feature-metrics strong {
  display: block;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.feature-metrics .metric-lg { font-size: clamp(3rem, 5vw, 4.25rem); letter-spacing: -0.04em; }

.feature-metrics strong small { font-size: 18px; }

.feature-metrics span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

.disclaimer {
  margin: 16px 0 0;
  max-width: 40rem;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 15px;
  font-weight: 500;
  width: fit-content;
}

.text-link span { transition: transform 0.2s ease; }

.text-link:hover span { transform: translate(3px, -1px); }

.feature-art {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  min-width: 0;
}

.feature-art img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 12px;
}

.feature-art > p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.figure-foot { margin-top: auto; padding-top: 8px; }

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

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

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.project-card h3 { margin: 18px 0 12px; font-size: 28px; line-height: 1.25; }

.project-card > p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.card-symbol {
  margin-top: 28px;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.card-symbol span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.card-symbol.brackets { letter-spacing: 0.08em; font-size: 36px; }

.card-symbol.signal {
  font-family: "DejaVu Sans", "Noto Sans Math", serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
}

.card-symbol.signal span { font-family: var(--sans); }

.card-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.card-result b {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card-result b small { font-size: 15px; font-weight: 500; }

.card-result span { font-size: 13px; line-height: 1.6; color: var(--muted); }

.project-card .btn { margin-top: auto; align-self: flex-start; }

.project-card .tags { margin-top: 18px; }

.more-work { margin-top: 72px; }

.about {
  padding: 8px 0 88px;
}

.about h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
}

.about p {
  margin: 0;
  max-width: 46rem;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.more-heading h3 { font-size: clamp(1.7rem, 3vw, 2.25rem); }

.work-list { border-top: 1px solid var(--line); }

.work-list a, .note-list a {
  display: grid;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding 0.2s ease;
}

.work-list a {
  grid-template-columns: 180px minmax(0, 1fr) auto;
  padding: 22px 12px;
  border-radius: 12px;
}

.work-list a > span, .note-list a > span:first-child {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.work-list h4, .note-list h3 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }

.work-list p, .note-list p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }

.work-list b {
  font-size: 18px;
  font-weight: 500;
  transition: transform 0.2s ease;
}

/* Journey */

.journey { background: var(--band); padding: 112px 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.steps article {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps article > span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.steps h3 { margin: 28px 0 10px; font-size: 20px; }

.steps p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--muted); }

.steps small {
  display: block;
  margin-top: auto;
  padding-top: 24px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.journey-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.journey-foot p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--muted); }

.journey-foot .text-link { margin-top: 0; white-space: nowrap; }

/* Notes */

.note-list { border-top: 1px solid var(--line); }

.note-list a {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 26px 12px;
  border-radius: 12px;
}

.note-type {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Closing + footer */

.closing { background: #111111; color: #f5f5f5; }

.closing .kicker { color: #c8c8c8; }

.closing em { color: #d6d6d6; }

.closing-inner { padding: 72px 0 64px; }

.closing h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.closing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.closing-row p { margin: 0; font-size: 16px; line-height: 1.75; color: #d0d0d0; }

.btn-inverse { background: #ffffff; color: #111111; }

.btn-inverse:hover { transform: translateY(-1px); }

.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
}

.footer-brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.footer-brand sup { font-size: 10px; font-weight: 500; }

.footer-inner p { margin: 0; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }

.footer-inner a {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
}

.footer-inner a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (hover: hover) {
  .project-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
  }

  .work-list a:hover, .note-list a:hover {
    background: var(--surface);
    padding-left: 18px;
  }

  .work-list a:hover b { transform: translate(3px, -2px); }

  .steps article { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }

  .steps article:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
  }
}

@media (prefers-color-scheme: dark) {
  .closing { background: #f4f4f4; color: #111111; }
  .closing .kicker { color: #4d4d4d; }
  .closing em { color: #333333; }
  .closing-row { border-top-color: rgba(0, 0, 0, 0.12); }
  .closing-row p { color: #3a3a3a; }
  .btn-inverse { background: #111111; color: #f5f5f5; }
  .feature-art img { background: #fff; }
}

@media (max-width: 980px) {
  .intro-inner { grid-template-columns: 1fr 1fr; }
  .intro-mark { grid-column: 1 / -1; }
  .feature { grid-template-columns: 1fr; }
  .feature-art { border-left: 0; border-top: 1px solid var(--line); }
  .project-grid, .steps { grid-template-columns: 1fr 1fr; }
  .more-grid { grid-template-columns: 1fr 1fr; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 720px) {
  :root { --header-h: 220px; }
  .wrap, .header-inner { width: calc(100% - 40px); }
  .site-header { height: auto; }
  .header-inner { flex-wrap: wrap; padding: 16px 0; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 2.35rem; margin-top: 10px; }
  .lede { font-size: 16px; margin-top: 10px; }
  .hero-actions { margin-top: 16px; }
  .section-head { margin-bottom: 18px; }
  .section-head h2, .more-heading h3 { margin-top: 8px; }
  .feature-info h3 { margin: 14px 0 8px; }
  .feature-metrics { margin-top: 12px; }
  .stat-panel { padding: 24px 20px; border-radius: 20px; }
  .stat-main, .stat-bottom, .closing-row, .journey-foot, .footer-inner { align-items: flex-start; flex-direction: column; }
  .stat-note, .stat-bottom span { text-align: left; }
  .intro-inner { grid-template-columns: 1fr; gap: 20px; padding: 48px 0; }
  .section, .journey { padding: 72px 0; }
  .projects { padding-top: 28px; }
  .about { padding-bottom: 64px; }
  .project-card .btn, .feature-info .btn { align-self: stretch; justify-content: center; }
  .feature-info { padding: 24px 20px; }
  .project-grid, .more-grid, .steps { grid-template-columns: 1fr; }
  .work-list a, .note-list a { grid-template-columns: 1fr auto; }
  .work-list a > span, .note-type { grid-column: 1 / -1; }
  .note-list a > span:first-child { grid-column: auto; }
  .closing-inner { padding: 72px 0; }
  .journey-foot .text-link { white-space: normal; }
}

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