:root {
  --bg: #0a0a0b;
  --ink: #ecebe6;
  --ink-2: #b9b7b0;
  --muted: #8a8882;
  --dim: #3a3935;
  --faint: rgba(236, 235, 230, .34);
  --line: rgba(236, 235, 230, 0.12);
  /* Intelligensens färg. Byts av temaväxlaren (theme.js). */
  --accent: #2fe0d0;
  --accent-rgb: 47, 224, 208;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6; font-weight: 300;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  scrollbar-color: rgba(236, 235, 230, .2) var(--bg);
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ol, ul { list-style: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.accent, .sw-accent { color: var(--accent); }

/* ---------- Lager ---------- */
#field { position: fixed; inset: 0; z-index: 0; display: block; pointer-events: none; }
/* I scener där hjärnan arbetar på bilder ligger den framför innehållet */
#field.is-front { z-index: 14; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(10,10,11,.85) 100%),
    linear-gradient(to bottom, rgba(10,10,11,.6), transparent 18%, transparent 82%, rgba(10,10,11,.7));
}
main { position: relative; z-index: 3; }
.dust-layer { position: fixed; inset: 0; z-index: 15; pointer-events: none; }

/* ---------- Stoftmasker (dust.js) ----------
   Mjuk front som följer stoftet. Masken upprepas utanför boxen så att
   bokstävernas underhäng (g, j, p) inte klipps medan de byggs. */
.dust-hidden { visibility: hidden; }
.dust-in, .dust-out { -webkit-mask-repeat: repeat; mask-repeat: repeat; -webkit-mask-clip: no-clip; mask-clip: no-clip; }
.dust-in[data-dust-dir="right"] { -webkit-mask-image: linear-gradient(to right, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); mask-image: linear-gradient(to right, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y; }
.dust-in[data-dust-dir="left"] { -webkit-mask-image: linear-gradient(to left, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); mask-image: linear-gradient(to left, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y; }
.dust-in[data-dust-dir="up"] { -webkit-mask-image: linear-gradient(to top, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); mask-image: linear-gradient(to top, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x; }
.dust-in[data-dust-dir="down"] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); mask-image: linear-gradient(to bottom, #000 calc(var(--dust) * 130% - 30%), transparent calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x; }
.dust-out[data-dust-dir="right"] { -webkit-mask-image: linear-gradient(to right, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); mask-image: linear-gradient(to right, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y; }
.dust-out[data-dust-dir="left"] { -webkit-mask-image: linear-gradient(to left, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); mask-image: linear-gradient(to left, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y; }
.dust-out[data-dust-dir="up"] { -webkit-mask-image: linear-gradient(to top, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); mask-image: linear-gradient(to top, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x; }
.dust-out[data-dust-dir="down"] { -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); mask-image: linear-gradient(to bottom, transparent calc(var(--dust) * 130% - 30%), #000 calc(var(--dust) * 130%)); -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x; }
.dw { white-space: nowrap; }
.dc { transition: opacity .5s var(--ease), filter .5s var(--ease); }
.dc-off { opacity: 0; filter: blur(6px); }
.dc-out { opacity: 0; filter: blur(5px); transition-duration: .22s; }
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; }
.appear { animation: appear .9s var(--ease) both; }
@keyframes appear { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  transition: background .5s var(--ease), padding .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-top: 14px; padding-bottom: 14px; border-color: var(--line);
}
/* ---------- Logga: punkten över j är ett frö av intelligensen ---------- */
.logo { display: inline-flex; align-items: baseline; gap: 9px; line-height: 1; }
.logo-word { font-size: 25px; font-weight: 500; letter-spacing: -.045em; color: var(--ink); }
.logo-j { position: relative; display: inline-block; }
.logo-seed {
  position: absolute; left: 49%; top: .1em; width: .17em; height: .17em; border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
}
.logo-sub { font-size: 15px; font-weight: 300; letter-spacing: .01em; color: var(--muted); transition: color .4s var(--ease); }
.logo:hover .logo-sub { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.foot-logo { display: inline-flex; align-items: baseline; gap: 14px; }
.foot-logo .logo-word { font-size: 20px; }
.nav-links { display: flex; gap: 36px; font-size: 14px; color: var(--ink-2); }
.nav-links a { transition: color .3s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 28px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; letter-spacing: -.005em;
  transition: background .4s var(--ease), transform .4s var(--ease);
}
.btn:hover { background: var(--accent); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 13px; }
.link { font-size: 15px; color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .3s, border-color .3s; }
.link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Typografi ---------- */
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
h1, h2 { font-weight: 300; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(44px, 6.2vw, 96px); line-height: 1.04; margin-bottom: 32px; }
h2 { font-size: clamp(34px, 4.2vw, 62px); line-height: 1.08; margin-bottom: 28px; }
.tone { color: var(--muted); }

/* ---------- Vanliga sektioner ---------- */
.sec { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 140px 0; }
.copy { max-width: 540px; }
.copy--center { margin: 0 auto; text-align: center; max-width: 680px; }
.copy p { color: var(--ink-2); max-width: 46ch; }
.copy p + p { margin-top: 16px; }
.copy--center p { margin-left: auto; margin-right: auto; }
.lead { font-size: clamp(18px, 1.4vw, 21px); }
.lead-key { color: var(--accent); font-weight: 400; }
.actions { display: flex; align-items: center; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.actions--center { justify-content: center; }
.sec--hero { padding-top: 120px; }
.sec--hero .copy { max-width: 640px; }
.sec--hero > .wrap { position: relative; z-index: 1; }
.skyline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; mix-blend-mode: screen; }
/* hjärnans mitt i hero: fabrikens kontur (skyline.js) ritas runt den */
.hero-mark { position: absolute; width: 2px; height: 2px; left: calc(72% - 1px); top: calc(50svh - 1px); pointer-events: none; }
.scroll-cue { position: absolute; left: 50%; bottom: 32px; width: 1px; height: 56px; background: var(--line); overflow: hidden; }
.scroll-cue span { position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Foton i långsam rörelse ---------- */
.photo { position: relative; overflow: hidden; border-radius: 6px; background: #111; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(.62); }
.kb img { animation: kb 24s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kb { from { transform: scale(1.04); } to { transform: scale(1.16) translate(-2.5%, -1.5%); } }
.photo--wide { aspect-ratio: 16 / 9; }
.photo--ai img { filter: grayscale(.9) contrast(1.12) brightness(.8); }
.photo--ai::after { content: ""; position: absolute; inset: 0; background: rgba(var(--accent-rgb), .26); mix-blend-mode: color; pointer-events: none; }
.brain { position: absolute; width: 2px; height: 2px; pointer-events: none; }

/* =========================================================
   Påståendet
   ========================================================= */
.scene--statement { height: 260vh; }
.statement { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 10vh; }
.brain--statement { position: relative; margin-bottom: clamp(110px, 20vh, 200px); }
.statement-title { font-size: clamp(40px, 6vw, 92px); line-height: 1.06; margin-bottom: 30px; max-width: 16ch; }
.statement-title .swap { justify-items: center; }
.statement-title .sw-new { color: var(--accent); }
.statement-sub { display: grid; max-width: 44ch; color: var(--ink-2); font-size: clamp(17px, 1.4vw, 21px); }

/* =========================================================
   Scener (fästa vyer)
   ========================================================= */
.scene { position: relative; height: 420vh; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; overflow: hidden; }
.pin-grid { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: clamp(40px, 6vw, 96px); align-items: center; padding-top: 40px; }
.pin .wrap { max-width: 1440px; position: relative; z-index: 1; }
.scene-copy h2 { font-size: clamp(32px, 3.4vw, 52px); margin-bottom: 26px; }
.states { display: grid; color: var(--ink-2); font-size: 18px; max-width: 40ch; }
.state { grid-area: 1 / 1; transition: opacity .7s var(--ease), filter .7s var(--ease); }
.state--ai { opacity: 0; filter: blur(4px); }
.is-ai .state--today { opacity: 0; filter: blur(4px); }
.is-ai .state--ai { opacity: 1; filter: none; }
.scene-viz { position: relative; min-width: 0; }

/* ---------- Fabriken ---------- */
.scene--factory { height: 860vh; }
.factory-grid { display: grid; grid-template-columns: minmax(260px, 3.2fr) 8.8fr; gap: clamp(32px, 4vw, 64px); align-items: center; padding-top: 40px; }
.beats { display: grid; }
.beat { grid-area: 1 / 1; opacity: 0; filter: blur(6px); transform: translateY(10px); transition: opacity .8s var(--ease), filter .8s var(--ease), transform .8s var(--ease); pointer-events: none; }
.beat.on { opacity: 1; filter: none; transform: none; }
.beat h2 { font-size: clamp(32px, 3.4vw, 52px); margin-bottom: 20px; }
.beat p { color: var(--ink-2); font-size: 18px; max-width: 36ch; }
.factory-viz { position: relative; padding-top: 20%; }
.factory { position: relative; width: 100%; }
.factory-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.factory-svg * { vector-effect: non-scaling-stroke; }
.brain--factory { left: 52%; top: 4%; width: 40%; height: 30%; transform: translateX(-50%); }
.slab { fill: rgba(236,235,230,.015); stroke: rgba(236,235,230,.14); stroke-width: 1; }
.zone { transition: transform var(--sd, 1.3s) var(--ease); }
.zone-plate { fill: rgba(236,235,230,.025); stroke: rgba(236,235,230,.22); stroke-width: 1; transition: stroke .8s var(--ease), fill .8s var(--ease); }
.ge5 .merging .zone-plate { stroke: rgba(var(--accent-rgb), .35); fill: rgba(var(--accent-rgb), .03); }
.box polygon { stroke: rgba(236,235,230,.5); stroke-width: .8; stroke-linejoin: round; transition: stroke .6s, fill .6s; }
.face-t { fill: rgba(236,235,230,.07); }
.face-l { fill: rgba(236,235,230,.035); }
.face-r { fill: rgba(236,235,230,.02); }
.box.screen polygon, .box.rack polygon { stroke: rgba(236,235,230,.35); }
.box.wip polygon { stroke: rgba(236,235,230,.45); fill: rgba(236,235,230,.06); }
.box.wip { transition: opacity .6s var(--ease); }
.box.wip.off { opacity: 0; }
.ripples { opacity: 0; transition: opacity .6s; }
.ripple { fill: none; stroke: rgba(236,235,230,.5); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: ripple 2.7s var(--ease) infinite; }
@keyframes ripple { from { transform: scale(.6); opacity: .9; } to { transform: scale(9); opacity: 0; } }
.reroute { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0; transition: opacity .8s; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -14; } }
.ge6 .reroute { opacity: 1; }
.person { opacity: 0; transition: opacity .6s; }
.p-body { stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.p-head { fill: var(--ink); }
.p-paper { fill: none; stroke: var(--ink-2); stroke-width: .8; transition: opacity .5s; }
.ge6 .p-paper { opacity: 0; }
.factory-labels { position: absolute; inset: 0; pointer-events: none; }
.factory-labels > * { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; }
.factory-labels > .f-zone { transform: none; font-size: 12px; color: var(--ink-2); letter-spacing: .01em; }
.f-mlabel { font-size: 11.5px; color: var(--ink-2); }
/* Avdelningsnamnen är målade i golvet */
.zone-name { font-size: 6.2px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; fill: rgba(236,235,230,.38); transition: fill .7s var(--ease) var(--lag, 0s); vector-effect: none; }
.factory[data-beat="0"] .zone-name, .factory[data-beat="1"] .zone-name { fill: rgba(236,235,230,.62); }
.factory[data-beat="3"] .zone-name, .factory[data-beat="4"] .zone-name { fill: rgba(236,235,230,.16); }
.factory[data-beat="5"] .zone-name, .factory[data-beat="6"] .zone-name { fill: rgba(var(--accent-rgb),.42); }
/* Namn på avdelningar, maskiner och personer: alltid en mörk platta bakom, så att de går att läsa ovanpå linjerna */
.factory-labels > .f-zone, .f-mlabel, .f-role { padding: 2px 7px 3px; border-radius: 3px; background: rgba(10,10,11,.82); line-height: 1.25; }
.factory-labels > .f-zone { color: var(--ink); }
.f-data { font-size: 12px; color: var(--ink-2); padding: 2px 8px; border-radius: 999px; background: rgba(10,10,11,.72); opacity: 0; transition: opacity .7s var(--ease), color .6s; }
.f-data.is-ai { color: var(--accent); }
.f-timer { font-size: 12.5px; color: var(--ink); padding: 3px 9px; border-radius: 4px; background: rgba(10,10,11,.8); opacity: 0; transition: opacity .7s var(--ease); }
.f-timer .sw-new { color: var(--accent); }
.factory-labels > .f-zone, .factory-labels > .f-mlabel, .factory-labels > .f-data, .factory-labels > .f-timer, .factory-labels > .f-down { transition: left var(--sd, 1.3s) var(--ease), top var(--sd, 1.3s) var(--ease), opacity .7s var(--ease), color .6s var(--ease); }
.f-down { font-size: 12px; color: var(--ink); opacity: 0; transition: opacity .6s; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 4px 7px; border-radius: 4px; background: rgba(10,10,11,.86); border: 1px solid rgba(236,235,230,.45); }
.f-down b { font-weight: 500; }
.f-down span { color: var(--ink-2); }
.f-warn svg { display: block; width: 18px; height: 17px; fill: rgba(10,10,11,.6); stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; animation: warn-float 5.4s ease-in-out infinite; }
.f-warn svg path:first-child { animation: warn-pulse 2.7s var(--ease) infinite; transform-origin: 50% 60%; transform-box: fill-box; }
@keyframes warn-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes warn-pulse { 0%, 100% { stroke-opacity: 1; } 12% { stroke-opacity: 1; stroke-width: 1.6; } 55% { stroke-opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .f-warn svg, .f-warn svg path { animation: none; } }

/* ---------- Vad ledningen får ---------- */
/* Läsfokus: bara ett block är tänt åt gången. Rubriken först (påståendet, sedan villkoret),
   sedan tar en rad i taget över när den når läslinjen; det som lämnats tonas ner. */
.kpi .kpi-name, .kpi p:last-child { color: var(--dim); transition: color .8s cubic-bezier(.2,.7,.2,1); }
.kpi.is-on .kpi-name { color: var(--ink); }
.kpi.is-on p:last-child { color: var(--ink-2); }
.sec--value { min-height: 0; display: block; padding: 200px 0 60px; }
.value-title { max-width: 20ch; font-size: clamp(36px, 4.6vw, 68px); color: var(--ink); }
.value-title > span { transition: color 1s cubic-bezier(.2,.7,.2,1); }
/* rubriken läses också en mening i taget: påståendet först, sedan villkoret */
.value-title > span { color: #2a2927; }   /* stora bokstäver syns mer, så rubriken tonas ner hårdare än raderna */
.value-title > span.is-on { color: var(--ink); }
.kpi-list { margin-top: 96px; max-width: 1000px; }
.kpi { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; padding: 40px 0; border-top: 1px solid var(--line); align-items: baseline; }
.kpi:last-child { border-bottom: 1px solid var(--line); }
.kpi-name { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.02em; color: var(--ink); }
.kpi p:last-child { max-width: 46ch; }
.sec--intro { min-height: 0; display: block; padding: 160px 0 40px; }
.sec--page { padding-top: 200px; }
.intro-p { color: var(--ink-2); font-size: clamp(18px, 1.5vw, 22px); max-width: 44ch; margin-top: 8px; }
.sec--more { min-height: 0; display: block; padding: 60px 0 40px; }
.more-link { display: inline-block; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.015em; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: color .4s, border-color .4s; margin-top: 12px; }
.more-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 80 procent ---------- */
.scene--eighty { height: 170vh; }
.eighty { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 6vw, 110px); align-items: center; }
.big-num { font-size: clamp(120px, 17vw, 260px); font-weight: 200; letter-spacing: -.06em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.big-num small { font-size: .38em; letter-spacing: 0; margin-left: .06em; vertical-align: .9em; }
.eighty-text { margin-top: 18px; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.4; letter-spacing: -.01em; color: var(--ink-2); max-width: 24ch; }
.flows li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 17px; }
.flows li:last-child { border-bottom: 1px solid var(--line); }
.fl-name { color: var(--ink); }
.fl-st { color: var(--muted); text-align: right; justify-items: end; }
.fl-st { min-width: 90px; }
.fl-st { display: grid; justify-items: end; }
.fl-st > * { grid-area: 1 / 1; }
.fl-man { transition: opacity .3s var(--ease), filter .3s var(--ease); }
.work-cell { display: inline-flex; align-items: center; gap: 10px; }
.work { opacity: 0; transform: scale(.4); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.is-auto .fl-man { opacity: 0; filter: blur(4px); }
.is-auto .work { opacity: 1; transform: none; transition-delay: .35s; }
.aiu { color: var(--ink); letter-spacing: -.005em; }
.aiu b { font-weight: 500; color: var(--accent); font-feature-settings: "cv08" 1; letter-spacing: .02em; margin-right: .04em; }
/* Intelligensen arbetar: en liten svärm av stoft som kretsar på raden */
.work { position: relative; display: block; width: 22px; height: 20px; }
.work i { position: absolute; left: 50%; top: 50%; width: 2.4px; height: 2.4px; margin: -1.2px; border-radius: 50%; background: var(--accent);
  animation: orbit var(--t) linear calc(var(--o) + var(--shift, 0s)) infinite; }
@keyframes orbit { from { transform: rotate(0deg) translateX(calc(var(--r) * .62)); } to { transform: rotate(360deg) translateX(calc(var(--r) * .62)); } }

/* ---------- Planen ---------- */
.scene--plan { height: 330vh; }
.plan-p { color: var(--ink-2); font-size: 18px; max-width: 40ch; }
.slogan { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 var(--gutter); pointer-events: none; }
.slogan-h { transition: color .3s; font-size: clamp(48px, 7.4vw, 120px); line-height: 1.04; letter-spacing: -.04em; max-width: 12ch; margin-bottom: 28px; }
/* kantljus (sloganlight.js): samma reflex som de stora orden, längs bokstävernas kanter */
.slogan-light { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; mix-blend-mode: screen; opacity: 0; transition: opacity 1.2s var(--ease); }
.slogan-built .slogan-light { opacity: 1; transition: opacity .5s var(--ease); }
.slogan-built .slogan-h { color: transparent; transition: color .5s var(--ease); }
.slogan > h2, .slogan > p { position: relative; z-index: 1; }
.slogan-p { color: var(--ink-2); font-size: clamp(17px, 1.4vw, 21px); max-width: 52ch; opacity: 0; filter: blur(6px); transition: opacity 1s var(--ease) 1.6s, filter 1s var(--ease) 1.6s; }
.is-slogan .slogan-p { opacity: 1; filter: none; }
.scene .pin-grid { transition: filter .6s var(--ease), opacity .6s var(--ease); }
.is-slogan .pin-grid { filter: blur(10px); opacity: .28; }

.board-head { position: relative; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
/* Händelsen: ikon och ord. Den syns där den sker, lyfts sedan in till hjärnan och
   ligger där medan hjärnan bearbetar den; först när planen läggs om pulveriseras den. */
.scene-viz { position: relative; }
.ev-tag { position: absolute; z-index: 5; display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); pointer-events: none;
  transform: translate(-50%, -50%); font-size: 16px; letter-spacing: -.01em;
  transition: left .9s cubic-bezier(.65, 0, .35, 1), top .9s cubic-bezier(.65, 0, .35, 1), transform .9s cubic-bezier(.65, 0, .35, 1), font-size .9s var(--ease), opacity .5s var(--ease); }
.ev-ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80; transition: stroke-dashoffset .9s var(--ease), width .9s var(--ease), height .9s var(--ease), opacity .35s var(--ease); }
.ev-tag.on .ev-ico { stroke-dashoffset: 0; }
/* utifrån: större, glider in från vänster in mot schemat */
.ev-tag--out { font-size: 17px; gap: 12px; transform: translate(calc(-50% - 40px), -50%); opacity: 0; }
.ev-tag--out .ev-ico { width: 30px; height: 30px; stroke-width: 1.3; }
.ev-tag--out.on { transform: translate(-50%, -50%); opacity: 1; }
/* hos hjärnan: mindre, intill den, andas medan den bearbetas */
.ev-tag.held { transform: translate(-100%, -50%); font-size: 14px; animation: held 1.1s ease-in-out .9s infinite alternate; }
.ev-tag.held .ev-ico { width: 20px; height: 20px; }
@keyframes held { from { opacity: 1; } to { opacity: .55; } }
.ev-tag.gone { animation: none; }
.ev-tag.gone .ev-ico { opacity: 0; }
/* körblocket där något hänt: innehållet tonas ner så att händelsen syns */
.job.now .row, .job.now .bar, .job.now .over { transition: opacity .45s var(--ease); }
.job.now.hit .row, .job.now.hit .bar, .job.now.hit .over { opacity: .12; }
.job.now.hit { background: rgba(236,235,230,.05); }
/* en ruta som flyttas: lyfts lite och glider till sin nya plats */
.job.ghost { position: absolute; z-index: 4; margin: 0; pointer-events: none; border-bottom-color: transparent; background: rgba(236,235,230,.05);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: transform .75s cubic-bezier(.65, 0, .35, 1); }
.job.ghost .row b, .job.ghost .row em { color: var(--accent); }
/* maskinen står: hela kolumnen ser avstängd ut tills den är igång igen */
.mc h3 { text-decoration: line-through; text-decoration-color: transparent; }
.mc.is-down h3 { color: var(--muted); text-decoration-color: rgba(236,235,230,.35); }
.mc.is-down .job.now .row, .mc.is-down .job.now .bar { opacity: .25; transition: opacity 1.2s var(--ease); }
.mc.is-down .slot span { opacity: 0; }
.mc-down { position: absolute; left: -10px; right: -10px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 6px; border: 1px solid rgba(236,235,230,.12); color: var(--ink-2); pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(236,235,230,.05) 0 1px, transparent 1px 9px), rgba(11,11,11,.55);
  opacity: 0; transition: opacity .6s var(--ease); }
.mc-down.on { opacity: 1; }
.mc-down.leaving { transition: opacity 1.3s var(--ease); }
.mc-down > * { transition: opacity .4s var(--ease); }
.mc-down.hit > * { opacity: 0; }
.mc-down .ev-ico { width: 26px; height: 26px; stroke-dashoffset: 0; }
.mc-down b { font-weight: 400; font-size: 15px; color: var(--ink); }
.mc-down span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc h3 { transition: color 1.2s var(--ease), text-decoration-color 1.2s var(--ease); }
.mc.is-hit h3 { color: var(--accent); }
.clock { color: var(--muted); font-size: 15px; }
.clock b { font-weight: 300; color: var(--ink); font-size: clamp(26px, 2.4vw, 36px); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-left: 8px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.mc h3 { font-size: 15px; font-weight: 400; color: var(--ink-2); padding-bottom: 12px; border-bottom: 1px solid rgba(236,235,230,.3); margin-bottom: 0; }
.mc--focus h3 { color: var(--ink); }
.mc { position: relative; }
/* Fast block för det som körs: står still, korten glider upp in i det */
.slot { position: absolute; left: -10px; right: -10px; height: var(--row); margin-top: 8px; border-radius: 6px; background: rgba(236,235,230,.055); pointer-events: none; }
.slot span { position: absolute; top: 6px; left: 10px; padding-left: 11px; font-size: 11px; color: var(--ink-2); }
.slot span::before { content: ""; position: absolute; left: 0; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); }
.mc ul { position: relative; display: block; height: calc(var(--row) * 4); overflow: hidden; margin: 8px -10px 0; padding: 0 10px; will-change: transform; }
.board { --row: 86px; }
.job { position: relative; display: grid; align-content: start; box-sizing: border-box; height: var(--row); padding: 22px 10px 16px; margin: 0 -10px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.job .row { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 2px; }
.job .row b { font-weight: 400; font-size: 14.5px; color: var(--ink); }
/* Raden som just ändrats lyser upp kort; klara jobb rullar ut */
.job { transition: background .5s var(--ease), border-color .5s var(--ease), opacity .4s var(--ease), padding .35s var(--ease), height .35s var(--ease); }
.job.grow { height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; transition: none; }
.job .tm { display: grid; }
.job .tm > em { grid-area: 1 / 1; }
.job.done { opacity: 0; }
/* Det som körs i maskinen just nu, markerat som i en övervakningsvy */
.job.now { border-bottom-color: transparent; }
.is-ai .job .row em { font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .5s; }
.job.gap .sw-old b { color: var(--muted); }

.job .row b, .job .row em { transition: color .9s var(--ease); }
.job .sw-accent b, .job .sw-accent em { color: var(--accent); }
.job.is-late .sw-old em { color: var(--ink); }
.job.is-late .sw-old em::after { content: "  ligger efter"; color: var(--ink-2); }
.bar { position: absolute; left: 10px; bottom: 9px; height: 2px; width: 60%; background: rgba(236,235,230,.12); }
.bar i, .bar u { position: absolute; top: 0; height: 100%; transform-origin: left; transform: scaleX(0); }
.bar i { left: 0; width: 100%; background: var(--ink-2); }
.bar u { left: 100%; width: 28%; background: rgba(236,235,230,.55); }
.is-ai .bar u { background: var(--accent); }
.over { position: absolute; right: 10px; top: 6px; font-size: 11px; color: var(--ink); }
.is-ai .over { color: var(--ink-2); }
.scene:not(.is-ai) .is-ai 
/* ---------- Störning: bild bakom, rader framför ---------- */
.backdrop { position: absolute; inset: 0; overflow: hidden; }
.backdrop img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(.4); }
/* Simulerad film: bildrutor som glider över i varandra med långsam kamerarörelse */
.film img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease); animation: kb 26s ease-in-out infinite alternate; transform-origin: 55% 45%; }
.film img.on { opacity: 1; }
.backdrop--right::after { background: linear-gradient(rgba(10,10,11,.68), rgba(10,10,11,.68)), linear-gradient(to top, var(--bg), transparent 30%); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,11,.92) 0%, rgba(10,10,11,.55) 55%, rgba(10,10,11,.25) 100%), linear-gradient(to top, var(--bg), transparent 30%); }
.cascade { position: relative; z-index: 1; }
.cascade h2 { font-size: clamp(48px, 7vw, 104px); line-height: 1.04; margin-bottom: 40px; }
.lines { display: grid; gap: 10px; max-width: 760px; }
.lines li { font-size: clamp(22px, 2.3vw, 34px); line-height: 1.3; letter-spacing: -.02em; display: grid; }
.lines .sw-old { color: var(--muted); }
.lines .sw-new { color: var(--ink); }
.lines .sw-accent { color: var(--accent); }

/* ---------- Beslut ---------- */
.result { margin-top: 40px; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.3; letter-spacing: -.02em; max-width: 22ch; }
.result .sw-old { color: var(--muted); font-variant-numeric: tabular-nums; }
.field-area { position: relative; width: 100%; height: min(72vh, 620px); }
.field-core { position: absolute; inset: 0; pointer-events: none; }
.src { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; transition: opacity .6s var(--ease); opacity: .62; }
.src b { display: block; font-weight: 400; font-size: 15px; color: var(--ink); transition: color .6s var(--ease); }
.src span { display: block; font-size: 13px; color: var(--ink-2); }
.src.is-busy { opacity: 1; }
.src.is-busy b { animation: busy 1.1s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .35; } }
.src.is-read { opacity: .8; }
.src.is-ai { opacity: 1; }
.src.is-ai b { color: var(--accent); }
.src[data-i="0"] { left: 14%; top: 12%; }
.src[data-i="1"] { left: 50%; top: 4%; }
.src[data-i="2"] { left: 86%; top: 12%; }
.src[data-i="3"] { left: 92%; top: 50%; }
.src[data-i="4"] { left: 86%; top: 88%; }
.src[data-i="5"] { left: 50%; top: 96%; }
.src[data-i="6"] { left: 14%; top: 88%; }
.src[data-i="7"] { left: 8%; top: 50%; }

/* ---------- Program ---------- */
.photo-stack { position: relative; }
.photo-stack .p-new { position: absolute; inset: 0; }
.measure { display: flex; align-items: baseline; gap: 20px; margin-top: 28px; }
.measure .big { font-size: clamp(56px, 6vw, 96px); font-weight: 200; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.measure-text { color: var(--ink-2); font-size: 17px; max-width: 32ch; display: grid; }

/* ---------- Kvalitet ---------- */
.doc { position: relative; max-width: 560px; }
.doc-title { font-size: clamp(26px, 2.4vw, 36px); letter-spacing: -.02em; margin-bottom: 8px; }
.doc-event { color: var(--ink-2); font-size: 16px; min-height: 1.6em; opacity: 0; filter: blur(4px); transition: opacity .8s var(--ease), filter .8s var(--ease); }
.is-event .doc-event { opacity: 1; filter: none; }
.doc-body { display: grid; margin-top: 18px; }
.checks { grid-area: 1 / 1; }
.checks li { display: flex; justify-content: space-between; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 17px; color: var(--ink-2); }
.checks li:last-child { border-bottom: 1px solid var(--line); }
.checks li > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.checks--ai li { color: var(--ink); }
.checks--ai li > span:last-child { color: var(--ink-2); }
.is-alert .hot > span:first-child { color: var(--accent); }
.doc-foot { margin-top: 18px; color: var(--muted); font-size: 15px; }
.doc-foot .sw-new { color: var(--accent); }
/* Kontrollbladet: ett vitt kontrolldokument. Ritningshuvud i rutnät, teknisk ritning i ram där
   kontrollerade mått är markerade med överstrykningspenna och numrerade ballonger, kontrolltabell
   vars nummer hänvisar till ballongerna, signaturrad. Markeringarna ritas in när avsnittet visas. */
.doc--paper { --paper: #ecebe6; --pink: #1c1b19; --pmut: #64615a; --pline: rgba(28,27,25,.22);
  width: min(100%, 460px); margin-left: auto; padding: 18px; border-radius: 3px;
  background: var(--paper); color: var(--pink); box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 30px 60px -24px rgba(0,0,0,.85); }
.tb { display: grid; grid-template-columns: 1.6fr 1fr .5fr 1fr; border: 1px solid var(--pink); }
.tb-c { padding: 7px 10px 8px; border-right: 1px solid var(--pline); border-bottom: 1px solid var(--pline); min-width: 0; }
.tb-c { border-bottom: 0; }
.tb-c:last-child { border-right: 0; }
.tb-c span { display: block; font-size: 11px; color: var(--pmut); line-height: 1.3; }
.tb-c b { display: block; font-weight: 400; font-size: 14px; line-height: 1.3; color: var(--pink); }
.tb-name b { font-size: 17px; letter-spacing: -.01em; }
.doc--paper .doc-title { margin: 0; font-size: 17px; }
.doc-draw { display: block; width: 100%; height: 150px; margin-top: 8px; border: 1px solid var(--pline); background: #f1f0ec; }
.doc-draw .part { fill: none; stroke: var(--pink); stroke-width: 1.3; stroke-linejoin: miter; }
.doc-draw .thin { fill: none; stroke: var(--pink); stroke-width: .5; }
.doc-draw .axis { fill: none; stroke: rgba(28,27,25,.45); stroke-width: .5; stroke-dasharray: 12 2.5 2 2.5; }
.doc-draw .dim { fill: none; stroke: rgba(28,27,25,.7); stroke-width: .5; }
.doc-draw .arr { fill: rgba(28,27,25,.8); }
.doc-draw text { font-size: 9.5px; fill: var(--pink); text-anchor: middle; font-family: inherit; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.doc-draw .ball circle { fill: #f1f0ec; stroke: var(--pink); stroke-width: .7; }
.doc-draw .ball text { font-size: 8.5px; }
.doc-draw .hl path { fill: none; stroke: #f4dd3a; stroke-opacity: .7; stroke-width: 12; stroke-linecap: butt; mix-blend-mode: multiply;
  stroke-dasharray: 60; stroke-dashoffset: 60; }
.is-entered .doc-draw .hl path { animation: hl-draw .45s cubic-bezier(.3,.7,.3,1) var(--d) forwards; }
@keyframes hl-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .doc-draw .hl path { stroke-dashoffset: 0; animation: none; } }
.doc--paper .doc-event { color: var(--pmut); font-size: 12.5px; min-height: 1.5em; margin: 8px 0 4px; }
.ch { display: grid; grid-template-columns: 22px 1fr 82px 96px; gap: 8px; align-items: baseline; }
.ch > span:last-child { text-align: right; }
.ch-head { font-size: 11px; color: var(--pmut); padding: 4px 0; border-bottom: 1px solid var(--pink); }
.doc--paper .doc-body { margin-top: 0; }
.doc--paper .checks li.ch { display: grid; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--pink); border-top: 0; border-bottom: 1px solid var(--pline); }
.doc--paper .checks li:last-child { border-bottom-color: var(--pline); }
.doc--paper .checks li > span { color: var(--pink); }
.doc--paper .checks li > span:nth-child(3) { color: var(--pmut); font-size: 12px; }
.doc--paper .checks li > span:first-child { color: var(--pmut); font-variant-numeric: tabular-nums; }
.doc--paper .doc-foot { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--pmut); }
.doc-foot .sw-new b { font-weight: 500; }
.doc--paper .doc-foot .sw-new.sw-new { color: var(--pink); }
.doc-foot .sw-new b { color: color-mix(in srgb, var(--accent) 60%, #000); }
.doc--paper .doc-foot .sw-new, .doc--paper .sw-accent { color: color-mix(in srgb, var(--accent) 60%, #000); }
.sign { display: grid; grid-template-columns: 1.6fr 1fr .8fr; margin-top: 10px; border: 1px solid var(--pline); font-size: 11px; color: var(--pmut); }
.sign span { padding: 6px 10px 16px; border-right: 1px solid var(--pline); }
.sign span:last-child { border-right: 0; padding-bottom: 6px; align-self: end; text-align: right; }
.is-alert .doc--paper .hot > span:nth-child(2) { color: color-mix(in srgb, var(--accent) 60%, #000); }
.doc--paper .checks .ok { color: var(--pmut); }
.val { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: tabular-nums; }
.val.swap { display: inline-grid; justify-items: end; }
.val.swap > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.tol { display: inline-block; width: 34px; height: 9px; flex: none; font-style: normal;
  border-left: 1px solid rgba(28,27,25,.45); border-right: 1px solid rgba(28,27,25,.45);
  background: radial-gradient(circle, currentColor 0 2.4px, transparent 2.9px) calc(var(--v) * 100%) 50% / 7px 7px no-repeat,
    linear-gradient(var(--pline), var(--pline)) 0 50% / 100% 1px no-repeat; }
.trend { margin-top: 8px; }
.trend figcaption { display: flex; justify-content: space-between; font-size: 11px; color: var(--pmut); margin-bottom: 3px; }
.trend svg { display: block; width: 100%; height: 42px; overflow: visible; }
.trend .band { fill: rgba(28,27,25,.05); }
.trend .lim { stroke: color-mix(in srgb, var(--accent) 60%, #000); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; stroke-dasharray: 4 3; }
.trend polyline { fill: none; stroke: var(--pink); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.trend .proj { fill: none; stroke: color-mix(in srgb, var(--accent) 60%, #000); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-dasharray: 2 3; }
.trend circle { fill: color-mix(in srgb, var(--accent) 60%, #000); }

/* =========================================================
   Så går det till
   ========================================================= */
.sec--method { min-height: 0; display: block; padding: 180px 0 160px; }
.plan-wrap { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 5vw, 80px); margin-top: 48px; align-items: start; }
.plan-media { position: sticky; top: 18vh; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: #111; }
.plan-media img { filter: grayscale(1) contrast(1.08) brightness(.66); object-fit: cover; width: 100%; height: 100%; }
.plan { max-width: 640px; }
.plan-row { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; padding: 40px 0; min-height: 34vh; transition: opacity .6s var(--ease); border-top: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 1px solid var(--line); }
.plan-line { font-size: clamp(26px, 2.8vw, 40px); line-height: 1.3; letter-spacing: -.025em; color: var(--ink); }
.plan-row p:last-child { color: var(--ink-2); max-width: 42ch; }
.plan-row.dim { opacity: .35; }

/* =========================================================
   Om – porträtt med frö
   ========================================================= */
.about { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.portrait { position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 733 / 1100; max-width: 440px; width: 100%; transform-origin: 50% 0%; }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(.72); }
.portrait .seed { position: absolute; inset: 0; width: 100%; height: 100%; }
.sec--contact h2 { font-size: clamp(40px, 5.6vw, 84px); }

.foot {
  position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 32px var(--gutter); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.foot a:hover { color: var(--ink); }

/* ---------- Temaväxlare (tillfällig) ---------- */
.theme-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(10, 10, 11, .8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12px; color: var(--muted);
}
.theme-switch button { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sw); outline: 1px solid transparent; outline-offset: 3px; transition: outline-color .3s, transform .3s var(--ease); }
.theme-switch button:hover { transform: scale(1.12); }
.theme-switch button[aria-pressed="true"] { outline-color: var(--ink); }

/* ---------- Mobil ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .sec { display: block; min-height: 0; padding: 120px 0 40px; }
  .sec--hero { min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: 110px; }
  .hero-mark { left: calc(50% - 1px); top: calc(30svh - 1px); }
  .copy { max-width: none; }
  .scene { height: 380vh; }
  .pin { align-items: flex-start; }
  .pin-grid { grid-template-columns: 1fr; gap: 20px; padding-top: 84px; }
  .scene-copy h2 { font-size: 30px; margin-bottom: 14px; }
  .states { font-size: 16px; }
  .result { margin-top: 18px; font-size: 20px; }
  .cascade { padding-top: 22vh; }
  .field-area { height: 40vh; height: 40svh; }
  .src b { font-size: 12px; }
  .src span { display: none; }
  .measure { flex-direction: column; gap: 4px; }
  .plan-wrap { grid-template-columns: 1fr; }
  .plan-media { position: sticky; top: 64px; z-index: 2; aspect-ratio: 16 / 9; box-shadow: 0 24px 24px var(--bg); }
  .plan-row { min-height: 0; }
  .about { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .scene--eighty { height: 160vh; }
  .eighty { grid-template-columns: 1fr; gap: 16px; padding-top: 70px; }
  .big-num { font-size: 110px; }
  .eighty-text { font-size: 17px; margin-top: 4px; }
  .flows li { padding: 8px 0; font-size: 14px; }
  .board .mc:nth-child(2) { display: none; }
  .board { --row: 66px; }
  .job .row b { font-size: 13px; }
  .job .row em { font-size: 12px; }
  .scene--factory { height: 760vh; }
  .factory-grid { grid-template-columns: 1fr; gap: 8px; padding-top: 72px; }
  .beat h2 { font-size: 28px; margin-bottom: 8px; }
  .beat p { font-size: 15px; }
  .factory-viz { padding-top: 18%; }
  .zone-name { font-size: 9px; }
  .f-mlabel { display: none; }
  .f-data, .f-timer, .f-down, .f-sys, .f-role { font-size: 9.5px; padding: 1px 5px; }
  .f-sys span { display: none; }
  .kpi { grid-template-columns: 1fr; gap: 6px; }
  .statement { padding-top: 18vh; }
  .brain--statement { margin-bottom: 16vh; }
  .theme-switch { right: 10px; bottom: 10px; padding: 5px 7px 5px 10px; gap: 6px; font-size: 11px; }
  .theme-switch button { width: 15px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity .6s; transform: none; }
  .scroll-cue span, .kb img, .film img, .src.is-busy b, .work i { animation: none; }
}

/* =========================================================
   Fabriken: hierarki. Ett fokus per steg, allt annat är svag grund.
   Fokus tänds strax efter att texten bytts (--lag), etiketter en i taget.
   ========================================================= */
.factory { --lag: .35s; }
.factory .box polygon { stroke: rgba(236,235,230,.22); transition: stroke .7s var(--ease) var(--lag), opacity .7s var(--ease) var(--lag); }
.factory .face-t { fill: rgba(236,235,230,.035); }
.factory .zone-plate { stroke: rgba(236,235,230,.13); transition: stroke .7s var(--ease) var(--lag), fill .7s var(--ease) var(--lag); }
.factory .factory-labels > * { opacity: 0; transition: left var(--sd, 1.3s) var(--ease), top var(--sd, 1.3s) var(--ease), opacity .5s var(--ease), color .6s var(--ease); }
.factory .factory-labels > .show { opacity: 1; transition: left var(--sd, 1.3s) var(--ease), top var(--sd, 1.3s) var(--ease), opacity .7s var(--ease) var(--d, var(--lag)), color .6s var(--ease); }
.factory .person { opacity: 0; transition: opacity .6s var(--ease) var(--lag); }

/* 0 Er fabrik: maskinerna och avdelningarnas namn */
.factory[data-beat="0"] .box polygon { stroke: rgba(236,235,230,.55); }
.factory[data-beat="0"] .zone-plate { stroke: rgba(236,235,230,.24); }
/* 1 Öar: öarnas ramar och datan på varje ö */
.factory[data-beat="1"] .zone-plate { stroke: rgba(236,235,230,.7); fill: rgba(236,235,230,.05); }
/* 2 För hand: människorna */
.factory[data-beat="2"] .person { opacity: 1; }
.factory[data-beat="2"] .zone-plate { stroke: rgba(236,235,230,.3); }
/* 3 Systemen: maskinerna dämpade, länkarna till systemen och chippen i fokus */
.factory[data-beat="3"] .box polygon { stroke: rgba(236,235,230,.2); }
.factory[data-beat="3"] .zone-plate { stroke: rgba(236,235,230,.12); }
.factory[data-beat="3"] .box.machine polygon { stroke: rgba(236,235,230,.42); }
.factory[data-beat="3"] .links { opacity: 1; }
/* 4 Störning och kedjan: allt nästan svart utom Svarv 3, köerna och bågarna */
.factory[data-beat="4"] .box polygon { stroke: rgba(236,235,230,.1); }
.factory[data-beat="4"] .zone-plate { stroke: rgba(236,235,230,.08); }
.factory[data-beat="4"] .box.down polygon { stroke: var(--ink); stroke-dasharray: 2 2; }
.factory[data-beat="4"] .box.wip polygon { stroke: rgba(236,235,230,.6); }
.factory[data-beat="4"] .ripples { opacity: 1; }
.factory[data-beat="4"] .chain { opacity: 1; }
/* 5 Ser allt: öarna i accentfärg, systemen och maskinerna dras till hjärnan */
/* öarna börjar isär och glider ihop till en fabrik när intelligensen kopplar ihop dem */
.factory.merging { --sd: 2.6s; }
.factory[data-beat="5"] .zone-plate { transition: stroke 1.6s var(--ease), fill 1.6s var(--ease); }
.factory.merging[data-beat="5"] .zone-plate { stroke: rgba(var(--accent-rgb),.4); fill: rgba(var(--accent-rgb),.03); }
/* Sammanfogningen: skarvarna blixtrar till, en ram ritas runt fabriken och en våg går ut */
.fuse { pointer-events: none; }
.fuse-frame { fill: none; stroke: rgba(var(--accent-rgb), .9); stroke-width: 1.4; stroke-dasharray: 0 1; opacity: 0; }
.fuse-wave { fill: none; stroke: rgba(var(--accent-rgb), .6); stroke-width: 1.1; opacity: 0; transform-box: fill-box; transform-origin: center; }
.factory.fused .fuse-frame { animation: fuse-frame 4s cubic-bezier(.45,0,.25,1) forwards; }
.factory.fused .fuse-wave { animation: fuse-wave 3.8s cubic-bezier(.25,.6,.3,1) forwards; }
.factory.fused .zone-plate { animation: fuse-plate 3.6s cubic-bezier(.45,0,.25,1); }
@keyframes fuse-frame { 0% { stroke-dasharray: 0 1; opacity: .95; } 50% { stroke-dasharray: 1 0; opacity: .95; } 100% { stroke-dasharray: 1 0; opacity: 0; } }
@keyframes fuse-wave { 0% { transform: scale(.3); opacity: 0; } 15% { opacity: .8; } 100% { transform: scale(7); opacity: 0; } }
@keyframes fuse-plate { 0% { stroke: rgba(var(--accent-rgb), .4); } 35% { stroke: rgba(var(--accent-rgb), .85); fill: rgba(var(--accent-rgb), .08); } 100% { stroke: rgba(var(--accent-rgb), .4); fill: rgba(var(--accent-rgb), .03); } }

/* 6 Agerar: omdirigeringen och de nya tiderna, människorna lugnt i arbete */
.factory[data-beat="6"] .zone-plate { stroke: rgba(var(--accent-rgb),.22); }
.factory[data-beat="6"] .box polygon { stroke: rgba(236,235,230,.3); }
.factory[data-beat="6"] .person { opacity: .45; }
.factory[data-beat="6"] .box.machine:not(.down) polygon { stroke: rgba(236,235,230,.45); }

/* Systemen, länkarna och kedjan (fabriken idag) */
.links, .chain { opacity: 0; transition: opacity .6s var(--ease); }
.link { fill: none; stroke: rgba(236,235,230,.34); stroke-width: 1; }
.arc { fill: none; stroke: rgba(236,235,230,.6); stroke-width: 1.2; stroke-linecap: round; }
.link.manual, .arc.manual { stroke-dasharray: 3 4; }
.pulse { fill: var(--ink); }
.pulse-glow { fill: var(--ink); opacity: 0; }
.c-person { opacity: 0; transition: opacity .5s var(--ease); }
.c-person.on { opacity: 1; }
.f-sys { font-size: 12px; color: var(--ink); padding: 3px 9px 4px; border-radius: 4px; background: rgba(10,10,11,.86); border: 1px solid rgba(236,235,230,.3); display: inline-flex; gap: 6px; align-items: baseline; transition: color .6s, border-color .6s; }
.f-sys b { font-weight: 500; }
.f-sys span { color: var(--muted); font-size: 11.5px; }
.f-local { border-style: dashed; border-color: rgba(236,235,230,.4); color: var(--ink-2); }
.f-sys.is-ai { color: var(--accent); border-color: rgba(var(--accent-rgb),.45); }
.f-sys.is-ai span { color: rgba(var(--accent-rgb),.7); }
.f-role { font-size: 11.5px; color: var(--ink-2); }
.factory[data-beat="4"] .f-sys { border-color: rgba(236,235,230,.22); }

/* Bakgrundsord med tunn kontur (som hos Lusion) och hjärnans stoft i dem */
.sec--value { position: relative; }
.sec--value { overflow: hidden; }
.sec--value > .wrap { position: relative; z-index: 2; }
.bgwords { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.bgword { position: absolute; white-space: nowrap; font-size: clamp(190px, 25vw, 480px); font-weight: 500; line-height: 1; letter-spacing: -.025em;
  color: transparent; will-change: transform; }
/* Orden ritas i stoftets canvas (scenes.js): konturen tas från bokstävernas sammanslagna
   fyllning, så variabeltypsnittets överlappande delformer aldrig syns som rutor. */
.bgdust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }


/* Reglage för vätskan i bakgrundsorden (dolda, visas med ?tune) */
.fluid-tune { position: fixed; left: 16px; bottom: 16px; z-index: 60; width: 270px; padding: 14px 14px 12px; border-radius: 14px;
  background: rgba(14,14,13,.92); border: 1px solid rgba(236,235,230,.12); color: var(--ink-2); font: 12px/1.3 var(--sans);
  display: none; backdrop-filter: blur(8px); max-height: calc(100vh - 32px); overflow: auto; }
.fluid-tune.is-on { display: block; }
.fluid-tune b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 8px; }
.fluid-tune label { display: grid; grid-template-columns: 1fr 34px; gap: 2px 8px; margin: 7px 0; }
.fluid-tune input { grid-column: 1; width: 100%; accent-color: var(--accent); }
.fluid-tune span { grid-column: 2; grid-row: 1 / span 2; align-self: end; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.fluid-tune button { margin-top: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid rgba(236,235,230,.2); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.fluid-tune code { display: block; margin-top: 8px; font-size: 10.5px; color: var(--muted); word-break: break-word; }
