/* apparatus.no. Hvitt ark, tynn strek, mye luft. Den blå boksen fra logoen er eneste farge.
   Barlow ligger lokalt (ingen Google Fonts eller CDN). */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('fonter/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('fonter/barlow-latin-500-normal.woff2') format('woff2'); }

:root {
  --bla: #4faae8;          /* boksen i Apparatus-logoen */
  --papir: #ffffff;
  --blekk: #17191b;
  --dempet: #6a7178;
  --linje: #dfe3e6;
  --kant: clamp(1.25rem, 5vw, 4.5rem);
  --marg: 13rem;           /* venstre kolonne med seksjonsnavn */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --papir: #111315; --blekk: #eceef0; --dempet: #979fa6; --linje: #2b3035; }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papir); color: var(--blekk); font: 400 1.0625rem/1.65 'Barlow', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--bla); text-decoration-thickness: 1.5px; text-underline-offset: .28em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 2px solid var(--bla); outline-offset: 4px; border-radius: 2px; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0 0 1.1em; }
.hopp { position: absolute; left: -999px; top: 0; background: var(--blekk); color: var(--papir); padding: .6rem 1rem; z-index: 10; }
.hopp:focus { left: 0; }

.topp, .hero, .seksjon, .bunn { max-width: 84rem; margin: 0 auto; padding-left: var(--kant); padding-right: var(--kant); }

/* Topp */
.topp { display: flex; align-items: center; justify-content: space-between; gap: .75rem 2rem; flex-wrap: wrap; padding-top: 1.75rem; padding-bottom: 1.25rem; }
.logo { display: block; }
.logo img { height: 2.1rem; width: auto; }
.topp nav { display: flex; gap: clamp(.9rem, 2.6vw, 2.25rem); }
.topp nav a { text-decoration: none; font-size: .98rem; padding: .4rem 0; white-space: nowrap; }
.topp nav a:hover { text-decoration: underline; text-decoration-color: var(--bla); text-decoration-thickness: 1.5px; }
@media (max-width: 34rem) { .topp nav { width: 100%; justify-content: space-between; gap: .5rem; font-size: .92rem; } }

/* Hero: overskriften, streken og én setning */
.hero { padding-top: clamp(3.5rem, 11vw, 9rem); padding-bottom: clamp(4rem, 10vw, 8rem); }
h1 { font-size: clamp(2.9rem, 9.4vw, 8rem); line-height: .98; letter-spacing: -.035em; max-width: 11ch; text-wrap: balance; }
.strek { margin: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.strek svg { display: block; width: 100%; height: auto; overflow: visible; }
.strek path { fill: none; stroke: var(--blekk); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.strek rect { fill: var(--bla); transform-box: fill-box; transform-origin: center; }
.strek ol { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; justify-content: space-between; color: var(--dempet); font-size: .95rem; }
.strek li:last-child { color: var(--blekk); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .strek path { animation: tegn 2.6s cubic-bezier(.6, 0, .2, 1) .2s both; }
  .strek rect { animation: lande .5s cubic-bezier(.2, 1.4, .4, 1) 2.7s both; }
}
@keyframes tegn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lande { from { transform: scale(0); } to { transform: scale(1); } }
@media (max-width: 34rem) { .strek ol { font-size: .8rem; } }
.hero-bunn { margin-left: auto; max-width: 30rem; font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.5; }
.hero-bunn p:last-child { margin: 0; }

/* Rullescenen. Uten skript: fire ferdige tegninger på rad. Med skript (.js): scenen står fast mens man ruller,
   og public/side.js setter --t (strekene tegnes), --o (viskes ut) og formen på den blå boksen. */
.scene { max-width: 84rem; margin: 0 auto; padding: 0 var(--kant) clamp(3.5rem, 8vw, 7rem); }
.scene ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 2rem; }
.scene svg { display: block; width: 100%; height: auto; overflow: visible; }
.scene svg :is(path, rect, circle) { fill: none; stroke: var(--blekk); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.scene svg .pa { stroke: #fff; }
.scene svg :is(.kjerne, .kjerne-statisk) { fill: var(--bla); stroke: none; }
.kjerne-lag { display: none; }
.trinn-tekst h3 { font-size: 1.15rem; font-weight: 500; margin-bottom: .3rem; }
.trinn-tekst p { color: var(--dempet); margin: 0; }

.js .scene { max-width: none; padding: 0; height: calc(var(--n) * 62vh + 100vh); }
html.js .hero { padding-bottom: 1rem; }   /* scenen har egen luft over tegningen */
.js .scene-fast { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.js .scene ol { display: block; }
.js .trinn { position: absolute; inset: 0; max-width: 84rem; margin: 0 auto; padding: 0 var(--kant); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 2rem; }
.js .trinn svg { grid-column: 2; grid-row: 1; width: min(100%, 82vh); justify-self: center; opacity: var(--o, 1); }
.js li.trinn svg :is(path, rect, circle) { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--t, 0)); }
.js li.trinn { z-index: 1; }
.js .kjerne-statisk { display: none; }
.js .trinn-tekst { grid-column: 1; grid-row: 1; opacity: 0; transform: translateY(1rem); transition: opacity .45s, transform .45s; }
.js .trinn.aktiv .trinn-tekst { opacity: 1; transform: none; }
.js .trinn-tekst h3 { font-size: clamp(2.2rem, 5.2vw, 4.5rem); font-weight: 400; line-height: 1; letter-spacing: -.03em; margin-bottom: 1.25rem; }
.js .trinn-tekst p { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; max-width: 22em; }
@media (max-width: 52rem) {
  .js .trinn { grid-template-columns: 1fr; grid-template-rows: 56% auto; align-items: start; gap: 0; }
  .js .trinn svg { grid-column: 1; grid-row: 1; width: auto; height: 100%; max-width: 100%; align-self: center; }
  .js .trinn-tekst { grid-column: 1; grid-row: 2; padding-top: 1rem; }
}

/* Ordene i de store avsnittene tennes mens man ruller */
.js .ord { opacity: .22; transition: opacity .5s; }
.js .ord.pa { opacity: 1; }

/* Seksjoner: navnet i margen, innholdet i én spalte */
.seksjon { display: grid; grid-template-columns: var(--marg) minmax(0, 1fr); padding-top: clamp(3.5rem, 8vw, 7rem); padding-bottom: clamp(3.5rem, 8vw, 7rem); position: relative; }
.seksjon::before { content: ''; position: absolute; top: 0; left: var(--kant); right: var(--kant); border-top: 1px solid var(--linje); }
.seksjon h2 { font-size: 1rem; font-weight: 500; line-height: 1.65; padding-top: .55rem; }
.inni { max-width: 46rem; }
.inni > p { max-width: 36em; }
.inni > p.utsagn { font-size: clamp(1.5rem, 2.9vw, 2.3rem); line-height: 1.25; letter-spacing: -.015em; max-width: 24em; margin-bottom: 1.2em; text-wrap: pretty; }
.inni > h3 { font-size: 1rem; font-weight: 500; margin: 3rem 0 .75rem; }
.etter { margin-top: 2.5rem; }
@media (max-width: 52rem) {
  .seksjon { grid-template-columns: 1fr; gap: 1.25rem; }
  .seksjon h2 { padding-top: 0; color: var(--dempet); }
}

.punkter { list-style: none; margin: 0; padding: 0; columns: 2 18rem; column-gap: 3rem; color: var(--dempet); }
.punkter li { padding: .3rem 0; break-inside: avoid; }

/* Merkevarer */
.merke { margin-top: 3.5rem; display: grid; gap: 2rem clamp(2rem, 5vw, 4rem); align-items: center; }
.merke.med-bilde { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); }
@media (max-width: 40rem) { .merke.med-bilde { grid-template-columns: 1fr; } .merke-bilde { max-width: 14rem; } }
.merke + .merke { padding-top: 3.5rem; border-top: 1px solid var(--linje); }
.merke h3 { margin: 0 0 1.5rem; }
.merkelogo { height: 3.6rem; width: auto; filter: brightness(0); }
@media (prefers-color-scheme: dark) { .merkelogo { filter: brightness(0) invert(1); } }
.merke h3.merkenavn { font-size: 2rem; letter-spacing: -.02em; }
.merke p { max-width: 32em; }
.merke p.lenker { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: 1.5rem 0 0; }
.merke-bilde { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.insta { grid-column: 1 / -1; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.insta img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--linje); border-radius: 2px; }
.insta a:hover img { opacity: .8; }
@media (max-width: 40rem) { .insta { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Kontakt */
.stor-lenke { font-size: clamp(1.9rem, 6.4vw, 5rem); line-height: 1.1; letter-spacing: -.03em; text-decoration-thickness: 2px; text-underline-offset: .16em; overflow-wrap: anywhere; }
.stor-lenke:hover { text-decoration-thickness: 5px; }
#kontakt .inni { max-width: none; }
#kontakt .inni > p:first-child { margin-bottom: 2.25rem; max-width: none; }
.kontaktinfo { display: flex; flex-wrap: wrap; gap: 1rem clamp(2rem, 6vw, 5rem); margin-top: 3rem; color: var(--dempet); }
.kontaktinfo p { margin: 0; }
.kontaktinfo a { color: var(--blekk); }
address { font-style: normal; }

.bunn { padding-top: 1.5rem; padding-bottom: 2.5rem; color: var(--dempet); font-size: .92rem; }
