/* ============================================================
   HLE site — shared page styles for the marketing pages.
   Tokens come from ../tokens.css. Reference var(--token) only.
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; transition: opacity .15s }
a:hover { opacity: .75 }
img, svg { display: block; max-width: 100% }
::selection { background: var(--accent); color: var(--bg) }

/* dotted backdrop */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0); background-size: 30px 30px }
body::after { content: ''; position: fixed; top: -30vh; left: 50%; transform: translateX(-50%); width: 100vw; height: 70vh; z-index: 0; pointer-events: none; background: radial-gradient(ellipse, var(--accent-glow2) 0%, transparent 62%) }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1 }
.narrow { max-width: 780px }

/* Skip link — the nav is the first thing in the tab order on every page, so
   keyboard users get a way past it. Visible only when focused. */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--bg); font-family: var(--font-mono); font-size: 13px; font-weight: 700; padding: 10px 16px; border-radius: 8px; transition: top .15s }
.skip-link:focus { top: 12px; opacity: 1 }

/* ── nav ─────────────────────────────────────────────────── */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--border) }
.site-nav-in { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px }
.brand { display: flex; align-items: center; gap: 9px; color: var(--accent); flex-shrink: 0 }
.brand-txt { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; color: var(--text) }
.brand-txt em { font-style: normal; color: var(--accent) }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin-left: auto }
.nav-links a { color: var(--text-dim); font-size: 13.5px; font-weight: 500; white-space: nowrap }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); opacity: 1 }
.nav-links a[aria-current="page"] { color: var(--accent) }
.nav-cta { background: var(--accent); color: var(--bg) !important; font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; padding: 8px 15px; border-radius: 6px; white-space: nowrap; transition: transform .15s, box-shadow .15s }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); opacity: 1 !important }
.nav-burger { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 6px; width: 34px; height: 34px; color: var(--text-dim); cursor: pointer; align-items: center; justify-content: center }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; width: 30px; height: 30px; color: var(--text-dim); cursor: pointer; display: inline-grid; place-items: center; transition: color .15s, border-color .15s }
.theme-toggle:hover { color: var(--text); border-color: var(--border-hi) }
.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto }
@media (min-width: 861px) { .nav-tools { display: none } }
@media (max-width: 860px) {
  .nav-links { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-raised); border-bottom: 1px solid var(--border); padding: 8px 24px 18px; display: none }
  .nav-links.open { display: flex }
  .nav-links li { padding: 9px 0 }
  .nav-links li.nav-theme-item { display: none }
  .nav-burger { display: inline-flex; margin-left: 0 }
  .nav-cta { display: inline-block; width: fit-content; margin-top: 6px }
}

/* ── hero ────────────────────────────────────────────────── */
.hero { padding: 96px 0 72px; text-align: center }
.hero.tight { padding: 64px 0 40px }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 5px 13px; border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); border-radius: 999px; background: var(--accent-glow2); margin-bottom: 24px }
h1.display { font-family: var(--font-display); font-size: clamp(34px, 6.2vw, 62px); font-weight: 800; line-height: 1.04; letter-spacing: -.03em; max-width: 20ch; margin: 0 auto 20px; text-wrap: balance }
h1.display em { font-style: normal; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text }
.lede { font-size: clamp(15px, 1.7vw, 18.5px); color: var(--text-dim); max-width: 60ch; margin: 0 auto; text-wrap: pretty }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px }

/* ── buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; font-weight: 700; padding: 11px 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; white-space: nowrap }
.btn-primary { background: var(--accent); color: var(--bg) }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px var(--accent-glow); opacity: 1 }
.btn-ghost { background: transparent; border-color: var(--border-hi); color: var(--text) }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1 }
.btn-copy { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 500; max-width: 100% }
.btn-copy:hover { border-color: var(--accent); opacity: 1 }
.btn-copy .prompt { color: var(--accent); flex-shrink: 0 }
.btn-copy .hint { font-size: 10.5px; color: var(--text-xdim); border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; background: var(--bg); flex-shrink: 0 }
/* The copy buttons hold long fixed command strings. `.btn` sets nowrap, which on a
   phone would push them past the viewport where `overflow-x: hidden` clips them
   unreachably — so below 640px they go full width and the command wraps. */
