/* Ziffran Redovisning */

@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url("../fonts/roboto-mono.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }

:root {
  --red: #ee3a41;
  --orange: #fbaf2e;
  --grey: #d1d2d4;
  --ink: #3d3e40;
  --muted: #8e8f92;
  --line: #e4e5e6;
  --head: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Times New Roman", Times, "Liberation Serif", serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  --g: clamp(20px, 5vw, 72px);
  --max: 1160px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #ffffff; color-scheme: light only; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 19px/1.6 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; font: 13px var(--mono); }
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--g); }

/* ---------- Sidhuvud ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .4s ease; }
.header.scrolled { border-bottom-color: var(--line); }
.header__in { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.logo { display: block; width: 52px; flex: none; }
.logo img { width: 100%; }
.nav { display: flex; gap: 34px; font: 400 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.nav a { color: var(--ink); padding: 8px 0; transition: color .25s ease; }
.nav a:hover { color: var(--orange); }
.nav a[aria-current="page"] { color: var(--red); }

/* ---------- Typografi ---------- */
.label { display: block; font: 400 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h1 { font: 500 clamp(44px, 6.6vw, 96px)/1.02 var(--head); color: var(--red); letter-spacing: -.005em; }
.h2 { font: 500 clamp(32px, 3.6vw, 50px)/1.1 var(--head); color: var(--red); letter-spacing: -.005em; }
.h3 { font: 500 clamp(24px, 2vw, 29px)/1.2 var(--head); color: var(--orange); }
.lead { font-size: clamp(19px, 1.5vw, 21px); line-height: 1.6; max-width: 34em; }
.mono { font-family: var(--mono); }

/* ---------- Startsidans inledning ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; display: grid; place-items: center; text-align: center; padding: 84px var(--g) 60px; }
.hero__stage { position: relative; display: grid; place-items: center; }
.reels { display: flex; gap: .04em; font: 300 clamp(76px, 15vw, 210px)/1 var(--mono); color: #b9babd; font-variant-numeric: tabular-nums; }
.reel { position: relative; height: 1em; width: .62em; overflow: hidden; }
.reel__strip { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; }
.reel__strip span { height: 1em; line-height: 1; }
.title { position: absolute; inset: 0; display: grid; place-content: center; gap: .02em; font: 500 clamp(52px, 9.4vw, 140px)/.98 var(--head); letter-spacing: -.005em; }
.title span { display: block; }
.title .t1 { color: var(--red); }
.title .t2 { color: var(--orange); }
.hero__sub { margin-top: clamp(26px, 4vh, 44px); font: 400 12.5px/1.8 var(--mono); letter-spacing: .04em; color: var(--muted); }

/* sekvens */
.reels, .title span, .hero__sub, .hero__cue { transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.js .title span { opacity: 0; transform: translateY(26px); }
.js .hero__sub, .js .hero__cue { opacity: 0; }
.js .is-home .header { opacity: 0; transition: opacity 1s ease, border-color .4s ease; }
.done .reels { opacity: 0; transform: translateY(-22px); }
.done .title span { opacity: 1; transform: none; }
.done .title .t2 { transition-delay: .12s; }
.done .hero__sub { opacity: 1; transition-delay: .7s; }
.done .hero__cue { opacity: 1; }
.ready .is-home .header { opacity: 1; }
.hero__cue { position: absolute; left: 50%; bottom: 26px; width: 16px; height: 56px; margin-left: -8px; color: var(--ink); }
.hero__cue svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; animation: bob 2.8s ease-in-out 3.6s infinite; }
.hero__cue .stem { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hero__cue .head { opacity: 0; }
.hero__cue .stem { stroke-dasharray: 52; stroke-dashoffset: 52; transition: stroke-dashoffset 1s cubic-bezier(.65, 0, .25, 1) 1.3s; }
.hero__cue .head { transition: opacity .5s ease 2.1s, color .3s; }
.done .hero__cue .stem { stroke-dashoffset: 0; }
.done .hero__cue .head { opacity: 1; }
.hero__cue:hover { color: var(--orange); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Sektioner ---------- */
.sec { padding: clamp(96px, 12vw, 160px) 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.cols--solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.cols .h2 { max-width: 15em; }
.cols .lead + .lead { margin-top: 1em; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; gap: 28px; } }

.pagehead { padding: clamp(160px, 18vw, 230px) 0 clamp(60px, 7vw, 100px); }
.pagehead .label { margin-bottom: 22px; }

/* Listor (klienter, tjänster) */
.list { border-top: 1px solid var(--ink); }
.item { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 30px 0 32px; align-items: baseline; }
.item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); transform-origin: left; }
.item__no { font: 400 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.item p { max-width: 32em; }
.list__total { height: 5px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-top: 3px; transform-origin: right; }
@media (max-width: 720px) {
  .item { grid-template-columns: 44px minmax(0, 1fr); row-gap: 8px; }
  .item p { grid-column: 2; }
}

/* Historia: årtal */
.years { display: flex; align-items: baseline; gap: .35em; font: 300 clamp(48px, 8vw, 110px)/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.years .sep { color: var(--grey); }
.years .now { color: var(--red); }

/* Kontakt */
.offices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); border-top: 1px solid var(--ink); padding-top: 34px; }
.office .h3 { margin-bottom: 14px; }
.office p { font: 400 15px/1.85 var(--mono); }
.office a { color: var(--orange); transition: color .25s ease; }
.office a:hover { color: var(--red); }
@media (max-width: 640px) { .offices { grid-template-columns: 1fr; } }

/* ---------- Sidfot ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; font: 400 12px/1.6 var(--mono); color: var(--muted); }
.footer__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .srf { width: 140px; }

/* ---------- Minimalistiska animationer per textdel ---------- */
.a-fade, .a-line, .a-rule { transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .a-fade { opacity: 0; transform: translateY(14px); }
.js .in .a-fade, .js .a-fade.in { opacity: 1; transform: none; }
.js .in .a-fade.d1 { transition-delay: .12s; } .js .in .a-fade.d2 { transition-delay: .24s; } .js .in .a-fade.d3 { transition-delay: .36s; }
/* linje som dras ut */
.js .a-rule { transform: scaleX(0); transform-origin: left; transition: transform 1.2s cubic-bezier(.65, 0, .25, 1); }
.js .in .a-rule, .js .a-rule.in { transform: scaleX(1); }
/* listrader: en i taget, med strecket under */
.js .item > * { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .item::after { transform: scaleX(0); transition: transform 1s cubic-bezier(.65, 0, .25, 1); }
.js .item.in > * { opacity: 1; transform: none; }
.js .item.in::after { transform: scaleX(1); }
.js .item.in > :nth-child(2) { transition-delay: .08s; } .js .item.in > :nth-child(3) { transition-delay: .16s; }
.js .list__total { transform: scaleX(0); transition: transform 1.1s cubic-bezier(.65, 0, .25, 1) .2s; }
.js .list__total.in { transform: scaleX(1); }
/* rader i kontaktuppgifter skrivs ut */
.js .type { visibility: hidden; }

@media (max-width: 600px) {
  .header__in { height: 68px; }
  .logo { width: 42px; }
  .nav { gap: 14px; font-size: 10.5px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  .js .a-fade, .js .a-rule, .js .item > *, .js .item::after, .js .list__total, .js .title span, .js .hero__sub, .js .hero__cue, .js .is-home .header { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reels { display: none; }
  .js .type { visibility: visible; }
  .hero__cue svg { animation: none; } .hero__cue .stem { stroke-dashoffset: 0 !important; } .hero__cue .head { opacity: 1 !important; }
}

.hero > div { width: 100%; }
.hero__stage { width: 100%; min-height: calc(clamp(52px, 9.4vw, 140px) * 2.02); }
.reels { transition: opacity .45s ease, transform .6s var(--ease); }
.done .title .t1 { transition-delay: .3s; } .done .title .t2 { transition-delay: .42s; }
.cols--solo { gap: 0; }
@media (max-width: 600px) {
  .title { font-size: 14.5vw; }
  .hero__stage { min-height: calc(14.5vw * 2.1); }
  .reels { font-size: 21vw; }
  .hero__sub { font-size: 11px; max-width: 26em; margin-left: auto; margin-right: auto; }
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Text under räkneverket */
.count { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.4vh, 26px); transition: opacity .45s ease, transform .6s var(--ease); }
.count .reels { transition: none; }
.count__cap { font: 400 clamp(12px, 1.25vw, 17px)/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.js .count__cap { opacity: 0; transform: translateY(8px); transition: opacity .8s ease .15s, transform .8s var(--ease) .15s; }
.counting .count__cap { opacity: 1; transform: none; }
.done .count { opacity: 0; transform: translateY(-22px); }
.done .reels { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .count { display: none; } }

/* Listor utan nummer */
.item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 720px) { .item { grid-template-columns: minmax(0, 1fr); row-gap: 8px; } .item p { grid-column: 1; } }
.js .item.in > :nth-child(2) { transition-delay: .1s; }

/* Bakgrund: rullande siffror med transparens */
.bgdigits { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
