:root {
  --ink: #111827;
  --paper: #edf2f1;
  --sheet: #f8faf9;
  --muted: #5a6673;
  --line: #c5cfcd;
  --signal: #f15b40;
  --teal: #0d7772;
  --teal-pale: #d7ece8;
  --yellow: #f4d35e;
  --shadow: 0 20px 60px rgb(17 24 39 / 12%);
  --max: 1240px;
  --display: "Arial Black", "Aptos Display", "Microsoft YaHei", "PingFang SC", sans-serif;
  --body: "Aptos", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgb(17 24 39 / 3%) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(rgb(17 24 39 / 3%) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--signal) 0 34%, var(--yellow) 34% 67%, var(--teal) 67%);
  content: "";
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

::selection {
  color: white;
  background: var(--teal);
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 4px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgb(237 242 241 / 92%);
  box-shadow: 0 12px 28px rgb(17 24 39 / 7%);
  backdrop-filter: blur(14px);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.brand i {
  color: var(--signal);
  font-style: normal;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: rotate(-3deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 38px);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  background: var(--signal);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.language-toggle,
.header-github {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.language-toggle:hover,
.header-github:hover {
  color: white;
  background: var(--ink);
}

.language-active {
  color: var(--signal);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: clamp(48px, 7vw, 120px);
  min-height: calc(100vh - 80px);
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: clamp(72px, 9vw, 132px) 0 clamp(76px, 9vw, 120px);
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.start-section h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 {
  max-width: 800px;
  font-size: clamp(55px, 8.3vw, 120px);
}

.hero h1 span,
.hero h1 strong {
  display: block;
}

.hero h1 strong {
  width: max-content;
  margin: 0.03em 0;
  padding: 0.01em 0.11em 0.08em;
  color: white;
  background: var(--signal);
  font-family: var(--mono);
  font-size: 0.79em;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.9;
  transform: rotate(-1.4deg);
}

.hero-lede {
  max-width: 690px;
  margin: 38px 0 0;
  color: #3d4855;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-width: 180px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.button-primary {
  color: white;
  background: var(--ink);
}

.button-primary:hover {
  border-color: var(--teal);
  background: var(--teal);
}

.button-quiet:hover {
  color: white;
  background: var(--ink);
}

.hero-record {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 560px;
  justify-self: end;
  padding: 26px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(rgb(17 24 39 / 5%) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--sheet);
  box-shadow: 18px 18px 0 var(--teal);
  transform: rotate(1deg);
}

.hero-record::before {
  position: absolute;
  top: 12px;
  left: -20px;
  width: 64px;
  height: 18px;
  background: rgb(244 211 94 / 82%);
  content: "";
  transform: rotate(-8deg);
}

.record-topline {
  display: flex;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.record-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
}

.record-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgb(13 119 114 / 12%);
}

.hero-record dl {
  margin: 28px 0;
}

.hero-record dl > div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.hero-record dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-record dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.record-claim {
  margin-top: 30px;
  padding: 18px;
  border-left: 5px solid var(--signal);
  background: #fff;
}

.record-claim span {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.record-claim p {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.record-stamp {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 86px;
  height: 86px;
  border: 4px double var(--signal);
  border-radius: 50%;
  color: var(--signal);
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-13deg);
  opacity: 0.84;
}

.manifesto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: white;
  background: var(--ink);
}

.manifesto p {
  margin: 0;
  padding: 26px clamp(20px, 4vw, 56px);
  border-right: 1px solid rgb(255 255 255 / 19%);
  font-family: var(--mono);
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 700;
  text-align: center;
}

.manifesto p:last-child {
  border-right: 0;
}

.section {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: clamp(92px, 11vw, 160px) 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: 64px;
  margin-bottom: 58px;
}

.section h2,
.start-section h2 {
  max-width: 850px;
  font-size: clamp(42px, 6vw, 82px);
}

.section-heading > p,
.reader-intro > p,
.start-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.lineage-lab {
  border: 2px solid var(--ink);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.lineage-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr) 28px) minmax(0, 1fr);
  align-items: stretch;
  padding: 22px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
}

.lineage-track > i {
  align-self: center;
  color: rgb(255 255 255 / 45%);
  font-family: var(--mono);
  font-style: normal;
  text-align: center;
}

.lineage-step {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgb(255 255 255 / 21%);
  color: white;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.lineage-step:hover {
  transform: translateY(-3px);
}

.lineage-step.is-active {
  color: var(--ink);
  background: var(--yellow);
}

.lineage-step > span,
.lineage-step small {
  font-family: var(--mono);
  font-size: 9px;
}

.lineage-step b {
  font-size: 14px;
}

.lineage-step small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.68;
}

.lineage-detail {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 48px;
  min-height: 250px;
  padding: clamp(30px, 5vw, 64px);
}

.detail-index {
  margin: 0 0 18px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.lineage-detail h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.lineage-detail > p {
  margin: 0;
  font-size: 19px;
}

.lineage-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lineage-detail li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--signal), var(--signal)) 0 20px / 7px 2px no-repeat;
  font-size: 15px;
}

