/* ============================================================
   OpsCodex — public homepage (final, responsive)
   Marketing layer on top of tokens.css (Studio design system)
   ============================================================ */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ops-canvas); color: var(--ops-ink);
       font-family: var(--ops-font-sans, Inter, sans-serif); font-size: 16px; line-height: 1.6; }
*, *::before, *::after { box-sizing: border-box; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }
:where(a) { color: inherit; }
:focus-visible { outline: 2px solid var(--ops-border-focus); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ops-surface);
             color: var(--ops-ink); padding: 10px 16px; border: 1px solid var(--ops-border-strong);
             border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

.hp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- type ---------- */
.hp-h1 { font-family: var(--ops-font-display, Fraunces, serif); font-weight: 500;
         font-size: clamp(38px, 4.6vw, 62px); line-height: 1.07; letter-spacing: -0.015em;
         margin: 0; text-wrap: balance; }
.hp-h1 em, .hp-h2 em { font-style: italic; font-weight: 500; }
.hp-h2 { font-family: var(--ops-font-display, Fraunces, serif); font-weight: 500;
         font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -0.01em;
         margin: 0; text-wrap: balance; }
.hp-h3 { font-family: var(--ops-font-display, Fraunces, serif); font-weight: 500;
         font-size: 21px; line-height: 1.3; margin: 0; }
.hp-h3--sans { font-family: var(--ops-font-sans, Inter, sans-serif); font-size: 16.5px; font-weight: 600; }
.hp-eyebrow { font-family: var(--ops-font-mono, "IBM Plex Mono", monospace); font-size: 11px;
              font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
              color: var(--ops-ink-3); display: flex; align-items: center; gap: 10px; }
.hp-eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--ops-accent); flex: 0 0 auto; }
.hp-eyebrow--center { justify-content: center; }
.hp-body { font-size: 17px; line-height: 1.65; color: var(--ops-ink-2); margin: 0; text-wrap: pretty; }
.hp-small { font-size: 14px; line-height: 1.55; color: var(--ops-ink-2); margin: 0; text-wrap: pretty; }
.hp-mono { font-family: var(--ops-font-mono, "IBM Plex Mono", monospace); }
.hp-microline { font-family: var(--ops-font-mono, monospace); font-size: 11.5px; letter-spacing: 0.1em;
                text-transform: uppercase; color: var(--ops-ink-3); margin: 0; }

/* ---------- buttons ---------- */
.hp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
          padding: 14px 26px; border-radius: 6px; font-size: 15px; font-weight: 600; line-height: 1;
          background: var(--ops-accent); color: #FCFBF8; border: 1px solid var(--ops-accent); cursor: pointer; }
.hp-btn:hover { background: var(--ops-accent-hover); border-color: var(--ops-accent-hover); }
.hp-btn--ghost { background: transparent; color: var(--ops-ink); border: 1px solid var(--ops-border-input); }
.hp-btn--ghost:hover { background: var(--ops-tint-warm-strong); border-color: var(--ops-border-input); }
.hp-btn--onDark { background: #FCFBF8; color: var(--ops-accent-ink); border-color: #FCFBF8; }
.hp-btn--onDark:hover { background: #EFEDE6; border-color: #EFEDE6; }

/* ---------- nav (sticky, mirrors the app's header behaviour) ---------- */
.hp-header { position: sticky; top: 0; z-index: 50;
             background: color-mix(in srgb, var(--ops-canvas) 88%, transparent);
             backdrop-filter: saturate(1.4) blur(10px);
             -webkit-backdrop-filter: saturate(1.4) blur(10px);
             border-bottom: 1px solid transparent;
             transition: border-color .2s ease; }
.hp-header.is-stuck { border-bottom-color: var(--ops-border); }
[id] { scroll-margin-top: 96px; }
.hp-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px;
          padding: 22px 0; }
.hp-nav-links { display: flex; align-items: center; gap: clamp(20px, 3vw, 36px);
                font-size: 14.5px; font-weight: 500; color: var(--ops-ink-2); }
.hp-nav-links a { position: relative; padding-block: 4px; }
.hp-nav-links a:hover { color: var(--ops-ink); }
.hp-nav-links a.is-active { color: var(--ops-ink); font-weight: 600; }
.hp-nav-links a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
                                   height: 2px; background: var(--ops-accent); border-radius: 1px; }
