:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-raised: #faf8f2;
  --ink: #171a1d;
  --muted: #626761;
  --line: #d6d2c8;
  --line-strong: #aaa79f;
  --blue: #3559e0;
  --blue-deep: #1f3db4;
  --blue-soft: #e3e8ff;
  --lime: #c8ed64;
  --coral: #ff7f64;
  --code: #12161b;
  --code-ink: #dbe4ee;
  --shadow: 0 24px 80px rgba(27, 32, 45, .14);
  --radius: 22px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111418;
  --paper-raised: #181c21;
  --ink: #f1f0ea;
  --muted: #a8aca6;
  --line: #30363d;
  --line-strong: #555d66;
  --blue: #7690ff;
  --blue-deep: #aebcff;
  --blue-soft: #222b50;
  --lime: #bddd63;
  --coral: #ff9079;
  --code: #090b0e;
  --code-ink: #dce4ec;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 7%, color-mix(in srgb, var(--blue) 11%, transparent) 0, transparent 30rem),
    var(--paper);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--paper) 87%, transparent);
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(1160px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px 9px 9px 3px;
  background: var(--blue);
  color: white;
  font: 800 16px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

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

.text-button,
.theme-button {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--muted);
  border-radius: 9px;
  min-height: 34px;
  padding: 5px 10px;
  font: 650 12px/1 inherit;
  cursor: pointer;
}

.theme-button {
  width: 34px;
  padding: 0;
  font-size: 15px;
}

.text-button:hover,
.theme-button:hover { border-color: var(--line-strong); color: var(--ink); }

main,
footer {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: 720px;
  padding: 92px 0 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, .92fr);
  align-items: center;
  gap: 72px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font: 750 12px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -.065em;
}

.lede {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--blue); color: white; box-shadow: 0 10px 24px color-mix(in srgb, var(--blue) 24%, transparent); }
.button.secondary { background: var(--paper-raised); border-color: var(--line); }
.button.secondary:hover { border-color: var(--line-strong); }

.proof-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
}

.proof-row span { display: inline-flex; align-items: center; gap: 7px; }
.proof-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 20%, transparent); }
.proof-row b { font-weight: 620; }

.credential-stage {
  position: relative;
  min-height: 500px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.credential-stage::before {
  content: "";
  position: absolute;
  z-index: -3;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.credential-stage::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 280px;
  height: 280px;
  border: 1px dashed rgba(255,255,255,.42);
  border-radius: 50%;
}

.orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--blue) 38%, transparent);
  border-radius: 50%;
}

.orbit-one { width: 470px; height: 330px; transform: rotate(28deg); }
.orbit-two { width: 470px; height: 330px; transform: rotate(-28deg); }

.credential-card {
  width: min(410px, 92%);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-raised) 94%, transparent);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  backdrop-filter: blur(18px);
}

.credential-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.micro {
  color: var(--muted);
  font: 750 10px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .13em;
}