.workflows-section {
  width: 100%;
  max-width: none;
  padding-right: max(20px, calc((100vw - var(--max)) / 2));
  padding-left: max(20px, calc((100vw - var(--max)) / 2));
  background: var(--teal-pale);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.workflow-card {
  position: relative;
  grid-column: span 2;
  min-height: 410px;
  padding: 30px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--sheet);
}

.workflow-card:nth-child(4),
.workflow-card:nth-child(5) {
  grid-column: span 3;
  min-height: 350px;
}

.workflow-source {
  color: white;
  background: var(--teal);
}

.card-code {
  display: inline-grid;
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid currentColor;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.workflow-card h3 {
  margin: 32px 0 16px;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
}

.workflow-source p {
  color: rgb(255 255 255 / 78%);
}

.workflow-card ul {
  position: absolute;
  right: 30px;
  bottom: 26px;
  left: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-card li {
  padding: 4px 8px;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 9px;
}

.readers-section {
  display: grid;
  grid-template-columns: 0.83fr 1.17fr;
  gap: clamp(50px, 8vw, 120px);
  align-items: start;
}

.reader-intro {
  position: sticky;
  top: 125px;
}

.reader-intro h2 {
  margin-bottom: 30px;
}

.reader-stack {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.reader-stack li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 22px;
  min-height: 135px;
  padding: 24px 0;
  border-bottom: 2px solid var(--ink);
}

.reader-stack li > span {
  display: grid;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.reader-stack b {
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: -0.03em;
}

.reader-stack p {
  margin: 7px 0 0;
  color: var(--muted);
}

.toolkit-section {
  width: 100%;
  max-width: none;
  padding-right: max(20px, calc((100vw - var(--max)) / 2));
  padding-left: max(20px, calc((100vw - var(--max)) / 2));
  color: white;
  background: var(--ink);
}

.toolkit-section .eyebrow {
  color: var(--yellow);
}

.toolkit-section .section-heading > p {
  color: rgb(255 255 255 / 65%);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid rgb(255 255 255 / 25%);
  border-left: 1px solid rgb(255 255 255 / 25%);
}

.tool-grid article {
  min-width: 0;
  min-height: 260px;
  padding: 32px;
  border-right: 1px solid rgb(255 255 255 / 25%);
  border-bottom: 1px solid rgb(255 255 255 / 25%);
}

.tool-grid article > span {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.tool-grid h3 {
  margin: 38px 0 14px;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: clamp(15px, 2vw, 22px);
  overflow-wrap: anywhere;
}

.tool-grid p {
  max-width: 500px;
  margin: 0;
  color: rgb(255 255 255 / 67%);
}

.check-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.check-strip span {
  position: relative;
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.check-strip span::before {
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.start-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px 80px;
  align-items: center;
}

.start-copy > p:last-child {
  max-width: 650px;
  margin-top: 26px;
}

.command-card {
  border: 2px solid var(--ink);
  background: var(--sheet);
  box-shadow: 14px 14px 0 var(--signal);
}

.command-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
}

.command-bar > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--signal);
}

.command-bar > span:nth-child(2) { background: var(--yellow); }
.command-bar > span:nth-child(3) { background: var(--teal); }

.command-bar small {
  margin-left: auto;
  color: rgb(255 255 255 / 55%);
  font-family: var(--mono);
  font-size: 10px;
}

.command-card code {
  display: block;
  padding: 48px 30px;
  font-family: var(--mono);
  font-size: clamp(18px, 3vw, 31px);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.command-card button {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.command-card button:hover {
  color: white;
  background: var(--teal);
}

.start-links {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 30px;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.start-links a {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

.start-links a:hover {
  color: white;
  background: var(--teal);
}

footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 30px;
  padding: 40px max(20px, calc((100vw - var(--max)) / 2));
  border-top: 2px solid var(--ink);
  background: var(--sheet);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

footer p:last-child {
  text-align: right;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr 0.75fr;
    gap: 42px;
  }

  .hero h1 {
    font-size: clamp(54px, 8vw, 86px);
  }

  .hero-record {
    min-height: 520px;
  }

  .lineage-track {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .lineage-track > i {
    display: none;
  }

  .lineage-step {
    padding: 12px;
  }

  .lineage-step small {
    display: none;
  }
}

@media (max-width: 800px) {
  body {
    font-size: 16px;
  }

  .header-github {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 84px;
  }

  .hero-record {
    width: calc(100% - 18px);
    max-width: none;
    min-height: 500px;
    justify-self: start;
  }

  .section-heading,
  .readers-section,
  .start-section,
  .lineage-detail {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 26px;
  }

  .lineage-detail {
    gap: 24px;
  }

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

  .workflow-card,
  .workflow-card:nth-child(4),
  .workflow-card:nth-child(5) {
    grid-column: span 1;
  }

  .workflow-card:last-child {
    grid-column: 1 / -1;
  }

  .reader-intro {
    position: static;
  }

  .start-links {
    grid-template-columns: 1fr;
  }

  footer {
    grid-template-columns: 1fr;
  }

  footer p:last-child {
    text-align: left;
  }
}

@media (max-width: 560px) {
  html {
    scroll-padding-top: 72px;
  }

  .site-header {
    min-height: 66px;
    padding: 10px 16px;
  }

  .brand {
    gap: 8px;
    font-size: 12px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .language-toggle {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .hero,
  .section {
    width: min(calc(100% - 28px), var(--max));
  }

  .hero {
    padding-top: 68px;
  }

  .hero h1 {
    font-size: clamp(45px, 14vw, 67px);
  }

  .hero-lede {
    font-size: 18px;
  }

  .button {
    width: 100%;
  }

  .hero-record {
    min-height: 520px;
    padding: 20px;
    box-shadow: 10px 10px 0 var(--teal);
  }

  .hero-record dl > div {
    grid-template-columns: 62px 1fr;
  }

  .record-stamp {
    right: 18px;
    bottom: 18px;
    width: 70px;
    height: 70px;
    font-size: 10px;
  }

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

  .manifesto p {
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 19%);
    text-align: left;
  }

  .section {
    padding: 86px 0;
  }

  .workflows-section,
  .toolkit-section {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .section h2,
  .start-section h2 {
    font-size: clamp(39px, 12vw, 56px);
  }

  .lineage-track {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .lineage-step {
    flex: 0 0 142px;
    scroll-snap-align: start;
  }

  .lineage-step small {
    display: block;
  }

  .workflow-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card,
  .workflow-card:nth-child(4),
  .workflow-card:nth-child(5),
  .workflow-card:last-child {
    grid-column: 1;
    min-height: 380px;
  }

  .tool-grid article {
    min-height: 230px;
    padding: 25px;
  }

  .reader-stack li {
    grid-template-columns: 48px 1fr;
    gap: 14px;
  }

  .command-card {
    box-shadow: 8px 8px 0 var(--signal);
  }

  .start-links {
    grid-column: 1;
  }

  footer {
    padding: 32px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .hero-actions,
  .language-toggle,
  .command-card button {
    display: none;
  }

  body {
    background: white;
  }

  .hero,
  .section {
    min-height: auto;
    padding: 32px 0;
  }
}