.hp-nav-right { display: flex; align-items: center; gap: 20px; }
.hp-nav .hp-btn { padding: 11px 20px; font-size: 14px; }
.hp-lang { display: flex; align-items: center; gap: 2px; font-family: var(--ops-font-mono, monospace);
           font-size: 11px; letter-spacing: 0.08em; color: var(--ops-ink-3); }
.hp-lang button, .hp-lang a { font: inherit; color: inherit; background: none; border: none; cursor: pointer;
                  padding: 4px 7px; border-radius: 4px; letter-spacing: inherit; text-decoration: none; }
.hp-lang button:hover, .hp-lang a:hover { color: var(--ops-ink); }
.hp-lang button.is-active, .hp-lang a.is-active { color: var(--ops-ink); background: var(--ops-tint-warm-strong); font-weight: 500; }
.hp-wordmark { font-family: var(--ops-font-display, Fraunces, serif); font-size: 25px; line-height: 1;
               color: var(--ops-ink); display: inline-block; position: relative; padding-bottom: 7px; }
.hp-wordmark em { font-style: italic; }
.hp-wordmark::after { content: ""; position: absolute; left: 0; bottom: 0; width: 60%; height: 1px;
                      background: var(--ops-accent); }

/* ---------- sections ---------- */
.hp-section { padding-top: clamp(64px, 8vw, 104px); padding-bottom: clamp(64px, 8vw, 104px); }
.hp-band-deep { background: var(--ops-canvas-deep); }
.hp-rule { height: 1px; background: var(--ops-border); }

/* two-column grids */
.hp-grid2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
            gap: clamp(40px, 6vw, 88px); align-items: center; }
.hp-grid2--narrowLeft { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: start; }

/* ---------- cards & chips ---------- */
.hp-card { background: var(--ops-surface); border: 1px solid var(--ops-border); border-radius: 8px; padding: 26px; }
.hp-chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
           border: 1px solid var(--ops-border-strong); background: var(--ops-tint-warm);
           font-family: var(--ops-font-mono, monospace); font-size: 11px; font-weight: 500;
           letter-spacing: 0.12em; text-transform: uppercase; color: var(--ops-ink-2); white-space: nowrap; }

/* ---------- window shot ---------- */
.hp-window { background: var(--ops-surface); border: 1px solid var(--ops-border-strong);
             border-radius: 10px; overflow: hidden;
             box-shadow: 0 1px 2px rgba(27,26,23,.04), 0 24px 64px -24px rgba(27,26,23,.18); }
.hp-window-bar { display: flex; align-items: center; justify-content: center; position: relative;
                 height: 36px; border-bottom: 1px solid var(--ops-border); background: var(--ops-canvas); }
.hp-window-bar::before { content: ""; position: absolute; left: 14px; width: 38px; height: 6px;
                 border-radius: 3px; background: var(--ops-tint-warm-strong); }
.hp-window-url { font-family: var(--ops-font-mono, monospace); font-size: 11px; letter-spacing: 0.08em;
                 color: var(--ops-ink-3); background: var(--ops-canvas-deep);
                 border: 1px solid var(--ops-border); border-radius: 5px; padding: 3px 14px; }
.hp-window img { width: 100%; height: auto; aspect-ratio: 864 / 540; object-fit: cover; }
.hp-window video { width: 100%; height: auto; display: block; }
.hp-shot-caption { margin-top: 14px; }

/* ---------- fact strip ---------- */
.hp-facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.hp-fact { padding: 26px 32px; border-left: 1px solid var(--ops-border); }
.hp-fact:first-child { border-left: none; padding-left: 0; }
.hp-fact-title { font-family: var(--ops-font-display, Fraunces, serif); font-size: 18px; font-weight: 500; }
.hp-fact-sub { font-family: var(--ops-font-mono, monospace); font-size: 10.5px; letter-spacing: 0.12em;
               text-transform: uppercase; color: var(--ops-ink-3); margin-top: 6px; }

/* ---------- evidence strip (third-party numbers under the problem) ---------- */
.hp-evidence { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--ops-border); }
.hp-evidence-lead { font-family: var(--ops-font-display, Fraunces, serif); font-size: 21px;
                    line-height: 1.4; color: var(--ops-accent-ink); max-width: 620px; }
