/* Layout concept: a control-room schematic. Faint grid ground, wide heavy display type,
   mono labels that read like system paths, one indigo accent and a teal signal for "live". */
:root {
  color-scheme: dark;
  --bg: #0a0d14;
  --bg-alt: #0e121c;
  --panel: #131827;
  --panel-2: #1a2033;
  --line: #242b40;
  --grid: rgba(139, 147, 255, 0.05);
  --fg: #e8eaf4;
  --muted: #9097ad;
  --accent: #8b93ff;
  --accent-strong: #a7adff;
  --accent-ink: #0a0d14;
  --accent-soft: rgba(139, 147, 255, 0.14);
  --signal: #3dd6b5;
  --signal-soft: rgba(61, 214, 181, 0.14);
  --warn: #f0a44b;
  --app: #c9cde0;
  --code-k: #a7adff;
  --code-s: #7fe3cb;
  --code-n: #f0a44b;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(2.35rem, 1.3rem + 4.2vw, 4.6rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  --fs-h3: 1.2rem;
  --fs-lead: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-mono: 0.78rem;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-pad: clamp(72px, 9vw, 128px);
  --maxw: 1200px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f6fa;
    --bg-alt: #eceef5;
    --panel: #ffffff;
    --panel-2: #f1f2f8;
    --line: #d9dce8;
    --grid: rgba(79, 70, 229, 0.05);
    --fg: #0e1220;
    --muted: #535a70;
    --accent: #4f46e5;
    --accent-strong: #3f37c9;
    --accent-ink: #ffffff;
    --accent-soft: rgba(79, 70, 229, 0.1);
    --signal: #0f9e80;
    --signal-soft: rgba(15, 158, 128, 0.12);
    --warn: #c46f0c;
    --app: #5b6178;
    --code-k: #4f46e5;
    --code-s: #0f7f68;
    --code-n: #b0600a;
    --shadow: 0 30px 70px -35px rgba(20, 24, 50, 0.35);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-alt: #eceef5;
  --panel: #ffffff;
  --panel-2: #f1f2f8;
  --line: #d9dce8;
  --grid: rgba(79, 70, 229, 0.05);
  --fg: #0e1220;
  --muted: #535a70;
  --accent: #4f46e5;
  --accent-strong: #3f37c9;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --signal: #0f9e80;
  --signal-soft: rgba(15, 158, 128, 0.12);
  --warn: #c46f0c;
  --app: #5b6178;
  --code-k: #4f46e5;
  --code-s: #0f7f68;
  --code-n: #b0600a;
  --shadow: 0 30px 70px -35px rgba(20, 24, 50, 0.35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
ul, ol, dl, dd { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.02em; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-mono);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--signal);
}
.eyebrow .mono { text-transform: none; letter-spacing: 0.04em; }
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 750;
  font-stretch: 112%;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; font-stretch: 105%; }
.lead, .section__lead { font-size: var(--fs-lead); color: var(--muted); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.95rem/1 var(--font-body);
  padding: 14px 22px; border-radius: 10px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--small { padding: 10px 16px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
  height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand__mark { width: 30px; height: 30px; color: var(--accent); }
.brand__dot { fill: var(--accent); }
.brand__dot--signal { fill: var(--signal); }
.brand__word { font-family: var(--font-display); font-weight: 800; font-stretch: 125%; font-size: 1.15rem; letter-spacing: 0.06em; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--muted); font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.nav__links a:hover { color: var(--fg); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__burger { display: none; }

@media (max-width: 1180px) {
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
  .nav__links a:last-child { border-bottom: 0; }
  .nav__actions { margin-left: auto; }
  .nav__burger { display: inline-grid; }
}
@media (max-width: 520px) { .nav__cta { display: none; } }
.nav__cta { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 96px) clamp(48px, 6vw, 80px);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--muted); }
.hero__tags li { display: inline-flex; align-items: center; gap: 8px; }
.hero__tags li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }

.hero__in { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cluster {
  margin: 0; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.cluster__bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); color: var(--muted); flex-wrap: wrap;
}
.cluster__led { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.cluster__status { margin-left: auto; color: var(--signal); transition: color .3s ease; }
.cluster__status.is-warn { color: var(--warn); }
#clusterCanvas { display: block; width: 100%; height: 380px; }
.cluster__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.cluster__legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw--agent { background: var(--accent); }
.sw--app { background: var(--app); }
.sw--svc { background: var(--signal); }
.sw--link { width: 16px; height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 7px); }

