/* Design system v2 – "Monolitt".
   Loaded after style.css and showcase.css. Tokens first, then section-by-section refinements.
   Everything here works with all animations off; motion.js only layers on top. */

:root {
  /* colour: near-black canvas, aurora used as light */
  --ink: #05070F;
  --ink-2: #0A0D1B;
  --ink-3: #10142A;
  --surface: rgba(255,255,255,.025);
  --surface-2: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.085);
  --line-2: rgba(255,255,255,.16);
  --text: #F3F5FF;
  --muted: #A3ABCB;          /* 8.6:1 on --ink */
  --faint: #7E86A8;          /* 5.3:1 on --ink, small labels only */
  --glass: rgba(16,20,42,.6);

  /* type scale (fluid, 390 → 1440) */
  --fs-display: clamp(2.6rem, 1.55rem + 4.6vw, 5.6rem);
  --fs-h2: clamp(2.15rem, 1.45rem + 3vw, 4.1rem);
  --fs-h3: clamp(1.3rem, 1.12rem + .7vw, 1.7rem);
  --fs-lead: clamp(1.08rem, 1rem + .35vw, 1.3rem);
  --fs-body: clamp(1rem, .96rem + .15vw, 1.0625rem);
  --fs-small: .875rem;
  --fs-eyebrow: .75rem;

  /* spacing (8pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --section-y: clamp(96px, 7rem + 4vw, 176px);
  --gutter: clamp(20px, 4vw, 40px);
  --maxw: 1240px;

  /* shape + depth */
  --r-panel: 24px;
  --r-ctl: 14px;
  --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 60px -32px rgba(0,0,0,.9);
  --glow-teal: 0 0 0 1px rgba(52,245,197,.35), 0 18px 50px -18px rgba(52,245,197,.55);

  /* motion */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-io: cubic-bezier(.65,0,.35,1);
  --dur-1: .18s; --dur-2: .35s; --dur-3: .7s;
}

/* ---------- base ---------- */
body { background: var(--ink); font-size: var(--fs-body); line-height: 1.65; }
.container { max-width: calc(var(--maxw) + 2 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
h1, h2 { letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); line-height: .98; }
h3 { font-size: var(--fs-h3); }
::selection { background: rgba(52,245,197,.3); color: #fff; }

/* subtle film grain (static, composited once) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 400; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header { background: rgba(5,7,15,.72); border-bottom-color: transparent; transition: border-color var(--dur-2), background var(--dur-2); }
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(5,7,15,.86); }
.logo { font-size: 1.4rem; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--r-pill); min-height: 52px; padding: 12px 26px; gap: 10px; letter-spacing: -0.005em;
  transition: background var(--dur-2), border-color var(--dur-2), box-shadow var(--dur-2), color var(--dur-2), transform var(--dur-1); }
.btn-primary { box-shadow: 0 0 0 1px rgba(52,245,197,.0), 0 10px 30px -14px rgba(52,245,197,.6); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--glow-teal); }
.btn-ghost { border-color: var(--line-2); background: rgba(255,255,255,.02); }
.btn-ghost:hover:not(:disabled) { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.btn-small { min-height: 42px; padding: 8px 18px; }
.btn .arr { width: 18px; height: 18px; flex: none; transition: transform var(--dur-2) var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- section rhythm + numbered heads ---------- */
.section { padding: var(--section-y) 0; }
main > .section + .section { border-top: 1px solid var(--line); }
.stage-section { padding-top: var(--section-y); }
.sec-head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 72px); }
.sec-head[data-n]::before, .about-text[data-n]::before {
  content: attr(data-n); content: attr(data-n) / "";
  display: inline-block; margin-bottom: 22px; padding-right: 44px;
  background: linear-gradient(90deg, rgba(52,245,197,.9), rgba(124,92,255,.6)) no-repeat right center / 30px 1px;
  font: 600 var(--fs-eyebrow)/1 var(--font-body); letter-spacing: .16em; color: var(--teal);
}
.sec-head[data-n] > h2 { margin-top: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px; font: 600 var(--fs-eyebrow)/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--aurora); }
.section-lead { font-size: var(--fs-lead); color: var(--muted); line-height: 1.55; max-width: 58ch; }
.note { color: var(--faint); font-size: var(--fs-small); }

/* calmer section glows: no extra blobs */
#portfolio::before, #booking::before, #om::before { opacity: .35; }
.glass-shape { display: none; }