.hp-evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 34px; }
.hp-stat { display: flex; flex-direction: column; }
.hp-stat-num { font-family: var(--ops-font-mono, monospace); font-size: 34px; font-weight: 500;
               color: var(--ops-accent); line-height: 1.1; letter-spacing: -0.02em; }
.hp-stat-body { font-size: 14px; line-height: 1.6; color: var(--ops-ink-2); margin-top: 12px; }
/* margin-top:auto pins every source line to the same baseline even though the
   bodies differ in length — a ragged evidence block reads as sloppy. */
.hp-stat-src { font-family: var(--ops-font-mono, monospace); font-size: 11px; margin-top: auto;
               padding-top: 14px; }
.hp-stat-src a { color: var(--ops-ink-3); text-decoration: none; }
.hp-stat-src a:hover { color: var(--ops-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- numbered problem list ---------- */
.hp-problem { display: grid; grid-template-columns: 44px 1fr; gap: 20px; padding: 22px 0;
              border-top: 1px solid var(--ops-border); }
.hp-problem:first-child { border-top: none; }
.hp-problem-num { font-family: var(--ops-font-mono, monospace); font-size: 12px; font-weight: 500;
                  letter-spacing: 0.1em; color: var(--ops-ink-3); padding-top: 3px; }

/* ---------- steps ---------- */
.hp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 52px; }
.hp-step { border-top: 1px solid var(--ops-border-strong); padding-top: 22px; }
.hp-step--hi { border-top: 2px solid var(--ops-accent); }
.hp-stepnum { font-family: var(--ops-font-mono, monospace); font-size: 12px; font-weight: 500;
              letter-spacing: 0.1em; color: var(--ops-accent); }
.hp-step .hp-h3 { margin-top: 10px; }
.hp-step .hp-small { margin-top: 10px; }
.hp-step .hp-chip { margin-top: 14px; background: var(--ops-approved-soft);
                    border-color: #729883; color: var(--ops-accent-ink); }

/* ---------- governance ---------- */
.hp-govpoint { padding: 16px 0; border-top: 1px solid var(--ops-border); }
.hp-govpoint:first-child { border-top: none; padding-top: 0; }
.hp-govpoint strong { font-size: 15.5px; }
.hp-govpoint p { margin-top: 4px; }
.hp-chain { display: flex; align-items: stretch; gap: 10px; }
.hp-chain-role { flex: 1; padding: 14px 8px; text-align: center; border-radius: 7px;
                 border: 1px solid var(--ops-border-strong); background: var(--ops-surface); min-width: 0; }
.hp-chain-role b { font-family: var(--ops-font-display, Fraunces, serif); font-size: 17px; font-weight: 500;
                   display: block; }
.hp-chain-role span { font-family: var(--ops-font-mono, monospace); font-size: 10px; letter-spacing: 0.1em;
                      text-transform: uppercase; display: block; margin-top: 5px; color: var(--ops-ink-3); }
.hp-chain-arrow { align-self: center; color: var(--ops-accent); font-size: 16px; flex: 0 0 auto; }
.hp-log { font-family: var(--ops-font-mono, "IBM Plex Mono", monospace); font-size: 12.5px;
          line-height: 2.05; border-radius: 8px; padding: 22px 26px; white-space: pre;
          overflow-x: auto; background: var(--ops-canvas-deep); color: var(--ops-ink-2);
          border: 1px solid var(--ops-border-strong); }
.hp-log .lg-hi { color: var(--ops-ink); font-weight: 500; }
.hp-log .lg-ok { color: var(--ops-accent); font-weight: 500; }
.hp-audit-card { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.hp-audit-label { font-family: var(--ops-font-mono, monospace); font-size: 10.5px; letter-spacing: 0.14em;
                  text-transform: uppercase; color: var(--ops-ink-3); }

/* ---------- product pair ---------- */
.hp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 52px; }

/* ---------- security ---------- */
.hp-seccards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 48px; }
.hp-seccards .hp-card p { margin-top: 10px; }

/* ---------- exit / no-lock-in statement ---------- */
.hp-exit { margin-top: 48px; padding: 30px 32px; background: var(--ops-surface);
           border: 1px solid var(--ops-border); border-left: 3px solid var(--ops-accent);
           border-radius: var(--ops-radius-md); max-width: 760px; }
.hp-exit-h { font-family: var(--ops-font-display, Fraunces, serif); font-size: 24px;
             font-weight: 500; color: var(--ops-accent-ink); letter-spacing: -0.01em; }
.hp-exit-body { font-size: 15px; line-height: 1.65; color: var(--ops-ink-2); margin-top: 12px; }
.hp-exit-claim { font-family: var(--ops-font-display, Fraunces, serif); font-size: 17px;
                 font-style: italic; color: var(--ops-ink); margin-top: 16px; }

/* ---------- dark CTA ---------- */
.hp-dark { background: var(--ops-accent-ink); color: #F2F0EA; }
.hp-dark .hp-body { color: #C9D5CC; }
.hp-dark .hp-microline { color: #9DB3A4; }

/* ---------- footer ---------- */
.hp-foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; padding-top: 64px; }
.hp-foot h5 { font-family: var(--ops-font-mono, monospace); font-size: 11px; font-weight: 500;
              letter-spacing: 0.14em; text-transform: uppercase; color: var(--ops-ink-3); margin: 0 0 16px; }
.hp-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px;
              font-size: 14px; color: var(--ops-ink-2); }
.hp-foot ul a:hover { color: var(--ops-ink); }
.hp-foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
                  margin-top: 56px; padding: 24px 0 48px; border-top: 1px solid var(--ops-border); }
.hp-foot-bottom .left { font-size: 13px; color: var(--ops-ink-3); }
.hp-foot-bottom .right { font-family: var(--ops-font-mono, monospace); font-size: 11px;
                         letter-spacing: 0.12em; text-transform: uppercase; color: var(--ops-ink-3); }

/* ============================================================
   Sparkline revision — valleys, adoption act, audit split,
   new bliss, signature note, asset placeholders.
   Tokens + existing on-dark hexes only; no new colours.
   ============================================================ */

/* ---------- valleys (quiet, dense — sections 4 and 6) ---------- */
.hp-valley { padding-top: clamp(48px, 6vw, 76px); padding-bottom: clamp(48px, 6vw, 76px); }
.hp-valley .hp-h2 { font-size: clamp(24px, 2.6vw, 34px); max-width: 640px; }
.hp-valley-body { font-size: 16px; line-height: 1.7; color: var(--ops-ink-2);
                  max-width: 620px; margin: 20px 0 0; text-wrap: pretty; }

/* ---------- quiet mid-page CTA (peaks only) ---------- */
.hp-midcta { display: inline-flex; align-items: center; gap: 8px; margin-top: 44px;
             font-size: 15.5px; font-weight: 600; color: var(--ops-accent); }
.hp-midcta:hover { color: var(--ops-accent-hover); text-decoration: underline; text-underline-offset: 4px; }


/* ---------- adoption (peak 3) ---------- */
.hp-adopt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.hp-adopt-cards .hp-card p { margin-top: 10px; }
.hp-card-kicker { display: block; font-family: var(--ops-font-mono, monospace); font-size: 10px;
                  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ops-ink-3);
                  margin-bottom: 12px; }
