/*
 * case-study.css — Shared layout for all case study pages
 * Used by: meteor.html, neurofenix.html, opensignal-b2b.html
 * Depends on tokens.css (must be linked first).
 * Page-specific rules (e.g. product-compare, quote callouts) stay inline
 * in each page's <style> block so they can override these defaults.
 * ───────────────────────────────────────────────────────────────
 */

/* ── BASE ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: var(--ff); color: var(--text-dark); background: var(--bg-cream); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }

/* ── NAV ─────────────────────────────────────────────────────── */
.nav-wrap { background: var(--dark-a94); backdrop-filter: blur(14px); position: fixed; top: 0; left: 0; right: 0; z-index: 100; border-bottom: 1px solid var(--border-dark); }
nav { max-width: 1135px; margin: 0 auto; padding: 1.1rem 2.5rem; display: flex; justify-content: space-between; align-items: center; }
nav .logo { color: var(--white); font-size: 1.05rem; font-weight: 500; display: flex; align-items: center; gap: .55rem; letter-spacing: .01em; }
nav .logo svg { flex-shrink: 0; }
nav .nav-links { display: flex; gap: 2.2rem; align-items: center; }
nav .nav-links a { color: var(--text-body-dark); font-size: .82rem; font-weight: 400; transition: color .2s; }
nav .nav-links a:hover { color: var(--copper-bright); }
nav .nav-links a.cta { color: var(--copper-bright); font-weight: 500; }

/* ── PASSWORD GATE ───────────────────────────────────────────── */
.password-gate { position: fixed; inset: 0; z-index: 9999; background: var(--bg-dark); display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity .4s, visibility .4s; }
.password-gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-box { text-align: center; max-width: 400px; padding: 2rem; }
.gate-box .lock-icon { font-size: 2rem; margin-bottom: 1.5rem; opacity: .4; }
.gate-box h2 { font-size: 1.6rem; font-weight: 200; letter-spacing: -.02em; margin-bottom: .5rem; color: var(--text-light); }
.gate-box h2 strong { font-weight: 700; }
.gate-box p { color: var(--text-muted-dark); font-size: .85rem; margin-bottom: 2rem; line-height: 1.7; font-weight: 400; }
.gate-input-wrap { display: flex; gap: .5rem; }
.gate-input-wrap input { flex: 1; padding: .75rem 1rem; border: 1px solid var(--border-dark); font-family: var(--ff); font-size: .88rem; background: var(--bg-dark-surface); color: var(--text-light); outline: none; }
.gate-input-wrap input:focus { border-color: var(--copper); }
.gate-input-wrap button { padding: .75rem 1.5rem; background: var(--copper); color: white; border: none; font-family: var(--ff); font-size: .88rem; font-weight: 500; cursor: pointer; transition: opacity .2s; }
.gate-input-wrap button:hover { opacity: .85; }
.gate-error { color: var(--color-error); font-size: .78rem; margin-top: .75rem; min-height: 1.2em; }
.gate-back { margin-top: 2rem; font-size: .82rem; color: var(--text-muted-dark); }
.gate-back a { color: var(--copper-bright); }

/* ── CASE HERO (two-column banner) ───────────────────────────── */
.case-hero { background: var(--bg-dark); padding: 9rem 2.5rem 4rem; }
.case-hero-inner { max-width: 1135px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2rem 3.5rem; align-items: center; }
.case-hero-text { min-width: 0; }
.case-hero-visual { min-width: 0; }
.case-hero-visual .case-img { margin: 0; border-color: var(--border-dark); background: var(--bg-dark-surface); }
.back-link { font-size: .82rem; color: var(--text-muted-dark); display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 2rem; transition: color .2s; }
.back-link:hover { color: var(--copper-bright); }
.case-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
/* .case-meta span (category tag chip) lives in components.css — single source of truth. */
.case-hero h1 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); color: var(--text-light); font-weight: 200; line-height: 1.15; letter-spacing: -.03em; margin-bottom: .75rem; }
.case-hero h1 strong { font-weight: 700; }
.case-hero .subtitle { font-size: .9rem; color: var(--text-muted-dark); font-weight: 400; margin-bottom: 0; }
.stats-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; padding: 1.75rem 0 0; margin-top: 2.5rem; border-top: 1px solid var(--border-dark); }
.stat { flex: 1 1 160px; min-width: 0; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--copper); line-height: 1.1; }
.stat .label { font-size: .72rem; color: var(--text-body-dark); margin-top: .2rem; font-weight: 400; }

