/* ============================================================
   LevaIQ — SHARED THEME  (single source of truth)
   "Instrument-grade observatory": one deep OKLCH blue-black field,
   a faint living lattice behind every page, smoked-glass panels with
   three real elevation tiers. Linked by /work, /work/<slug>, and
   (progressively) every page so the brand reads as ONE.
   ============================================================ */

:root {
  /* ---- Neutrals (cool near-black, layered surfaces) ---- */
  --bg:          oklch(0.16 0.012 264);
  --bg-edge:     #07090f;                 /* the near-black the shader fades into */
  --bg-sunk:     oklch(0.135 0.012 264);
  --surface:     oklch(0.215 0.013 264);  /* glass cards (used ~68% for translucency) */
  --surface-2:   oklch(0.245 0.013 264);
  --ink:         oklch(0.97 0.006 250);   /* primary text */
  --ink-2:       oklch(0.82 0.008 255);   /* secondary */
  --ink-3:       oklch(0.68 0.010 258);   /* tertiary */
  --ink-4:       oklch(0.60 0.012 260);   /* faint / labels (lifted for WCAG) */
  --line:        oklch(0.32 0.012 264);   /* hairline */
  --line-2:      oklch(0.27 0.012 264);
  --line-strong: oklch(0.44 0.013 264);

  /* ---- Brand (one load-bearing accent) ---- */
  --accent:      #5b8cff;
  --accent-2:    #8a5cff;                 /* gradient companion only */
  --accent-cyan: #36d0ff;                 /* faint shader-echo highlight */
  --accent-ink:  oklch(0.82 0.12 254);    /* accent text on dark */
  --accent-soft: rgba(91,140,255,0.10);
  --accent-line: rgba(91,140,255,0.28);

  /* ---- Gold — reserved for the flagship offer tier ONLY ---- */
  --gold:      #caa53d;
  --gold-soft: #d8b450;

  /* ---- Semantic ---- */
  --green:  #3ad07f;
  --red:    #ff5a4d;

  /* ---- Elevation shadows (deep, premium on dark) ---- */
  --sh-1:   0 1px 2px rgba(0,0,0,.30), 0 1px 1px rgba(0,0,0,.24);
  --sh-2:   0 4px 14px rgba(0,0,0,.34), 0 1px 3px rgba(0,0,0,.26);
  --sh-pop: 0 24px 60px -18px rgba(0,0,0,.62), 0 8px 22px -12px rgba(0,0,0,.5);
  --glow:   0 28px 70px -28px rgba(91,140,255,.50);

  /* ---- Type ---- */
  --sans:    "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Schibsted Grotesk", var(--sans);
  --serif:   "Newsreader", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Geometry ---- */
  --maxw: 1200px;
  --r-pill: 999px;
  --r-card: 18px;
  --r-lg: 24px;

  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; background: var(--bg-edge); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); font-weight: 400; color: var(--ink);
  background: transparent; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in oklch, var(--accent) 38%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* fine grain — atmosphere, not texture */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  opacity: .022; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── living background field ─────────────────────────────── */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
#bg-scrim {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, transparent 40%, rgba(7,9,15,.40) 100%),
    linear-gradient(180deg, rgba(7,9,15,.30) 0%, rgba(7,9,15,.10) 22%, rgba(7,9,15,.34) 70%, rgba(7,9,15,.66) 100%);
}

/* ── layout primitives ───────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.display { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.02; }
.serif-em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.015em; }
.kick {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-4);
}
.accent-text { color: var(--accent-ink); }

/* ── shared sticky glass nav ──────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 32px; border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: color-mix(in oklch, var(--bg) 64%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, color-mix(in oklch, var(--accent) 78%, white 12%), var(--accent));
  box-shadow: 0 6px 18px -6px color-mix(in oklch, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.34);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-name span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-3); transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 16px; }
@media (max-width: 760px) {
  .nav { flex-wrap: wrap; row-gap: 9px; padding: 11px 18px; }
  .nav-links { order: 3; width: 100%; justify-content: center; gap: 20px; }
  .nav-links a { font-size: 13.5px; }
}

/* ── buttons (unified: pill primaries) ────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  padding: 13px 24px; border-radius: var(--r-pill); border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .25s ease, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-sm { padding: 9px 17px; font-size: 13.5px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 86%, white 14%), var(--accent));
  box-shadow: 0 8px 30px -8px color-mix(in oklch, var(--accent) 72%, transparent), inset 0 1px 0 rgba(255,255,255,.30);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 42px -10px color-mix(in oklch, var(--accent) 82%, transparent), inset 0 1px 0 rgba(255,255,255,.34); }
.btn-ghost {
  color: var(--ink); background: color-mix(in oklch, var(--surface) 55%, transparent);
  border-color: var(--line-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent-ink); }

/* ── glass system — three elevation tiers ─────────────────── */
.glass {
  position: relative; border-radius: var(--r-card);
  background: color-mix(in oklch, var(--surface) 66%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.07);
}
/* tier 2 — interactive lift + accent glow */
.glass--hover { transition: transform .28s cubic-bezier(.2,.7,.3,1), border-color .28s, box-shadow .3s; }
.glass--hover:hover {
  transform: translateY(-5px); border-color: var(--line-strong);
  box-shadow: var(--sh-pop), var(--glow), inset 0 1px 0 rgba(255,255,255,.10);
}
/* tier 3 — featured: gradient hairline ring + soft glow */
.glass--feature::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in oklch, var(--accent) 65%, transparent), transparent 42%, color-mix(in oklch, var(--accent-2) 40%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ── pills ────────────────────────────────────────────────── */
.pill-bar { display: flex; flex-wrap: wrap; gap: 9px; }
.pill {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .04em;
  color: var(--ink-3); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: color-mix(in oklch, var(--surface) 48%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .18s, background .18s, border-color .18s, transform .12s;
}
.pill:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.pill .pill-n { font-size: 10.5px; color: var(--ink-4); }
.pill[aria-pressed="true"] {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 86%, white 12%), var(--accent));
  box-shadow: 0 8px 24px -10px color-mix(in oklch, var(--accent) 75%, transparent), inset 0 1px 0 rgba(255,255,255,.3);
}
.pill[aria-pressed="true"] .pill-n { color: rgba(255,255,255,.8); }
/* small static category tag (inside cards) */
.cat-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); flex: 0 0 auto; }