.facts {
  position: relative; z-index: 1;
  margin-top: clamp(48px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.fact { padding: 22px 22px 4px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fact + .fact { padding-left: 22px; border-left: 1px solid var(--line); }
.fact dt { font-family: var(--font-display); font-weight: 800; font-stretch: 120%; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.fact dd { color: var(--muted); font-size: var(--fs-small); max-width: 30ch; }

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  #clusterCanvas { height: 320px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  #clusterCanvas { height: 260px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .fact + .fact { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-pad); }
/* Jump links target the block that carries the section label, so they land on the heading. */
.anchor { scroll-margin-top: 24px; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-direction: column; gap: 16px; margin-bottom: clamp(36px, 5vw, 56px); max-width: 780px; }
.section__head--center { align-items: center; text-align: center; margin-inline: auto; }
.section__head--center .section__lead { margin-inline: auto; }

/* Platform stack */
.stack { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.tier { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 24px 28px; align-items: start; }
.tier + .tier { border-top: 1px solid var(--line); }
.tier__label { display: flex; flex-direction: column; gap: 4px; }
.tier__label .mono { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
.tier__label strong { font-family: var(--font-display); font-stretch: 110%; font-size: 1.15rem; }
.tier__items { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; color: var(--muted); font-size: 0.95rem; }
.tier__items li { display: flex; gap: 10px; align-items: baseline; }
.tier__items li::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 1px; background: var(--accent); transform: translateY(-2px); }
.tier--net { grid-template-columns: minmax(0, 1fr); padding: 14px 28px; background: var(--accent-soft); position: relative; }
.tier--net p { color: var(--accent); text-align: center; position: relative; }
.net__line {
  position: absolute; inset: 50% 0 auto 0; height: 1px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px);
  opacity: .35; animation: flow 1.6s linear infinite;
}
@keyframes flow { to { background-position: 12px 0; } }
.tier--net p { background: color-mix(in srgb, var(--panel) 75%, var(--accent-soft)); display: table; margin-inline: auto; padding: 2px 12px; border-radius: 99px; }
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.work__col { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--panel-2); min-width: 0; }
.work__col .mono { text-transform: uppercase; letter-spacing: 0.14em; }
.work__col p { color: var(--muted); font-size: 0.92rem; }
.work__col--agent .mono { color: var(--accent); }
.work__col--app .mono { color: var(--app); }
.work__col--svc .mono { color: var(--signal); }
.stack__note { margin-top: 16px; color: var(--muted); font-size: var(--fs-small); font-family: var(--font-mono); }

/* Build-up of the architecture block. main.js sets .build-pending (and a --d delay per part)
   only when it can also start the animation, so without script the block is simply complete. */
.work__col--agent { --c: var(--accent); }
.work__col--app { --c: var(--app); }
.work__col--svc { --c: var(--signal); }
.build-pending.stack { opacity: 0; transform: translateY(14px); }
.build-run.stack {
  opacity: 1; transform: none;
  border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), 0 0 44px -14px var(--signal);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1), border-color 1.2s ease, box-shadow 1.2s ease;
}
.build-done.stack { border-color: var(--line); box-shadow: none; }
.build-pending .tier,
.build-pending .tier__items li,
.build-pending .tier--net p,
.build-pending .work__col,
.build-pending + .stack__note { opacity: 0; }
.build-pending .tier { transform: translateY(14px); }
.build-pending .tier--net { transform: none; }
.build-pending .tier__items li { transform: translateX(-10px); }
.build-pending .net__line { transform: scaleX(0); }
.build-pending .work__col { transform: scale(0.96); }
.net__line { transform-origin: left center; }
.build-run .tier,
.build-run .tier__items li,
.build-run .tier--net p,
.build-run .work__col,
.build-run + .stack__note {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0ms);
}
.build-run .net__line { transform: scaleX(1); transition: transform .6s cubic-bezier(.4, 0, .2, 1) var(--d, 0ms); }
.build-run .work__col { animation: tile-flash 1s ease var(--d, 0ms); }
@keyframes tile-flash {
  0%, 20% { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 28px -6px var(--c); }
  100% { border-color: var(--line); box-shadow: none; }
}

@media (max-width: 860px) {
  .tier { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; }
  .tier__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .tier__items { grid-template-columns: minmax(0, 1fr); } }