@media (max-width: 640px) {
  .hero-actions { width: 100% }
  .hero-actions .btn { width: 100%; justify-content: center }
  .btn-copy { white-space: normal; word-break: break-word; text-align: left; justify-content: flex-start; align-items: flex-start; line-height: 1.55; font-size: 12px; padding: 12px 14px }
  .btn-copy .hint { margin-left: auto }
}

/* ── sections ────────────────────────────────────────────── */
.sec { padding: 80px 0; border-top: 1px solid var(--border); position: relative; z-index: 1 }
.sec.flush { border-top: 0 }
.sec-label { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 14px }
.sec-title { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin-bottom: 14px; max-width: 24ch; text-wrap: balance }
.sec-desc { color: var(--text-dim); font-size: 16px; max-width: 62ch; text-wrap: pretty }
.sec-head { margin-bottom: 44px }
.sec-head.center { text-align: center }
.sec-head.center .sec-title, .sec-head.center .sec-desc { margin-left: auto; margin-right: auto }

/* ── cards / grids ───────────────────────────────────────── */
.grid { display: grid; gap: 18px }
/* Grid and flex children default to min-width:auto, so a track sizes to its item's
   min-content — and .code pre (white-space: pre) makes that min-content as wide as
   the longest command. On a phone the track then exceeds the viewport and
   body{overflow-x:hidden} clips it unreachably. min-width:0 lets tracks shrink to
   the container and hands the scrolling back to .code pre's own overflow-x:auto. */
.grid > * { min-width: 0 }
.card, .step, .code { min-width: 0 }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)) }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)) }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)) }
.g-2-1 { grid-template-columns: 1.55fr 1fr }
@media (max-width: 940px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)) } .g-2-1 { grid-template-columns: 1fr } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr } }

.card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: border-color .2s, transform .2s }
.card:hover { border-color: var(--border-hi) }
a.card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); opacity: 1 }
.card-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-glow2); border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent); color: var(--accent); margin-bottom: 16px }
.card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; color: var(--text) }
.card p { color: var(--text-dim); font-size: 14px; line-height: 1.6 }
.card .more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); margin-top: 16px }
a.card:hover .more { gap: 10px }

/* code blocks — the surface stays dark in both themes, so every colour inside
   comes from a --code-* token rather than from the page palette. */
.code { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 8px; overflow: hidden; margin: 16px 0 }
.code-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 13px; background: var(--surface); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 11px; color: var(--text-xdim); letter-spacing: .05em }
.code pre { padding: 15px 16px; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.75; overflow-x: auto; color: var(--code-text) }
.code .cp { color: var(--code-cmd) }
.code .cf { color: var(--code-flag) }
.code .cc { color: var(--code-comment); font-style: italic }
.code .cs { color: var(--code-str) }
.copy-mini { background: transparent; border: 1px solid var(--border); border-radius: 5px; color: var(--text-dim); font: inherit; font-size: 10.5px; padding: 3px 9px; cursor: pointer; transition: color .15s, border-color .15s }
.copy-mini:hover { color: var(--text); border-color: var(--border-hi) }
.copy-mini.ok { color: var(--accent); border-color: var(--accent) }

/* spec / kv tables */
/* One table, one formatting context, so columns stay aligned across header and rows.
   table-layout:fixed is what prevents the min-content blowout that would otherwise
   overflow a phone: columns size from the first row rather than from content, so the
   table always shrinks to its container without needing a scroll wrapper.
   overflow-wrap lets long unbreakable strings (192.168.1.50:5432,
   ~/.config/hle/agent.toml) wrap instead of forcing width. */
