/* ==========================================================================
   Infviz – en datastory
   Ett fast datafält (field.js) bakom hela sidan formar om sig per kapitel.
   Skiffer + orange från varumärket, ljusa ytor i whiteboardglasets ton. Bara nudista.
   ========================================================================== */

:root {
  --ink: #2b3039;
  --ink-2: #353b45;
  --board: #eef2f0;
  --paper: #ffffff;
  --orange: #f58320;
  --orange-text: #b65708;
  --marker: #5b93cf;

  --text: #3b414b;
  --muted: #5f6672;
  --on-ink: #c9ced6;
  --on-ink-muted: #969daa;
  --rule: #d3dbd7;
  --rule-ink: #474e5a;

  --font: "nudista-web", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.3125rem;
  --t-lg: clamp(1.5rem, 2.4vw, 2rem);
  --t-xl: clamp(2.25rem, 4.6vw, 4rem);
  --t-display: clamp(2.75rem, 7vw, 6.5rem);

  --container: 1320px;
  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 76px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--font); font-weight: 400; font-size: var(--t-base); line-height: 1.6;
  color: var(--on-ink); background: var(--ink);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; color: #fff; font-weight: 300; line-height: 1.08; text-wrap: balance; }
h3 { font-size: var(--t-md); font-weight: 600; line-height: 1.3; }
p { margin: 0 0 1em; max-width: 60ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--orange); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .15s ease; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--orange); color: var(--ink); padding: 10px 16px; border-radius: var(--radius); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Datafältet ---------- */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .site-footer { position: relative; z-index: 1; }
/* Osynlig yta över diagrammen på pekskärmar: sidledsdrag visar värden, lodräta drag scrollar */
.field-hit { position: fixed; z-index: 2; display: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.hint-touch { display: none; }
@media (hover: none) { .hint-hover { display: none; } .hint-touch { display: inline; } }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 var(--t-sm)/1 var(--font); letter-spacing: .01em;
  padding: 15px 24px; border-radius: 999px; border: 1px solid var(--orange);
  background: var(--orange); color: var(--ink); text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: #ff9a45; border-color: #ff9a45; color: var(--ink); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: transparent; color: var(--orange); border-color: var(--orange); }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; transition: background-color .25s ease, backdrop-filter .25s ease; }
.site-header.is-scrolled { background: rgba(43, 48, 57, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.logo img { width: 124px; }
.nav { display: flex; align-items: center; gap: 36px; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav ul a { position: relative; display: block; padding: 8px 0; color: var(--on-ink); text-decoration: none; font-size: .9375rem; }
.nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: #fff; }
.nav ul a:hover::after, .nav ul a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { padding: 11px 18px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: #fff; cursor: pointer; }
.nav-toggle svg { width: 28px; height: 28px; display: block; }

/* ---------- Kapitel ---------- */
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: calc(var(--header-h) + 48px) 96px; }
.step__text { width: min(100%, 40vw); max-width: 560px; }
.step__text--wide { width: min(100%, 52vw); max-width: 820px; }
.step h1 { font-size: var(--t-display); letter-spacing: -0.035em; line-height: 1; }
.step h2 { font-size: var(--t-xl); letter-spacing: -0.025em; margin-bottom: 28px; }
.step h1, .step h2, .step p, .step li { text-shadow: 0 0 24px var(--ink), 0 0 8px var(--ink); }
.lead { font-size: var(--t-md); font-weight: 300; line-height: 1.5; color: var(--on-ink); }
.step .lead { margin-top: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero { position: relative; }

/* Tre styrkor */
.strengths { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: s; }
.strengths li { padding: 20px 0; border-top: 1px solid var(--rule-ink); }
.strengths h3 { margin-bottom: 6px; }
.strengths p { color: var(--on-ink-muted); font-size: .9375rem; }

/* Statistics Studio */
.ss-logo { width: 184px; margin-bottom: 32px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin: 36px 0 40px; }
.features h3 { font-size: 1rem; margin-bottom: 6px; }
.features p { font-size: .875rem; color: var(--on-ink-muted); line-height: 1.55; }


/* Jobba hos oss */
.kinds { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.kinds li { border: 1px solid var(--rule-ink); border-radius: 999px; padding: 6px 16px; font-size: var(--t-sm); color: #fff; }
.person { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 40px; padding: 22px; background: rgba(53, 59, 69, .88); border-radius: var(--radius); max-width: 460px; }
.person img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.person h3 { font-size: var(--t-md); }
.person__role { margin: 2px 0 8px; color: var(--on-ink-muted); font-size: var(--t-sm); }
.person__contact { margin: 0; line-height: 1.8; }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 460px)); gap: 20px; margin-top: 56px; }
.people .person { margin-top: 0; }

/* Citat (Om oss) */

/* Kontakt-kapitlet */







/* ---------- Kontaktkapitlet och sidfoten ---------- */
.site-footer { color: var(--on-ink); }
.site-footer > .container { padding-bottom: 32px; }
.step--contact { min-height: 90vh; min-height: 90svh; align-items: flex-end; padding-bottom: 48px; }
.site-footer__inner { width: 100%; }
.cta h2 { font-size: var(--t-xl); letter-spacing: -0.025em; margin-bottom: 20px; }
.cta__mail {
  display: inline-block; margin-top: 36px;
  font-size: clamp(2.25rem, 7.5vw, 6.5rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1;
  color: #fff; text-decoration: none; padding-bottom: 12px;
  background: linear-gradient(var(--orange), var(--orange)) 0 100% / 100% 3px no-repeat; transition: background-size .3s ease, color .2s ease;
}
.cta__mail:hover { background-size: 100% 100%; color: var(--ink); }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--rule-ink); }
.footer-cols span { display: block; color: var(--on-ink-muted); font-size: var(--t-sm); margin-bottom: 6px; }
.footer-cols a { font-size: var(--t-md); text-decoration: none; }
.copyright { margin: 40px 0 0; font-size: var(--t-sm); color: var(--on-ink-muted); max-width: none; }
.site-footer h2, .site-footer p { text-shadow: 0 0 24px var(--ink), 0 0 8px var(--ink); }

/* ---------- Kapitelrälsen (genereras av main.js) ---------- */
.rail { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; transition: opacity .2s ease; }
.rail.is-hidden { opacity: 0; pointer-events: none; }
.rail a { display: grid; place-items: center; width: 24px; height: 24px; }
.rail a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #59616e; transition: background-color .2s ease, transform .2s ease; }
.rail a:hover::before { background: #fff; }
.rail a[aria-current="true"]::before { background: var(--orange); transform: scale(1.5); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; border: 1px solid var(--rule-ink);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s, color .15s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { color: var(--orange); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Responsivt ---------- */
/* Under 900 px ligger formationen överst och texten i en panel nedanför. */
@media (max-width: 899px) {
  .step { align-items: flex-end; min-height: 125vh; min-height: 125svh; padding-top: 52svh; padding-bottom: 12svh; }
  .step__text, .step__text--wide { width: 100%; max-width: none; padding: 28px 24px; background: rgba(43, 48, 57, .8); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); border-radius: var(--radius); }
  .hero.step { min-height: 100svh; padding-top: 50svh; padding-bottom: 96px; }
  .hero .step__text { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
  .step--contact { min-height: 0; padding-top: 52svh; }
  .site-footer__inner { background: rgba(43, 48, 57, .8); padding: 28px 24px; border-radius: var(--radius); }
  .rail { display: none; }
  .features, .footer-cols, .people { grid-template-columns: 1fr; }
  .person { padding: 18px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 24px;
    background: var(--ink); padding: 8px var(--gutter) 32px; border-bottom: 1px solid var(--rule-ink); display: none; }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: 4px; width: 100%; }
  .nav ul a { font-size: var(--t-md); padding: 10px 0; }
  .site-header { background: rgba(43, 48, 57, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}

@media (max-width: 400px) {
  .person { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .person img { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ==========================================================================
   Extra allt
   ========================================================================== */

/* Sidbyten: headern står still, resten tonar över. Fältet fortsätter i field.js. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
.field { view-transition-name: field; }
::view-transition-old(field) { display: none; }
::view-transition-new(field) { animation: none; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

::selection { background: var(--orange); color: var(--ink); }
html { scrollbar-color: #4a515d var(--ink); }

/* Kapitlen växlar sida */
.step--flip .step__text { margin-left: auto; }

/* Diagramnotis i Statistics Studio-kapitlet */
.note { margin-top: 28px; padding: 16px 18px; border: 1px solid var(--rule-ink); border-radius: var(--radius); font-size: .875rem; color: var(--on-ink); background: rgba(43,48,57,.6); }
.note strong { color: #fff; font-weight: 600; }
.note a { white-space: nowrap; }

/* Introt: rubriken landar i takt med att datat ordnar sig (bara första besöket) */
@media (prefers-reduced-motion: no-preference) {
  .intro .hero .step__text > * { opacity: 0; transform: translateY(24px); animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; }
  .intro .hero .step__text > :nth-child(1) { animation-delay: .75s; }
  .intro .hero .step__text > :nth-child(2) { animation-delay: 1.0s; }
  .intro .hero .step__text > :nth-child(3) { animation-delay: 1.2s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }


/* Kopiera e-post */
.mail-row { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 28px; margin-top: 36px; }
.mail-row .cta__mail { margin-top: 0; }
.copy { display: inline-flex; align-items: center; gap: 8px; font: 400 var(--t-sm)/1 var(--font); color: var(--on-ink); background: none; border: 1px solid var(--rule-ink); border-radius: 999px; padding: 10px 16px; cursor: pointer; margin-bottom: 14px; transition: color .15s ease, border-color .15s ease; }
.copy:hover { color: #fff; border-color: var(--orange); }
.copy svg { width: 15px; height: 15px; }
.copy.is-done { color: var(--orange); border-color: var(--orange); }

/* Kapitelrälsen visar namnet vid hovring */
.rail a { position: relative; }
.rail__label { position: absolute; right: 30px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; font-size: .75rem; color: #fff; background: var(--ink-2); border: 1px solid var(--rule-ink); border-radius: 999px; padding: 5px 10px; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.rail a:hover .rail__label, .rail a:focus-visible .rail__label { opacity: 1; transform: translate(0, -50%); }


/* Utskrift: bara innehållet, svart på vitt */
@media print {
  .field, .field-hit, .rail, .to-top, .nav, .nav-toggle, .skip, .copy { display: none !important; }
  body { background: #fff; color: #000; }
  .step, .step--contact { min-height: 0; padding: 24px 0; display: block; }
  .step__text, .step__text--wide, .site-footer__inner { width: auto; max-width: none; background: none; padding: 0; }
  h1, h2, h3, .step p, .lead, .cta__mail { color: #000 !important; text-shadow: none !important; }
  .site-header { position: static; background: #2b3039; }
  a { color: #000; }
}


/* ---------- Helsidesbilder ----------
   Bilden syns först som ett raster av punkter. Punkterna växer när bilden scrollas mot mitten
   tills den står skarp, och krymper igen när den lämnar skärmen. main.js sätter --r och --s. */
.photo { --cell: 14px; position: relative; z-index: 1; margin: 0; height: 100vh; height: 100svh; min-height: 420px; overflow: hidden; background: var(--ink); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--s, 1)); transform-origin: var(--pos, 50% 50%); }
.photo.is-dotted img {
  -webkit-mask-image: radial-gradient(circle at center, #000 var(--r, 1px), transparent calc(var(--r, 1px) + .75px));
          mask-image: radial-gradient(circle at center, #000 var(--r, 1px), transparent calc(var(--r, 1px) + .75px));
  -webkit-mask-size: var(--cell) var(--cell); mask-size: var(--cell) var(--cell);
  -webkit-mask-position: center; mask-position: center;
}
@media (max-width: 899px) { .photo { height: 75svh; --cell: 10px; } }
@media (prefers-reduced-motion: reduce) { .photo.is-dotted img { -webkit-mask-image: none; mask-image: none; } .photo img { transform: none; } }
@media print { .photo { height: auto; } .photo img { position: static; height: auto; -webkit-mask-image: none !important; mask-image: none !important; transform: none; } }
