/*
 * 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; }
body { font-family: var(--ff); color: var(--text-dark); background: var(--bg-cream); line-height: 1.7; -webkit-font-smoothing: antialiased; }
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: 1100px; 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.1rem; font-weight: 600; }
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: 300; }
.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 { font-size: .68rem; color: var(--copper-bright); letter-spacing: .03em; font-weight: 400; padding: .3rem .7rem; background: var(--copper-bright-a12); }
.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: 300; margin-bottom: 0; }
.stats-bar { grid-column: 1 / -1; display: flex; gap: 3rem; padding: 1.75rem 0 0; margin-top: 2.5rem; border-top: 1px solid var(--border-dark); }
.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: 200; 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: .92rem; color: var(--text-body-light); line-height: 1.8; margin-bottom: 1rem; font-weight: 300; }
.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: 300; }
.callout p strong { color: var(--text-dark); font-weight: 600; }

/* ── 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: 300; }

.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: 300; }

/* ── 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: 300; }
.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: 300; }

/* ── 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: 300; 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; }
  .next-case-wrap { padding: 3rem 1.5rem 0; }
  .case-footer { flex-direction: column; gap: 1rem; padding: 2rem 1.5rem; }
}