.caps { margin-top: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.cap { padding: 28px 24px 28px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; border-bottom: 1px solid var(--line); }
.cap:not(:nth-child(4n+1)) { padding-left: 24px; border-left: 1px solid var(--line); }
.cap h3 { font-family: var(--font-display); font-stretch: 108%; font-size: 1.08rem; }
.cap p { color: var(--muted); font-size: 0.94rem; }
.cap__icon { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 960px) {
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cap:not(:nth-child(4n+1)) { padding-left: 0; border-left: 0; }
  .cap:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .caps { grid-template-columns: minmax(0, 1fr); }
  .cap:nth-child(2n) { padding-left: 0; border-left: 0; }
}

/* Split layout */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.split__text { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.split__visual { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.split--reverse .split__text { order: 2; }
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split--reverse .split__text { order: 0; }
}

.ticks { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--muted); }
.ticks li strong { color: var(--fg); font-weight: 600; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px;
  border-left: 2px solid var(--signal); border-bottom: 2px solid var(--signal); transform: rotate(-45deg);
}
.runtimes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font-mono); font-size: var(--fs-mono); padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
.chip--accent { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip--dashed { border-style: dashed; color: var(--muted); background: transparent; }
.chip { transition: border-color .35s ease, color .35s ease, background-color .35s ease, box-shadow .35s ease; }
.chip.is-on { border-color: var(--signal); color: var(--signal); background: var(--signal-soft); box-shadow: 0 0 18px -6px var(--signal); }

.code { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.code__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.code pre { margin: 0; padding: 20px; overflow-x: auto; font-size: 0.82rem; line-height: 1.7; color: var(--fg); }
.code .k { color: var(--code-k); }
.code .s { color: var(--code-s); }
.code .n { color: var(--code-n); }

.log { list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 8px 0; }
.log li { padding: 8px 16px; display: flex; gap: 12px; color: var(--muted); flex-wrap: wrap; }
.log__hash { color: var(--accent); }
.log__undo { color: var(--signal) !important; }
.log__undo .log__hash { color: var(--signal); text-decoration: line-through; }
.log__ok { color: var(--signal) !important; }
.log__ok .log__hash { color: var(--signal); }

/* Rotating code examples (main.js): fade between examples, type the next one in line by line. */
.code pre, .log { transition: opacity .3s ease; }
.code.is-fading pre, .log.is-fading { opacity: 0; }
.code__cursor { display: inline-block; width: .6em; background: var(--signal); color: transparent; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.log.is-new li { animation: rise .4s ease both; }
.log.is-new li:nth-child(2) { animation-delay: .12s; }
.log.is-new li:nth-child(3) { animation-delay: .24s; }

/* Domains */
/* The 3 × 5 grid doubles as a pixel font: main.js lights tiles to spell OSAIOS. */
.domains {
  margin-top: clamp(56px, 7vw, 88px); padding-top: 36px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: center;
}
.domains__text { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.domains .h3 { font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); font-stretch: 112%; line-height: 1.15; }
.domains__lead { color: var(--muted); max-width: 42ch; }
.domains__list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.domains__list li {
  display: flex; align-items: center; min-height: 58px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  font-weight: 500; font-size: 0.92rem; line-height: 1.3; min-width: 0; overflow-wrap: break-word; hyphens: auto;
  transition: border-color .25s ease, color .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.domains__list li:hover { border-color: var(--accent); color: var(--accent); }
.domains__list li.is-lit { border-color: var(--signal); color: var(--signal); background: var(--signal-soft); box-shadow: 0 0 0 1px var(--signal), 0 0 26px -8px var(--signal); }
@media (max-width: 860px) { .domains { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .domains__list { gap: 6px; }
  .domains__list li { min-height: 52px; padding: 8px 9px; font-size: 0.78rem; }
}

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: none; }
.step { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.step__n { color: var(--accent); font-size: 0.9rem; transition: color .4s ease; }
.step { transition: border-color .4s ease, box-shadow .4s ease; }
.step.is-on { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), 0 0 32px -10px var(--signal); }
.step.is-on .step__n { color: var(--signal); }
.step h3 { font-family: var(--font-display); font-stretch: 110%; font-size: 1.3rem; }
.step p { color: var(--muted); flex: 1; }
.step__cmd { display: block; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--signal); overflow-x: auto; white-space: nowrap; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 40px; right: -17px; width: 18px; height: 1px;
  background: var(--accent);
}
@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step:not(:last-child)::after { top: auto; bottom: -17px; right: auto; left: 40px; width: 1px; height: 18px; }
}
.req { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 16px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.req__label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
.req__list { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.req__list div { display: flex; gap: 8px; align-items: baseline; }
.req__list dt { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--muted); }
.req__list dd { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Security */
.sec { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); min-width: 0; }
.sec li {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 16px 12px; border-bottom: 1px solid var(--line);
  transition: background-color .4s ease, color .4s ease, box-shadow .4s ease;
}
.sec li.is-on { background: var(--signal-soft); color: var(--fg); box-shadow: inset 3px 0 0 var(--signal); }
.sec__k { color: var(--signal); padding-top: 3px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.1em; }
@media (max-width: 480px) { .sec li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 16px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); min-width: 0; }
.plan--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan h3 { font-family: var(--font-display); font-stretch: 118%; font-size: 1.6rem; font-weight: 800; }
.badge { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; padding: 5px 10px; border-radius: 99px; background: var(--signal-soft); color: var(--signal); white-space: nowrap; }
.plan__for { color: var(--muted); flex: 1; }
.plan__price { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--muted); padding-block: 14px; border-block: 1px dashed var(--line); }
@media (max-width: 860px) { .plans { grid-template-columns: minmax(0, 1fr); } }

/* Process */
.process { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.process li { display: flex; gap: 14px; min-width: 0; }
.process .mono { color: var(--accent); padding-top: 3px; }
.process strong { font-family: var(--font-display); font-stretch: 108%; }
.process p { color: var(--muted); font-size: 0.94rem; }
@media (max-width: 480px) { .process { grid-template-columns: minmax(0, 1fr); } }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 480px) { .form__row { grid-template-columns: minmax(0, 1fr); } .form { padding: 20px; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: var(--fs-small); font-weight: 500; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--warn); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); color: var(--muted); cursor: pointer; }
.consent input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.consent.is-invalid { color: var(--warn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__msg { font-size: var(--fs-small); min-height: 1.2em; }
.form__alt { font-size: var(--fs-small); color: var(--muted); }
.form__alt a { color: var(--accent); }
.form__msg.is-ok { color: var(--signal); }
.form__msg.is-err { color: var(--warn); }

/* FAQ */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 64px); }
.faq .section__head { margin-bottom: 0; }
.faq__list { border-top: 1px solid var(--line); min-width: 0; }
.faq__list details { border-bottom: 1px solid var(--line); }
.faq__list summary {
  cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative;
  font-family: var(--font-display); font-stretch: 106%; font-weight: 650; font-size: 1.08rem;
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 1.3rem; color: var(--accent); transition: transform .2s ease;
}
.faq__list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq__list details p { color: var(--muted); padding-bottom: 20px; max-width: 64ch; }
@media (max-width: 860px) { .faq { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 48px; }
.footer__inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: start; }
.footer__brand { display: flex; flex-direction: column; gap: 10px; }
.footer__brand p { color: var(--muted); font-size: var(--fs-small); max-width: 40ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: var(--fs-small); }
.footer__links a:hover { color: var(--fg); }
.footer__legal { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; font-family: var(--font-mono); padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .footer__inner { grid-template-columns: minmax(0, 1fr); } .footer__links { justify-content: flex-start; } }