.credential-head h2 {
  margin: 5px 0 0;
  font: 720 21px/1.1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  background: color-mix(in srgb, var(--lime) 28%, transparent);
  color: color-mix(in srgb, var(--ink) 86%, #517600);
  font: 700 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.verified span:first-child {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--lime);
  color: #273300;
}

.credential-card dl { margin: 15px 0; }
.credential-card dl div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 8px 0; }
.credential-card dt { color: var(--muted); font: 12px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.credential-card dd { margin: 0; font: 650 13px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; }

.signature {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  color: var(--muted);
  font: 11px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.signature code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.key-tag {
  position: absolute;
  display: grid;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-raised);
  box-shadow: 0 12px 35px rgba(0,0,0,.12);
  font: 11px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.key-tag span { color: var(--muted); }
.key-tag b { font-size: 12px; }
.key-public { top: 54px; right: 8px; transform: rotate(5deg); }
.key-payload { bottom: 47px; left: 0; transform: rotate(-5deg); }

.section {
  border-top: 1px solid var(--line);
  padding: 108px 0;
}

.split {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 90px;
}

.section-heading h2,
.boundary h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: -.045em;
}

.section-heading > p:last-child {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.prose {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.72;
}

.prose p:first-child { margin-top: 0; }
.prose p:last-child { margin-bottom: 0; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principles article { padding: 44px 38px 48px; border-right: 1px solid var(--line); }
.principles article:first-child { padding-left: 0; }
.principles article:last-child { padding-right: 0; border-right: 0; }
.principles .index { color: var(--blue); font: 700 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.principles h3 { margin: 40px 0 12px; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.principles p { margin: 0; color: var(--muted); font-size: 14px; }

.models .section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 70px; align-items: end; }
.models .section-heading .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.models .section-heading > p:last-child { margin: 0; }

.model-table {
  margin-top: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-raised);
}

.model-row {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  align-items: center;
  min-height: 68px;
  border-top: 1px solid var(--line);
}

.model-row:first-child { border-top: 0; }
.model-row > * { padding: 14px 20px; }
.model-row > * + * { border-left: 1px solid var(--line); }
.model-header { min-height: 46px; background: color-mix(in srgb, var(--blue-soft) 55%, transparent); color: var(--muted); font: 700 11px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.model-row strong { font-size: 14px; }
.model-row span { color: var(--muted); font-size: 13px; }
.model-row .forever { color: var(--blue-deep); font-weight: 750; }
.model-note { max-width: 780px; margin: 22px 0 0 auto; color: var(--muted); font-size: 13px; text-align: right; }

.protocol-flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: stretch;
  margin-top: 56px;
}

.protocol-flow article {
  max-width: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-raised);
}

.protocol-flow h3 { margin: 28px 0 8px; font-size: 17px; }
.protocol-flow p { margin: 0; color: var(--muted); font-size: 13px; }
.step-number { color: var(--blue); font: 750 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.flow-arrow { display: grid; place-items: center; padding: 0 13px; color: var(--line-strong); }

.layer-stack {
  width: min(880px, 100%);
  margin: 74px auto 0;
  display: grid;
  gap: 8px;
}

.layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
}

.layer div { display: flex; align-items: center; gap: 18px; }
.layer span { color: var(--muted); font: 750 10px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .11em; }
.layer strong { font-size: 15px; }
.layer code { color: var(--muted); font: 12px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.layer.entitlement { background: var(--blue); color: white; border-color: var(--blue); }
.layer.entitlement span, .layer.entitlement code { color: rgba(255,255,255,.72); }
.layer.activation { width: 92%; margin-inline: auto; background: var(--paper-raised); }
.layer.trial { width: 84%; margin-inline: auto; border-style: dashed; }

.rotation { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: end; }
.key-timeline { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.key-timeline::before { content: ""; position: absolute; top: 8px; left: 9%; right: 9%; height: 1px; background: var(--line-strong); }
.key-timeline div { z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; }
.key-dot { display: block; width: 17px; height: 17px; border: 4px solid var(--paper); border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.key-dot.active { background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.key-dot.next { background: var(--lime); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lime) 70%, #657c00); }
.key-dot.revoked { background: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.key-timeline b { font: 720 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.key-timeline small { color: var(--muted); font-size: 11px; }

.start {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 80px;
  align-items: center;
}

.start h2 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -.045em; }
.start > div:first-child > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.text-link { color: var(--blue-deep); font-weight: 700; font-size: 14px; text-underline-offset: 4px; }

.terminal {
  overflow: hidden;
  border: 1px solid #2a3038;
  border-radius: 18px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px;
  border-bottom: 1px solid #2a3038;
  color: #7f8a96;
  font: 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #46505a; }
.terminal-bar i:first-child { background: var(--coral); }
.terminal-bar i:nth-child(2) { background: #f2c15b; }
.terminal-bar i:nth-child(3) { background: var(--lime); }
.terminal-bar span { margin-left: 5px; }
.terminal pre { margin: 0; padding: 24px; overflow-x: auto; color: var(--code-ink); font: 12px/1.72 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.prompt { color: #8ca0ff; }
.ok { color: var(--lime); }

.boundary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  margin: 30px 0 108px;
  border-radius: var(--radius);
  padding: 58px;
  background: var(--ink);
  color: var(--paper);
}

:root[data-theme="dark"] .boundary { background: #eef0ea; color: #171a1d; }
.boundary .eyebrow { color: var(--lime); }
.boundary > p { margin: 0; color: color-mix(in srgb, currentColor 70%, transparent); font-size: 16px; }

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
  border-top: 1px solid var(--line);
  padding: 34px 0 50px;
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 74px; gap: 36px; }
  .credential-stage { min-height: 490px; }
  .split, .rotation, .start, .boundary { grid-template-columns: 1fr; gap: 42px; }
  .models .section-heading { grid-template-columns: 1fr; }
  .models .section-heading .eyebrow { grid-column: auto; }
  .principles { grid-template-columns: 1fr; }
  .principles article, .principles article:first-child, .principles article:last-child { padding: 34px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .principles article:last-child { border-bottom: 0; }
  .principles h3 { margin-top: 18px; }
  .protocol-flow { grid-template-columns: 1fr; gap: 10px; }
  .protocol-flow article { max-width: none; }
  .flow-arrow { transform: rotate(90deg); height: 18px; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
  .nav-inner { min-height: 62px; }
  .nav-links a { display: none; }
  .hero { min-height: auto; padding: 60px 0 74px; }
  h1 { font-size: clamp(48px, 15vw, 68px); }
  .credential-stage { min-height: 430px; }
  .credential-stage::before { width: 310px; height: 310px; }
  .orbit-one, .orbit-two { width: 360px; height: 270px; }
  .credential-card { padding: 20px; }
  .key-tag { display: none; }
  .section { padding: 78px 0; }
  .model-table { overflow-x: auto; }
  .model-row { min-width: 700px; }
  .layer { align-items: flex-start; flex-direction: column; }
  .layer div { align-items: flex-start; flex-direction: column; gap: 7px; }
  .layer.activation, .layer.trial { width: 100%; }
  .rotation { gap: 48px; }
  .key-timeline { grid-template-columns: repeat(2, 1fr); gap: 28px 0; }
  .key-timeline::before { display: none; }
  .boundary { padding: 38px 28px; margin-bottom: 72px; }
  .footer-links { flex-wrap: wrap; }
}

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