.hp-clamp { font-family: var(--ops-font-display, Fraunces, serif); font-weight: 500;
  font-size: clamp(20px, 2.2vw, 26px); line-height: 1.45; max-width: 760px;
  margin: 56px 0 0; padding-top: 28px; border-top: 1px solid var(--ops-border-strong); text-wrap: balance; }

/* ---------- audit split (maximum contrast beat) ---------- */
.hp-section--climax { padding-top: clamp(96px, 11vw, 150px); padding-bottom: clamp(96px, 11vw, 150px); }
.hp-asplit { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(44px, 6vw, 96px);
             margin-top: 64px; align-items: start; }
/* Grid items default to min-width:auto, so the pre-formatted .hp-log sets a floor
   the track cannot shrink below — the whole page then scrolled sideways on any
   viewport under ~412px. min-width:0 lets the track shrink; .hp-log keeps its own
   overflow-x:auto, so the log scrolls instead of the page. */
.hp-asplit > * { min-width: 0; }
.hp-asplit-quotes { margin-top: 26px; }
.hp-quote { font-family: var(--ops-font-display, Fraunces, serif); font-style: italic;
  font-size: clamp(17px, 1.8vw, 20px); line-height: 1.5; color: var(--ops-ink-2);
  margin: 0; max-width: 420px; }