/* ---------- hero ---------- */
.hero { background:
  radial-gradient(42% 46% at 76% 46%, rgba(124,92,255,.20), transparent 70%),
  radial-gradient(34% 36% at 70% 62%, rgba(52,245,197,.12), transparent 70%),
  var(--ink); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(transparent, var(--ink)); pointer-events: none; z-index: 1; }
.hero h1 { font-size: var(--fs-display); line-height: .98; letter-spacing: -0.045em; max-width: 13ch; margin-bottom: 0; }

/* headline reveal: transform only (text stays opaque so it is never "invisible" to LCP or readers) */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.hero h1 .w > span { display: inline-block; }
.reveal-go .hero h1 .w > span { animation: word-up .9s var(--ease-out) both; animation-delay: calc(var(--i) * 55ms + 60ms); }
@keyframes word-up { from { transform: translateY(102%); } to { transform: none; } }
.reveal-go .hero .eyebrow, .reveal-go .hero .lead, .reveal-go .hero .btn-row { animation: fade-up .9s var(--ease-out) both; }
.reveal-go .hero .lead { animation-delay: .32s; }
.reveal-go .hero .btn-row { animation-delay: .42s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* stage: still image first, live WebGL cross-fades in on top */
.hero-stage .hero-fallback { opacity: 1; transition: opacity .9s var(--ease-io); }
.hero-stage.live .hero-fallback { opacity: 0; }
.hero-stage canvas { transition: opacity .9s var(--ease-io); }

/* mobile: eyebrow → headline → devices → lead → buttons, all in the first screen */
@media (max-width: 899px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); padding: 28px var(--gutter) 8px; }
  .hero-copy { display: contents; }
  .hero .eyebrow { order: 1; margin-bottom: 16px; }
  .hero h1 { order: 2; position: relative; z-index: 2; }
  .hero-stage { order: 3; height: clamp(220px, 62vw, 340px); min-height: 0; margin: 4px calc(-1 * var(--gutter)) 0; width: auto; }
  .hero .lead { order: 4; margin-top: 4px; position: relative; z-index: 2; }
  .hero .btn-row { order: 5; position: relative; z-index: 2; margin-top: 22px; }
  .hero .btn-row .btn { flex: 1 1 auto; }
}
.hero .lead { font-size: var(--fs-lead); max-width: 44ch; margin-top: var(--s-5); }
.hero .btn-row { margin-top: var(--s-6); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: var(--s-6) 0 0; color: var(--faint); font-size: var(--fs-small); }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
@media (min-width: 900px) {
  .hero h1 { font-size: clamp(3rem, 1.4rem + 2.9vw, 4.6rem); max-width: 15ch; overflow-wrap: normal; }
  .hero-copy { flex-basis: min(50%, 700px); }
}

/* ---------- trust strip: hairline row, no tint ---------- */
.trust { background: none; border-block: 1px solid var(--line); }
.trust-list li { color: var(--muted); font-weight: 500; }
.trust-list svg { color: var(--teal); }

/* ---------- surfaces: one card language ---------- */
.panel, .calc-form, .price-col { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
.price-col { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); }
.price-col.featured { background: linear-gradient(180deg, rgba(124,92,255,.10), rgba(52,245,197,.03) 60%, rgba(255,255,255,.01)), var(--ink-2); box-shadow: 0 40px 90px -50px rgba(124,92,255,.8); }
.price-col.featured::before { animation: none; background: linear-gradient(160deg, rgba(52,245,197,.9), rgba(124,92,255,.7) 45%, rgba(255,255,255,.08) 80%); padding: 1px; }
.price { font-size: clamp(2.4rem, 1.8rem + 2vw, 3.4rem); }
.price-col h3 { font-size: 1.1rem; letter-spacing: .02em; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.plain li { border-top-color: var(--line); color: var(--text); }
.plain li:last-child { border-bottom-color: var(--line); }

/* services: editorial rows */
.svc { padding: clamp(48px, 6vw, 96px) 0; border-top-color: var(--line); }
.svc-text h3 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.2rem); letter-spacing: -0.035em; line-height: 1; }
.svc-media { border-radius: var(--r-panel); border-color: var(--line); background: var(--ink-2); box-shadow: 0 50px 100px -60px rgba(124,92,255,.55); }

