/* Layout: dark cobalt "stage" bands (header, heroes, process, footer) against cool paper content;
   the E-mark's floating core bar is the recurring motif. */
:root {
  --paper: #F4F5FA;
  --paper-2: #E9EBF4;
  --ink: #0B1236;
  --ink-2: #4A5170;
  --rule: #CDD1E1;
  --accent: #3355FF;
  --accent-ink: #FFFFFF;
  --stage: #0B1236;
  --stage-2: #121A48;
  --stage-fg: #F4F5FA;
  --stage-dim: #9BA3C9;
  --stage-rule: rgba(155, 163, 201, .22);
  --core: #6E86FF;
  --console: #070B22;
  --ok: #46D39A;
  --warn: #F2B84B;

  --f-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --s-xs: .8125rem; --s-sm: .9375rem; --s-md: 1.0625rem; --s-lg: 1.3125rem;
  --s-xl: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  --s-xxl: clamp(3rem, 1.2rem + 7vw, 7.25rem);
  --maxw: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1332; --paper-2: #121A42; --ink: #EEF0F9; --ink-2: #A9B0D2; --rule: #263063;
    --accent: #6E86FF; --accent-ink: #070B22; --stage: #060A1F; --stage-2: #0C1236;
    --stage-fg: #EEF0F9; --stage-dim: #8F97C0; --stage-rule: rgba(143, 151, 192, .2); --core: #7D93FF; --console: #03051A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1332; --paper-2: #121A42; --ink: #EEF0F9; --ink-2: #A9B0D2; --rule: #263063;
  --accent: #6E86FF; --accent-ink: #070B22; --stage: #060A1F; --stage-2: #0C1236;
  --stage-fg: #EEF0F9; --stage-dim: #8F97C0; --stage-rule: rgba(143, 151, 192, .2); --core: #7D93FF; --console: #03051A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: var(--s-md); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--stage); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.02; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap {
  max-width: var(--maxw); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

.label { font-family: var(--f-mono); font-size: var(--s-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.label.core { color: var(--accent); }
.stage .label { color: var(--stage-dim); }
.stage .label.core { color: var(--core); }

/* Logo */
.logo { display: block; height: 30px; width: auto; fill: currentColor; }
.logo .core { fill: var(--core); }

/* Stage = dark band */
.stage { background: var(--stage); color: var(--stage-fg); position: relative; overflow: hidden; }
.grid-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--stage-rule) 1px, transparent 1px), linear-gradient(90deg, var(--stage-rule) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.15));
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.15));
}
.grid-bg > * { position: relative; z-index: 1; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--stage); color: var(--stage-fg); border-bottom: 1px solid var(--stage-rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--stage-fg); }
.brand-sub { font-family: var(--f-mono); font-size: .625rem; color: var(--stage-dim); letter-spacing: .1em; text-transform: uppercase; padding-left: 14px; border-left: 1px solid var(--stage-rule); line-height: 1.3; }
@media (max-width: 520px) { .brand-sub { display: none; } }
.nav { display: flex; gap: 6px 26px; flex-wrap: wrap; align-items: center; font-size: var(--s-sm); }
.nav a { text-decoration: none; color: var(--stage-dim); padding: 6px 0; position: relative; }
.nav a:hover { color: var(--stage-fg); }
.nav a[aria-current="page"] { color: var(--stage-fg); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--core); }
.nav a.nav-cta { color: var(--accent-ink); background: var(--core); padding: 9px 14px; border-radius: 2px; font-weight: 600; }
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { filter: brightness(1.08); }
:root .nav a.nav-cta { color: #070B22; }

@media (max-width: 719px) { .site-header { position: static; } .nav { font-size: .875rem; gap: 6px 18px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer;
  font: 600 var(--s-md)/1 var(--f-body); padding: 17px 24px; border-radius: 2px; border: 1.5px solid currentColor;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn .arr { font-family: var(--f-mono); transition: transform .15s ease; }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stage .btn-primary { background: var(--core); border-color: var(--core); color: #070B22; }
.btn-ghost { background: transparent; color: inherit; border-color: var(--stage-rule); }
.btn-ghost:hover { border-color: currentColor; }

/* Hero */
.hero .wrap { padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 96px); display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1020px) { .hero .wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: end; gap: 56px; } }
.hero h1 { font-size: var(--s-xxl); font-weight: 800; letter-spacing: -0.045em; line-height: .95; }
.hero h1 .core { color: var(--core); display: inline-block; }
.hero .lede { margin-top: 28px; font-size: var(--s-lg); line-height: 1.5; color: var(--stage-dim); max-width: 48ch; }
.hero .actions { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mark { position: absolute; right: -6%; top: -10%; width: min(62vw, 760px); height: auto; opacity: .05; pointer-events: none; z-index: 0; }
.hero-mark polygon { fill: var(--stage-fg); }
.hero-mark rect { fill: none; }
.hero-mark .diag { fill: var(--core); }
@media (prefers-reduced-motion: no-preference) {
  .hero-mark rect { animation: core-in 1.1s cubic-bezier(.2,.7,.2,1) .15s both; }
  .hero h1 .core { animation: core-text 1s cubic-bezier(.2,.7,.2,1) .25s both; }
}
@keyframes core-in { from { transform: translateX(18%); } to { transform: none; } }
@keyframes core-text { from { transform: translateX(.4em); opacity: .4; } to { transform: none; opacity: 1; } }

/* Console */
.console { background: var(--console); color: #CFD6F5; border: 1px solid var(--stage-rule); border-radius: 4px; font-family: var(--f-mono); font-size: .75rem; line-height: 1.8; overflow: hidden; min-width: 0; }
.console-bar { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--stage-rule); color: var(--stage-dim); }
.console-bar .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 8px; vertical-align: 1px; animation: pulse 2s ease-in-out infinite; }
.console-body { padding: 12px 16px 14px; height: 16.2rem; overflow: hidden; }
.log-line { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; gap: 10px; white-space: nowrap; }
.log-line .t { color: #5F6893; }
.log-line .m { overflow: hidden; text-overflow: ellipsis; }
.log-line .s { color: var(--ok); }
.log-line .s.warn { color: var(--warn); }
.log-line.new { animation: drop .45s ease both; }
.console-foot { padding: 11px 16px; border-top: 1px solid var(--stage-rule); color: var(--stage-dim); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@keyframes drop { from { opacity: .2; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }

/* Platforms strip */
.platforms { background: var(--stage-2); color: var(--stage-dim); border-top: 1px solid var(--stage-rule); }
.platforms .wrap { padding-block: 18px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; font-family: var(--f-mono); font-size: var(--s-xs); letter-spacing: .06em; text-transform: uppercase; }
.platforms b { color: var(--stage-fg); font-weight: 500; }

/* Figures */
.figures .wrap { display: grid; grid-template-columns: minmax(0, 1fr); padding-block: 8px; }
@media (min-width: 641px) { .figures .wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fig { padding-block: 36px; padding-right: 20px; display: grid; gap: 6px; align-content: start; }
.fig + .fig { border-left: 1px solid var(--rule); padding-left: 28px; }
@media (max-width: 640px) { .fig + .fig { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); } }
.fig b { font-family: var(--f-display); font-size: clamp(3rem, 2rem + 3vw, 4.5rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.fig span { color: var(--ink-2); font-size: var(--s-sm); max-width: 22ch; }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 128px); }
.section-head { display: grid; gap: 18px; margin-bottom: 48px; max-width: 820px; }
.section-head h2 { font-size: var(--s-xl); font-weight: 800; }
.section-head p { color: var(--ink-2); font-size: var(--s-lg); line-height: 1.5; max-width: 56ch; }
.stage .section-head p { color: var(--stage-dim); }
.alt { background: var(--paper-2); }
.split-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 48px; }
.split-head .section-head { margin-bottom: 0; }

/* Service rows */
.svc-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.svc a { display: grid; gap: 10px 40px; padding: 30px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; grid-template-columns: minmax(0, 1fr); transition: background .2s ease, color .2s ease, padding .2s ease; }
@media (min-width: 900px) { .svc a { grid-template-columns: 6rem minmax(0, 1.05fr) minmax(0, 1.2fr) 2.5rem; align-items: center; } }
.svc .num { font-family: var(--f-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.04em; color: var(--accent); line-height: 1; }
.svc h3 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem); font-weight: 800; }
.svc p { color: var(--ink-2); }
.svc .go { font-family: var(--f-mono); font-size: 1.25rem; color: var(--accent); justify-self: end; }
@media (hover: hover) and (min-width: 900px) {
  .svc a:hover { background: var(--accent); color: var(--accent-ink); padding-inline: 20px; }
  .svc a:hover .num, .svc a:hover p, .svc a:hover .go { color: var(--accent-ink); }
}

/* Detailed service blocks */
.svc-detail { display: grid; gap: 28px 64px; padding-block: 56px; border-top: 1px solid var(--rule); grid-template-columns: minmax(0, 1fr); scroll-margin-top: 100px; }
@media (min-width: 940px) { .svc-detail { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); } }
.svc-detail:first-of-type { border-top: 2px solid var(--ink); }
.svc-detail .num { font-family: var(--f-display); font-weight: 800; font-size: clamp(3rem, 2rem + 3vw, 5rem); color: var(--accent); letter-spacing: -0.05em; line-height: .9; }
.svc-detail h2 { font-size: var(--s-xl); font-weight: 800; margin-top: 18px; }
.svc-detail .intro { color: var(--ink-2); margin-top: 18px; max-width: 48ch; font-size: var(--s-lg); line-height: 1.5; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; }
.ticks li { padding: 14px 0 14px 30px; border-bottom: 1px solid var(--rule); position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 6px; margin-top: -3px; background: var(--accent); }
.stage .ticks li { border-color: var(--stage-rule); }
.stage .ticks li::before { background: var(--core); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip { font-family: var(--f-mono); font-size: .75rem; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-2); background: var(--paper); }
.stage .chip { background: transparent; border-color: var(--stage-rule); color: var(--stage-dim); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.jump a { font-family: var(--f-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: 8px 12px; border: 1px solid var(--stage-rule); color: var(--stage-dim); border-radius: 2px; }
.jump a:hover { color: var(--stage-fg); border-color: var(--core); }

/* Process */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--stage-rule); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.step { padding: 32px 28px 36px 0; display: grid; gap: 14px; align-content: start; border-bottom: 1px solid var(--stage-rule); }
@media (min-width: 900px) { .step { border-bottom: 0; } .step + .step { border-left: 1px solid var(--stage-rule); padding-left: 28px; } }
.step .n { font-family: var(--f-display); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: -0.05em; color: var(--core); }
.step h3 { font-size: 1.5rem; }
.step p { color: var(--stage-dim); font-size: var(--s-sm); }

/* Case study */
.case { display: grid; gap: 40px 64px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 940px) { .case { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.case h2 { font-size: var(--s-xl); font-weight: 800; }
.case-body { display: grid; gap: 20px; }
.case-body h3 { font-size: var(--s-xs); font-family: var(--f-mono); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.case-body p { max-width: 62ch; }
.link-arrow { color: var(--accent); font-weight: 600; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* Flow diagram */
.flow { overflow-x: auto; border: 1px solid var(--rule); background: var(--paper); padding: 16px; border-radius: 3px; }
.flow svg { display: block; min-width: 520px; width: 100%; height: auto; }
.flow .box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.flow .box.src { fill: var(--accent); stroke: var(--accent); }
.flow .tx { fill: var(--ink); font-family: var(--f-mono); font-size: 12px; font-weight: 500; }
.flow .tx.inv { fill: var(--accent-ink); }
.flow .sub { fill: var(--ink-2); font-family: var(--f-body); font-size: 11px; }
.flow .ln { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.flow .ln.no { stroke: var(--ink-2); stroke-dasharray: 4 4; }
.flow .head { fill: var(--ink); }

/* Tools / principles grid */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.tile { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; align-content: start; }
.tile h3 { font-size: 1.5rem; }
.tile p { color: var(--ink-2); font-size: var(--s-sm); }
.tile .bar { width: 28px; height: 8px; background: var(--accent); }

/* About */
.prose { max-width: 68ch; display: grid; gap: 20px; }
.prose .big { font-family: var(--f-display); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
.registry { font-family: var(--f-mono); font-size: var(--s-sm); display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 28px; border-top: 2px solid var(--ink); padding-top: 22px; }
.registry dt { color: var(--ink-2); }
.registry dd { margin: 0; }

/* Contact */
.contact-grid { display: grid; gap: 56px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 940px) { .contact-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
form { display: grid; gap: 22px; padding: clamp(20px, 3vw, 36px); background: var(--paper-2); border-top: 4px solid var(--accent); }
.field { display: grid; gap: 6px; }
.field label, fieldset legend { font-size: var(--s-sm); font-weight: 600; }
input[type=text], input[type=email], textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-bottom: 2px solid var(--ink);
  border-radius: 2px; padding: 13px 14px; width: 100%;
}
textarea { min-height: 150px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check span { display: inline-block; padding: 9px 13px; border: 1px solid var(--rule); border-radius: 2px; font-size: var(--s-sm); cursor: pointer; background: var(--paper); }
.check input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-note { font-size: var(--s-sm); color: var(--ink-2); }
.form-done { padding: 16px 18px; border-left: 4px solid var(--accent); background: var(--paper); }
.contact-facts { display: grid; gap: 28px; align-content: start; }
.contact-facts .big { font-family: var(--f-display); font-weight: 700; font-size: var(--s-lg); margin-top: 6px; user-select: all; overflow-wrap: anywhere; }
.contact-facts .addr { font-family: var(--f-mono); font-size: var(--s-sm); line-height: 1.8; margin-top: 6px; }

/* Page head (inner pages) */
.page-head .wrap { padding-block: clamp(56px, 8vw, 112px) clamp(48px, 6vw, 80px); }
.page-head h1 { font-size: clamp(2.5rem, 1.2rem + 5vw, 5.5rem); font-weight: 800; letter-spacing: -0.045em; line-height: .96; max-width: 16ch; margin-top: 18px; }
.page-head h1 .core { color: var(--core); }
.page-head p.lede { margin-top: 24px; font-size: var(--s-lg); color: var(--stage-dim); max-width: 56ch; line-height: 1.5; }

/* CTA band */
.cta-band { background: var(--accent); color: var(--accent-ink); }
.cta-band .wrap { padding-block: clamp(56px, 8vw, 104px); display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: end; justify-content: space-between; }
.cta-band h2 { font-size: var(--s-xl); font-weight: 800; max-width: 18ch; }
.cta-band .btn { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }

/* Footer */
.site-footer { background: var(--stage); color: var(--stage-dim); font-size: var(--s-sm); }
.site-footer .wrap { padding-block: 56px 40px; display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 840px) { .site-footer .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr); } }
.site-footer .logo { height: 40px; color: var(--stage-fg); }
.site-footer .legal { font-family: var(--f-mono); font-size: .75rem; line-height: 1.85; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--stage-fg); }
.site-footer a:hover { color: var(--core); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