/* ── CASE BODY ───────────────────────────────────────────────── */
.case-body { max-width: 740px; margin: 0 auto; padding: 4rem 2.5rem; }
.case-section { margin-bottom: 4rem; }
.section-label { font-size: .75rem; color: var(--copper-on-light); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.case-section h2 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 1.25rem; color: var(--text-dark); }
.case-section h2 strong { font-weight: 700; }
.case-section p { font-size: 1rem; color: var(--text-body-light); line-height: 1.8; margin-bottom: 1rem; font-weight: 400; }
.case-section p strong { color: var(--text-dark); font-weight: 600; }

/* ── CALLOUT ─────────────────────────────────────────────────── */
.callout { padding: 1.25rem 1.75rem; background: var(--bg-cream-deep); border-left: 2px solid var(--copper-on-light); margin: 1.25rem 0; }
.callout p { font-size: .88rem; color: var(--text-body-light); margin: 0; line-height: 1.75; font-weight: 400; }
.callout p strong { color: var(--text-dark); font-weight: 600; }

/* ── LEGACY / PLACEHOLDER (context "before" state) ───────────── */
.legacy-label { font-size: 1.05rem; color: var(--text-dark); font-weight: 700; letter-spacing: -.01em; margin: 1.25rem 0 1rem; }
.legacy-sub { font-size: .78rem; color: var(--copper-on-light); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 1.75rem 0 .5rem; }
.ph-box { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; border: 2px dashed var(--border-cream); color: var(--text-body-light); font-size: 1rem; font-weight: 600; font-style: italic; text-align: center; padding: 1.5rem; }
.ph-box span { font-size: .76rem; font-weight: 400; font-style: normal; color: var(--copper-on-light); letter-spacing: .06em; text-transform: uppercase; }

/* ── IMAGES ──────────────────────────────────────────────────── */
.case-img { margin: 2rem 0; overflow: hidden; background: var(--bg-cream-deep); border: 1px solid var(--border-cream); }
.case-img img { width: 100%; height: auto; display: block; }
.case-img.padded { padding: 1rem; }
.case-img figcaption { padding: .6rem 1rem; font-size: .75rem; color: var(--text-body-light); font-weight: 400; }

.full-width-img { max-width: 900px; margin: 0 auto; padding: 0 2.5rem 3rem; }
.full-width-img .case-img { margin: 0; }
.image-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.image-row .case-img { margin: 0; }
.image-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.image-triple .case-img { margin: 0; }
.proto-row { display: grid; grid-template-columns: repeat(4,1fr); gap: .75rem; margin: 2rem 0; }
.proto-row .case-img { margin: 0; }

/* ── OUTCOMES ────────────────────────────────────────────────── */
.outcomes-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-top: 1.5rem; }
.outcome-card { padding: 1.5rem; background: var(--bg-cream-deep); border: 1px solid var(--border-cream); }
.outcome-card .num { font-size: 1.8rem; font-weight: 700; color: var(--copper); line-height: 1.1; margin-bottom: .25rem; }
.outcome-card .desc { font-size: .82rem; color: var(--text-body-light); line-height: 1.6; font-weight: 400; }

/* ── NEXT CASE ───────────────────────────────────────────────── */
.next-case-wrap { background: var(--bg-dark); padding: 4rem 2.5rem 0; margin-top: 4rem; border-top: 1px solid var(--border-dark); }
.next-case { max-width: 740px; margin: 0 auto; }
.next-case a { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 2rem; background: var(--bg-dark-surface); border: 1px solid var(--border-dark); color: var(--text-light); transition: opacity .2s; }
.next-case a:hover { opacity: .8; }
.next-label { font-size: .72rem; color: var(--copper-bright); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .25rem; }
.next-title { font-size: 1.05rem; color: var(--text-light); font-weight: 400; }
.arrow { font-size: 1.4rem; color: var(--copper); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.case-footer-wrap { background: var(--bg-dark); padding-bottom: 0; }
.case-footer { max-width: 740px; margin: 0 auto; padding: 2rem 2.5rem; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-dark); }
.case-footer a { font-size: .85rem; color: var(--text-muted-dark); transition: color .2s; }
.case-footer a:hover { color: var(--copper-bright); }
.case-footer .cta-link { padding: .6rem 1.5rem; background: var(--copper); color: white; font-weight: 500; font-size: .82rem; }
.case-footer .cta-link:hover { opacity: .85; color: white; }