/* ── shared footer ────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 60px 0 44px; margin-top: 40px;
  background: color-mix(in oklch, var(--bg-sunk) 60%, transparent); backdrop-filter: blur(8px); }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.foot a.brand { gap: 9px; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { font-size: 13.5px; color: var(--ink-3); transition: color .15s; }
.foot-links a:hover { color: var(--ink); }
.foot-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-4); }

/* ── reveal (progressive enhancement: only hidden when JS is present,
      so no-JS visitors and crawlers always see the content) ─────── */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ============================================================
   CASE-PAGE COMPONENTS  (shared by every /work/<slug> page)
   ============================================================ */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent-ink); display: inline-block;
}
.case-section { padding: 92px 0; }
.case-section.tight { padding: 60px 0; }
.inner { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.case-section h2 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -0.03em; line-height: 1.06; margin: 16px 0 0; text-wrap: balance; }
.case-section h2 + .body { margin-top: 18px; }
.body { font-size: 17px; line-height: 1.7; color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }
.body + .body { margin-top: 16px; }
.body b, .body strong { color: var(--ink); font-weight: 600; }

/* hero */
.case-hero { position: relative; padding: 138px 0 26px; }
.case-back { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; transition: color .15s, gap .2s; }
.case-back:hover { color: var(--accent-ink); gap: 11px; }
.case-hero .row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.case-num { font-family: var(--mono); font-size: 12px; color: var(--ink-4); letter-spacing: .08em; }
.case-title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.04em; line-height: .98;
  font-size: clamp(38px, 6vw, 78px); margin: 18px 0 0; max-width: 16ch; text-wrap: balance;
  text-shadow: 0 2px 40px rgba(2,6,20,.5);
}
.case-title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.case-lede { margin: 22px 0 0; max-width: 60ch; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* metric strip */
.metric-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.mchip { padding: 16px 20px; border-radius: 14px; min-width: 150px; }
.mchip .mv { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.03em; line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.mchip .ml { margin-top: 9px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); line-height: 1.5; }

/* problem / content panel with accent bar */
.panel { padding: 36px 40px; border-radius: var(--r-lg); }
.panel::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in oklch, var(--accent-2) 70%, var(--accent))); }
@media (max-width: 560px) { .panel { padding: 28px 24px; } }

/* feature grid */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { padding: 24px 26px; border-radius: var(--r-card); }
.feature .fic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); }
.feature .fic svg { width: 18px; height: 18px; }
.feature h4 { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.015em; margin: 0 0 7px; }
.feature p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0; }

/* bignum band */
.bignum-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 700px) { .bignum-grid { grid-template-columns: 1fr 1fr; } }
.bignum { padding: 34px 22px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bignum:nth-child(4n) { border-right: none; }
.bignum .bn { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -0.02em; color: var(--accent-ink); }
.bignum .bl { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); margin-top: 12px; line-height: 1.5; }

/* pull quote */
.pullquote { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(20px, 2.6vw, 30px); line-height: 1.4;
  color: var(--ink); border-left: 2px solid var(--accent); padding-left: 26px; max-width: 60ch; text-wrap: pretty; }

/* prev / next case nav */
.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .case-nav { grid-template-columns: 1fr; } }
.case-nav a { padding: 22px 24px; border-radius: var(--r-card); display: flex; flex-direction: column; gap: 6px; }
.case-nav a.next { text-align: right; align-items: flex-end; }
.case-nav .cn-dir { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.case-nav .cn-name { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.015em; color: var(--ink); }

/* cta band */
.cta-band { position: relative; text-align: center; padding: 110px 0; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(60% 120% at 50% 0%, color-mix(in oklch, var(--accent) 18%, transparent), transparent 62%); }
.cta-band .inner { position: relative; z-index: 1; }
.cta-band h2 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.6vw, 56px); letter-spacing: -0.035em; line-height: 1.02; margin: 14px auto 0; max-width: 18ch; text-wrap: balance; }
.cta-band p { margin: 18px auto 0; max-width: 48ch; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.cta-band .row { display: flex; gap: 13px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