/* process: flat hairline columns with big numerals */
.steps { gap: 0; perspective: none; border-top: 1px solid var(--line); }
.step { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 32px 0 36px; transform: none !important; }
.step-n, .step-1 .step-n, .step-2 .step-n, .step-3 .step-n, .step-4 .step-n {
  width: auto; height: auto; border: 0; background: none; border-radius: 0; place-items: start; margin-bottom: 18px;
  font: 800 clamp(2.6rem, 2rem + 2vw, 3.6rem)/1 var(--font-display); letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.28); transform: none !important;
}
.step-4 .step-n { -webkit-text-stroke: 0; background: var(--aurora); -webkit-background-clip: text; background-clip: text; }
.step:hover { box-shadow: none; }

/* portfolio + case */
.case { background: var(--ink-2); border-color: var(--line); }
.case-shot { background: radial-gradient(60% 70% at 40% 40%, rgba(124,92,255,.28), transparent 70%), radial-gradient(40% 50% at 85% 85%, rgba(52,245,197,.14), transparent 70%), #070a16; }
.soon-cta { border: 1px solid var(--line); background: linear-gradient(120deg, rgba(52,245,197,.06), rgba(124,92,255,.08) 55%, transparent); }

/* video stage */
.video-stage { background: radial-gradient(60% 70% at 50% 100%, rgba(124,92,255,.16), transparent 70%), var(--ink-2); border-color: var(--line); }

/* calculator + booking */
.calc-result { background: linear-gradient(180deg, rgba(124,92,255,.10), rgba(52,245,197,.03) 60%), var(--ink-2); }
.calc-result::before { opacity: .55; }
.opt, .seg-opt, .service-option, .slot { background: rgba(255,255,255,.02); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], textarea { background: rgba(255,255,255,.03); border-color: var(--line-2); }

/* faq */
.faq-item summary { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); padding: 26px 4px; }

/* about */
.about-tagline { color: var(--text) !important; }

/* footer */
.site-footer { padding: var(--s-8) 0; color: var(--faint); }

/* showcase head left-aligned like the rest */
.showcase { background: radial-gradient(50% 50% at 50% 40%, rgba(124,92,255,.14), transparent 70%), var(--ink); }
.showcase-head h2 { font-size: var(--fs-h2); }

@media (min-width: 900px) {
  .step { padding: 36px 32px 40px 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .step + .step { padding-left: 32px; }
  .step:last-child { border-right: 0; }
  .steps { border-bottom: 1px solid var(--line); }
}


/* ---------- "Tre ting jeg lager": static list by default (mobile, no JS, reduced motion) ---------- */
.story { position: relative; z-index: 2; padding: var(--s-7) var(--gutter) var(--s-8); max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; }
.story-title { font: 600 var(--fs-eyebrow)/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-5); display: flex; align-items: center; gap: 12px; }
.story-title::before { content: ""; width: 28px; height: 1px; background: var(--aurora); }
.story-list { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.chapter { position: relative; padding: var(--s-5) 0 var(--s-5) 56px; border-bottom: 1px solid var(--line); }
.ch-n { position: absolute; left: 0; top: calc(var(--s-5) + 4px); font: 600 var(--fs-small)/1 var(--font-body); letter-spacing: .08em; color: var(--teal); }
.chapter h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.03em; margin-bottom: .3em; }
.chapter p { color: var(--muted); margin: 0 0 var(--s-3); max-width: 46ch; }
.ch-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-weight: 600; text-decoration: none; }
.ch-link .arr { width: 18px; height: 18px; color: var(--teal); transition: transform var(--dur-2) var(--ease-out); }
.ch-link:hover .arr { transform: translateX(4px); }
.story-progress { display: none; }
@media (min-width: 900px) {
  .story { padding-top: 0; }
  .story-list { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; }
  .chapter { padding: var(--s-6) var(--s-6) var(--s-6) 0; border-bottom: 0; border-top: 1px solid var(--line); }
  .chapter + .chapter { padding-left: var(--s-6); border-left: 1px solid var(--line); }
  .ch-n { position: static; display: block; margin-bottom: var(--s-4); }
}