footer { background: var(--bg-dark); text-align: center; padding: 1.8rem 2.5rem; font-size: .78rem; color: var(--text-muted-dark); border-top: 1px solid var(--border-dark); font-weight: 400; }

/* ── LIVE PROTOTYPE EMBED ────────────────────────────────────── */
.prototype-wrap { max-width: 1180px; margin: 0 auto 2.5rem; padding: 0 2.5rem; }
.prototype-wrap .prototype-frame { margin: 0; }

.prototype-frame { margin: 2.5rem 0; background: var(--bg-cream-deep); border: 1px solid var(--border-cream); border-radius: 8px; overflow: hidden; box-shadow: 0 8px 32px rgba(26,24,21,.08); }
.pf-chrome { display: flex; align-items: center; gap: 1rem; padding: .65rem .9rem; background: #0C162A; border-bottom: 1px solid rgba(255,255,255,.05); }
.pf-dots { display: flex; gap: 6px; flex-shrink: 0; }
.pf-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.pf-dots span:nth-child(1) { background: #FF5F57; }
.pf-dots span:nth-child(2) { background: #FEBC2E; }
.pf-dots span:nth-child(3) { background: #28C840; }
.pf-url { flex: 1; min-width: 0; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: .7rem; color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); padding: .35rem .75rem; border-radius: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.pf-url .pf-url-label { color: rgba(255,255,255,.85); font-weight: 500; }
.pf-open { font-size: .72rem; color: var(--copper-bright); font-weight: 500; text-decoration: none; padding: .35rem .75rem; border-radius: 4px; transition: background .15s, color .15s; display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.pf-open:hover { background: rgba(163,62,78,.12); color: var(--copper-bright); }
.pf-open svg { width: 11px; height: 11px; }

.pf-stage { position: relative; width: 100%; padding-top: 62.5%; background: #F4F1F8; overflow: hidden; }
.pf-stage iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: top left; background: #F4F1F8; display: block; }
.pf-caption { padding: .65rem 1rem; font-size: .75rem; color: var(--text-body-light); font-weight: 400; border-top: 1px solid var(--border-cream); background: var(--bg-cream-deep); }
.pf-badge { display: inline-block; font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--copper-on-light); background: rgba(163,62,78,.14); padding: .15rem .5rem; border-radius: 3px; margin-right: .5rem; vertical-align: 1px; }

/* ── DIAGRAMS ────────────────────────────────────────────────── */
.diagram-wrap { margin: 0 -8vw 3rem; }
.diagram-wrap svg { display: block; margin: 0 auto; width: 100%; height: auto; }
.diagram-label { font-size: 1.05rem; color: var(--text-dark); font-weight: 600; letter-spacing: -.01em; margin-bottom: 1rem; margin-top: 2rem; }
.diagram-caption { text-align: center; font-size: .88rem; color: var(--text-body-light); font-weight: 400; margin-top: .75rem; font-style: italic; padding: 0 1rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .case-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .case-hero-visual { order: 2; }
  .stats-bar { order: 3; }
}

@media (max-width: 768px) {
  html { font-size: 16px; }
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
  .case-hero { padding: 7rem 1.5rem 3.5rem; }
  .case-body { padding: 3rem 1.5rem; }
  .stats-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.5rem; }
  .image-row, .image-triple { grid-template-columns: 1fr; }
  .proto-row { grid-template-columns: repeat(2,1fr); }
  .outcomes-grid { grid-template-columns: 1fr; }
  .full-width-img { padding-left: 1.5rem; padding-right: 1.5rem; }
  .prototype-wrap { padding: 0 1.25rem; }
  .pf-url { font-size: .62rem; padding: .25rem .5rem; }
  .pf-open { font-size: .65rem; padding: .25rem .5rem; }
  .next-case-wrap { padding: 3rem 1.5rem 0; }
  .case-footer { flex-direction: column; gap: 1rem; padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
  nav { padding: 1rem 1.1rem; }
  nav .logo span { display: none; }
  nav .logo { gap: 0; }
  .nav-links { gap: .8rem; }
  .nav-links a { font-size: .72rem; }
}