.hp-quote + .hp-quote { margin-top: 24px; }
.hp-quote--i2 { margin-left: clamp(0px, 4vw, 44px); }
.hp-quote--i3 { margin-left: clamp(0px, 2vw, 18px); }
.hp-asplit-cap { margin-top: 26px; }

/* ---------- new bliss ---------- */
.hp-bliss { max-width: 680px; margin-top: 44px; }
.hp-bliss p { font-size: 17px; line-height: 1.75; color: var(--ops-ink-2); margin: 0; text-wrap: pretty; }
.hp-bliss p + p { margin-top: 24px; }
.hp-bliss p strong { font-family: var(--ops-font-mono, "IBM Plex Mono", monospace); font-weight: 500;
                     font-size: 15px; letter-spacing: 0.04em; color: var(--ops-accent); }
.hp-bliss .hp-bliss-close { font-family: var(--ops-font-display, Fraunces, serif); font-size: 21px;
                            line-height: 1.45; color: var(--ops-ink); margin-top: 36px; }

/* ---------- dark band: eyebrow + signature note ---------- */
.hp-dark .hp-eyebrow { color: #9DB3A4; }
.hp-dark .hp-eyebrow::before { background: #729883; }
.hp-signature { display: flex; gap: 24px; align-items: center; justify-content: center;
                text-align: left; max-width: 680px; margin: 44px auto 0; }
.hp-sig-portrait { width: 84px; height: 84px; border-radius: 8px; border: 1px solid #9DB3A4;
  flex: 0 0 auto; object-fit: cover; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--ops-tint-warm) 0 10px, var(--ops-canvas-deep) 10px 20px); }
.hp-sig-quote { font-family: var(--ops-font-display, Fraunces, serif); font-style: italic;
                font-size: 18px; line-height: 1.55; color: #F2F0EA; margin: 0; }
.hp-sig-attrib { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: #C9D5CC; }
.hp-sig-attrib a { color: #F2F0EA; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- FAQ ---------- */
.hp-faq { margin-top: 40px; max-width: 720px; }
.hp-faq-item { padding: 24px 0; border-top: 1px solid var(--ops-border); }
.hp-faq-item:last-child { border-bottom: 1px solid var(--ops-border); }
.hp-faq-item p { margin-top: 8px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1023px) {
  .hp-grid2, .hp-grid2--narrowLeft { grid-template-columns: 1fr; }
  .hp-steps { grid-template-columns: 1fr 1fr; }
  .hp-seccards { grid-template-columns: 1fr 1fr; }
  .hp-adopt-cards { grid-template-columns: 1fr 1fr; }
  .hp-asplit { grid-template-columns: 1fr; }
  .hp-foot { grid-template-columns: 1fr 1fr; }
  .hp-evidence-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  .hp-nav-links { display: none; }
}

@media (max-width: 639px) {
  .hp-facts { grid-template-columns: 1fr; }
  .hp-fact { border-left: none; border-top: 1px solid var(--ops-border); padding: 20px 0; }
  .hp-fact:first-child { border-top: none; }
  .hp-steps { grid-template-columns: 1fr; }
  .hp-seccards { grid-template-columns: 1fr; }
  .hp-adopt-cards { grid-template-columns: 1fr; }
  .hp-evidence-grid { grid-template-columns: 1fr; gap: 30px; }
  .hp-exit { padding: 24px 22px; }
  .hp-quote--i2, .hp-quote--i3 { margin-left: 0; }
  .hp-signature { flex-direction: column; align-items: center; text-align: center; }
  .hp-pair { grid-template-columns: 1fr; }
  .hp-foot { grid-template-columns: 1fr; gap: 32px; }
  .hp-hero-ctas { flex-direction: column; align-items: stretch; }
  .hp-nav .hp-lang { display: none; }
  .hp-chain { flex-direction: column; }
  .hp-chain-arrow { transform: rotate(90deg); align-self: center; }
  .hp-log { font-size: 11px; padding: 16px 18px; }
}