/* desktop story mode (motion.js adds .story-on): the hero is pinned and chapters replace the copy */
.story-on .hero { min-height: calc(100svh - var(--header-h)); }
.story-on .story { position: absolute; inset: 0 auto 0 0; width: min(50%, 720px); padding: 0 40px 0 max(24px, calc((100vw - var(--maxw)) / 2 + var(--gutter))); display: flex; flex-direction: column; justify-content: center; margin: 0; pointer-events: none; }
.story-on .story-title { visibility: hidden; opacity: 0; }
.story-on .story-list { display: block; position: relative; height: 340px; border: 0; }
.story-on .chapter { position: absolute; inset: 0; padding: 0; border: 0; visibility: hidden; opacity: 0; }
.story-on .chapter + .chapter { padding: 0; border: 0; }
.story-on .chapter h3 { font-size: clamp(3rem, 1.4rem + 3vw, 4.6rem); line-height: .98; letter-spacing: -0.045em; margin-bottom: .35em; }
.story-on .chapter p { font-size: var(--fs-lead); max-width: 40ch; }
.story-on .ch-n { font-size: var(--fs-eyebrow); letter-spacing: .16em; margin-bottom: var(--s-5); }
.story-on .chapter.is-active { pointer-events: auto; }
.story-on .story-progress { display: flex; gap: 8px; margin-top: var(--s-6); }
.story-progress i { width: 44px; height: 2px; border-radius: 2px; background: var(--line-2); overflow: hidden; position: relative; }
.story-progress i::after { content: ""; position: absolute; inset: 0; background: var(--aurora); transform: scaleX(var(--p, 0)); transform-origin: left; }
.story-on .story-progress { opacity: 0; }

/* ---------- section reveals (IntersectionObserver in motion.js; only for content below the first screen) ---------- */
[data-rv] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--rv-d, 0s); }
[data-rv].in { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .hero { flex-direction: column; align-items: stretch; justify-content: center; }
  .story { width: 100%; }
}

/* Lenis (desktop smooth scroll) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.story-on .hero-stage canvas, .story-on .hero-stage .hero-fallback {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(0deg, transparent 0, #000 14%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(0deg, transparent 0, #000 14%); mask-composite: intersect; }

/* parallax hook (motion.js animates --py) */
[data-py] { translate: 0 var(--py, 0px); will-change: translate; }

/* hover previews (desktop) */
.mock-lid { position: relative; overflow: hidden; }
.mock-tour { position: absolute; inset: 9px; border-radius: 6px; overflow: hidden; opacity: 0; transition: opacity .4s var(--ease-out); background: #000; }
.mock-tour img, .mock-lid .mock-tour img { width: 100%; height: auto; max-width: none; aspect-ratio: auto; object-fit: fill; border-radius: 0; transform: translateY(0); transition: transform 1.2s var(--ease-out); }
.case-shot.touring .mock-tour { opacity: 1; }
.case-shot.touring .mock-tour img { transform: translateY(calc(-100% + var(--tour-h, 300px))); transition: transform 9s cubic-bezier(.45,0,.55,1) .2s; }
.video-wrap.previewing .play-btn svg { opacity: 0; }

/* ---------- intro curtain (CSS only, ≤ 0.7s, first visit per session) ---------- */
.intro { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: var(--ink); pointer-events: none; animation: intro-out .34s var(--ease-io) .36s forwards; }
.intro-logo { font: 800 clamp(2.2rem, 1.6rem + 3vw, 3.4rem)/1 var(--font-display); letter-spacing: -0.045em; color: var(--text); animation: intro-logo .42s var(--ease-out) both; }
.intro-logo .dot { background: linear-gradient(135deg, #34F5C5, #7C5CFF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@keyframes intro-out { to { transform: translate3d(0, -100%, 0); visibility: hidden; } }
@keyframes intro-logo { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.intro-seen .intro { display: none; }
/* while the curtain lifts, hold the hero reveal so it plays in view */
html:not(.intro-seen) .reveal-go .hero h1 .w > span { animation-delay: calc(var(--i) * 55ms + 520ms); }
html:not(.intro-seen) .reveal-go .hero .eyebrow { animation-delay: .45s; }
html:not(.intro-seen) .reveal-go .hero .lead { animation-delay: .78s; }
html:not(.intro-seen) .reveal-go .hero .btn-row { animation-delay: .88s; }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

/* ---------- desktop cursor ring ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 450; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); pointer-events: none; opacity: 0; transition: opacity .25s, width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out), border-color .3s, background .3s; will-change: transform; }
.cursor.on { opacity: 1; }
.cursor.link { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: rgba(52,245,197,.7); background: rgba(52,245,197,.08); }
.cursor.hide { opacity: 0; }
[data-rv]:focus-within { opacity: 1; transform: none; transition-duration: .2s; }