/* Modal */
.modal { border: 0; padding: 0; background: transparent; color: var(--fg); width: min(460px, calc(100vw - 32px)); max-width: none; }
.modal::backdrop { background: rgba(5, 7, 12, 0.6); backdrop-filter: blur(4px); }
.modal[open] { animation: rise .25s ease both; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__text { color: var(--muted); font-size: 0.95rem; }

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

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(40px, 6vw, 80px); }
.legal__doc { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.legal__doc h1 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 750; font-stretch: 112%; line-height: 1.1; }
.legal__meta { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--muted); }
.legal__doc h2 { font-family: var(--font-display); font-stretch: 108%; font-size: 1.3rem; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.legal__doc h3 { font-family: var(--font-display); font-stretch: 104%; font-size: 1.05rem; margin-top: 8px; }
.legal__doc p, .legal__doc li { color: var(--muted); max-width: 70ch; }
.legal__doc strong { color: var(--fg); }
.legal__doc ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.legal__doc a { color: var(--accent); }
.legal__caps { text-transform: uppercase; font-size: 0.9rem; }
.legal__box { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.legal__box p { color: var(--fg); }
.legal__table { overflow-x: auto; }
.legal__table table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.92rem; }
.legal__table th, .legal__table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.legal__table th { color: var(--fg); font-weight: 600; }
.legal__back { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.legal__back:hover { color: var(--fg); }

/* ---------- Language menu ---------- */
.lang { position: relative; }
.lang__btn { list-style: none; width: auto; min-width: 40px; padding-inline: 10px; }
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn .mono { font-size: 0.78rem; letter-spacing: 0.08em; }
.lang[open] .lang__btn { border-color: var(--accent); color: var(--accent); }
.lang__list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; list-style: none;
  min-width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.lang__list a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--fg); font-size: 0.92rem; }
.lang__list a:hover { background: var(--panel-2); color: var(--accent); }
.lang__list a[aria-current="true"] { color: var(--accent); font-weight: 600; }