.spec { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 20px 0; display: table; table-layout: fixed }
.spec th, .spec td { overflow-wrap: anywhere; word-break: normal }
.spec th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-xdim); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--border) }
.spec td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: top }
.spec td:first-child { color: var(--text); font-family: var(--font-mono); font-size: 12.5px }
.spec tr:last-child td { border-bottom: 0 }
/* A prose-first column (the "I want to…" table) opts out of the mono treatment. */
.spec.prose td:first-child { font-family: var(--font-body); font-size: 13.5px }
/* nowrap keeps short inline code on one line, but long paths must be allowed to
   break — a nowrap child cannot be split by an ancestor's overflow-wrap, so it
   would otherwise push past the viewport on a phone. */
code.inl { font-family: var(--font-mono); font-size: .88em; background: var(--surface); border: 1px solid var(--border); padding: 1.5px 6px; border-radius: 4px; color: var(--accent); overflow-wrap: anywhere; word-break: normal }

/* step list */
/* .step is itself a grid (34px 1fr), so its children need the same min-width:0
   treatment as .grid > * — otherwise the 1fr track sizes to the min-content of the
   code block or spec table inside it and pushes past the viewport. */
.steps { counter-reset: s; display: grid; gap: 20px }
.steps > *, .step > * { min-width: 0 }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: start }
.step::before { counter-increment: s; content: counter(s,decimal-leading-zero); font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent); border-radius: 8px; background: var(--accent-glow2) }
.step h4 { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; margin-bottom: 5px }
.step p { color: var(--text-dim); font-size: 14px }

/* pills / callouts */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim) }
.pill.on { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 34%, transparent); background: var(--accent-glow2) }
.note { border-left: 2px solid var(--accent); background: var(--accent-glow2); padding: 14px 18px; border-radius: 0 8px 8px 0; color: var(--text); font-size: 14px; margin: 20px 0 }
.note.warn { border-left-color: var(--warn); background: color-mix(in oklab, var(--warn) 7%, transparent) }

/* cta band */
.cta-band { text-align: center; padding: 84px 0 92px; border-top: 1px solid var(--border); position: relative; z-index: 1 }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 12px; text-wrap: balance }
.cta-band p { color: var(--text-dim); max-width: 48ch; margin: 0 auto 28px }

/* footer */
.site-foot { border-top: 1px solid var(--border); padding: 40px 0 44px; position: relative; z-index: 1 }
.foot-in { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-start }
.foot-brand { font-family: var(--font-mono); font-size: 12px; color: var(--text-xdim); max-width: 30ch }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap }
.foot-col h5 { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-xdim); margin-bottom: 12px }
.foot-col a { display: block; color: var(--text-dim); font-size: 13px; padding: 4px 0 }
.foot-col a:hover { color: var(--text) }

/* reveal — opt-in only.
   The hidden baseline is applied ONLY when site-chrome.js confirms the reveal can
   actually run (document visible, motion allowed). Without the .rv-ready class on
   <html>, .rv elements are plain visible content. This matters because CSS
   transitions do not advance while a document is visibilityState:"hidden", so an
   opacity:0 baseline could otherwise never resolve and content would be lost. */
.rv-ready .rv { opacity: 0; transform: translateY(16px); transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1) }
.rv-ready .rv.in { opacity: 1; transform: none }
@media (prefers-reduced-motion: reduce) { .rv-ready .rv { opacity: 1; transform: none; transition: none } }

/* utils */
.mono { font-family: var(--font-mono) }
.dim { color: var(--text-dim) } .xdim { color: var(--text-xdim) }
.tnum { font-variant-numeric: tabular-nums }
.center { text-align: center }
.row { display: flex; gap: 12px; align-items: center }
.row.wrap { flex-wrap: wrap }
.mt0{margin-top:0}.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb0{margin-bottom:0}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
