/* OBS Technology: layout and components. Colours, fonts and spacing come from tokens.css. */

*,
*::before,
*::after { box-sizing: border-box; }

/* scroll-padding-top: a jump to an anchor or a focused field stops under the fixed header, not behind it */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topp) + 1rem); }

body {
  margin: 0;
  font-family: var(--font-tekst);
  font-size: var(--tekst);
  line-height: var(--linjehoyde);
  color: var(--blekk);
  background: var(--skum);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ramme {
  width: 100%;
  max-width: calc(var(--ramme) + 2 * var(--marg));
  margin-inline: auto;
  padding-inline: var(--marg);
}

.skjult-visuelt {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hopp {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 60;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--hvit);
  color: var(--blekk);
}
.hopp:focus { top: 1rem; }

/* Focus ring: ocean blue on the light surfaces, aqua on the dark and blue ones,
   so it keeps at least 3:1 against what lies under it (WCAG 1.4.11). */
:focus-visible {
  outline: 3px solid var(--ring, var(--hav));
  outline-offset: 3px;
  border-radius: 4px;
}
.hopp,
.topp,
.mobilmeny,
[data-flate="foto"],
[data-flate="natt"],
[data-flate="marine"],
[data-flate="hav"],
.katalog { --ring: var(--aksent); }
/* the white panels that sit inside the dark ones go back to ocean blue */
.nedtrekk,
.grupper__liste { --ring: var(--hav); }
/* the strip clips what lies outside it (overflow: hidden), so its ring is drawn inside the link */
.gruppe a:focus-visible { outline-offset: -4px; }

/* ---------- Header ---------- */

.topp {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--topp);
  color: var(--tekst-lys);
}
.topp::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--natt);
  opacity: 0;
  transition: opacity 0.3s var(--lett);
}
.topp.er-fast::before { opacity: 0.96; }
/* without JavaScript nothing switches the ground on while scrolling, and over the open phone menu the bar must not show the page */
html:not(.js) .topp::before,
html.meny-apen .topp::before { opacity: 0.96; }

.topp__rad {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.logo { display: inline-flex; flex: none; }
.logo img { width: auto; height: 2.875rem; }

.meny {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.meny__punkt { position: relative; }

.meny__lenke {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: var(--radius-pille);
  background: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--tekst-lys);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--lett);
}
.meny__lenke:hover,
.meny__punkt:focus-within > .meny__lenke,
.meny__lenke[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }

.meny__pil {
  width: 0.7rem; height: 0.7rem;
  transition: transform 0.25s var(--lett);
}
.meny__lenke[aria-expanded="true"] .meny__pil,
.meny__punkt--ned:hover .meny__pil { transform: rotate(180deg); }

/* Product dropdown: every group with its products */
.nedtrekk {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  width: min(61rem, calc(100vw - 2 * var(--marg)));
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--hvit);
  color: var(--blekk);
  box-shadow: var(--skygge-kort);
  transform: translate(-42%, 0.4rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--lett), transform 0.2s var(--lett), visibility 0s linear 0.2s;
}
/* invisible bridge so the pointer can travel from the word to the panel */
.nedtrekk::before {
  content: "";
  position: absolute;
  inset: -0.7rem 0 auto 0;
  height: 0.7rem;
}
.meny__punkt--ned:hover > .nedtrekk,
.meny__punkt--ned:focus-within > .nedtrekk,
.meny__lenke[aria-expanded="true"] + .nedtrekk {
  opacity: 1;
  visibility: visible;
  transform: translate(-42%, 0);
  transition-delay: 0s;
}
.meny__punkt--ned.er-lukket > .nedtrekk {
  opacity: 0;
  visibility: hidden;
}

.nedtrekk__grupper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0; padding: 0;
  list-style: none;
}
.nedtrekk__gruppe + .nedtrekk__gruppe {
  padding-left: 1.25rem;
  border-left: 1px solid var(--linje);
}
.nedtrekk__tittel {
  display: block;
  text-decoration: none;
}
.nedtrekk__tittel:hover .gruppenavn { color: var(--aksent-dyp); }
.kode {
  display: block;
  font-family: var(--font-kode);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--aksent-dyp);
}
.gruppenavn {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  transition: color 0.2s var(--lett);
}
.nedtrekk__produkter {
  margin: 0.75rem 0 0; padding: 0.75rem 0 0;
  border-top: 1px solid var(--linje);
  list-style: none;
}
.nedtrekk__produkter a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.9375rem;
  color: var(--dis);
  text-decoration: none;
}
.nedtrekk__produkter a:hover { color: var(--blekk); text-decoration: underline; }
.nedtrekk__fot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--linje);
  font-size: 0.9375rem;
}
.nedtrekk__fot a { font-weight: 600; color: var(--hav); text-decoration: none; }
.nedtrekk__fot a:hover { text-decoration: underline; }

.topp__verktoy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.sprak {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--linje-lys);
  border-radius: var(--radius-pille);
  font-family: var(--font-kode);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.62);
}
.sprak__aktiv { color: var(--tekst-lys); }
.sprak__skille { opacity: 0.5; }
.sprak:hover { border-color: var(--tekst-lys); color: var(--tekst-lys); }

.knapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.375rem;
  padding: 0.8rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pille);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--lett), border-color 0.2s var(--lett), transform 0.2s var(--lett);
}
.knapp svg { width: 1.1rem; height: 1.1rem; flex: none; transition: transform 0.25s var(--lett); }
.knapp--fylt { background: var(--aksent); color: var(--natt); }
.knapp--fylt:hover { background: var(--aksent-sterk); }
.knapp--fylt:hover svg { transform: translateX(0.25rem); }
.knapp--omriss { border-color: rgba(255, 255, 255, 0.55); color: var(--tekst-lys); }
.knapp--omriss:hover { border-color: var(--tekst-lys); background: rgba(255, 255, 255, 0.1); }
.knapp--omriss:hover svg { transform: translateY(0.15rem); }
.knapp--liten { min-height: 2.75rem; padding: 0.55rem 1.15rem; font-size: 1rem; }
.knapp__merke {
  font-family: var(--font-kode);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.topp__kontakt { display: none; }

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.34rem;
  width: 2.875rem; height: 2.875rem;
  padding: 0 0.7rem;
  border: 1px solid var(--linje-lys);
  border-radius: var(--radius-pille);
  background: none;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--tekst-lys);
  transition: transform 0.25s var(--lett), opacity 0.2s var(--lett);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.46rem) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-0.46rem) rotate(-45deg); }
html:not(.js) .burger { display: none; }

/* Phone menu */
.mobilmeny {
  position: fixed;
  inset: var(--topp) 0 0 0;
  z-index: 49;
  overflow-y: auto;
  padding: 1rem var(--marg) 2.5rem;
  background: var(--natt);
  color: var(--tekst-lys);
}
.mobilmeny__liste { margin: 0; padding: 0; list-style: none; }
.mobilmeny__liste > li { border-bottom: 1px solid var(--linje-lys); }
.mobilmeny__liste > li > a,
.mobilmeny summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.mobilmeny summary::-webkit-details-marker { display: none; }
.mobilmeny summary svg { width: 0.9rem; height: 0.9rem; transition: transform 0.25s var(--lett); }
.mobilmeny details[open] summary svg { transform: rotate(180deg); }
.mobilmeny__grupper { margin: 0; padding: 0 0 1rem; list-style: none; }
.mobilmeny__grupper a {
  display: block;
  padding: 0.6rem 0;
  text-decoration: none;
}
.mobilmeny__grupper .kode { color: var(--aksent); }
/* A group: the name goes to the group page, the arrow beside it opens the products below */
.mobilmeny__grupperad {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mobilmeny__grupperad > a { flex: 1 1 auto; min-width: 0; }
.mobilmeny__vis {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;          /* 44 x 44 px touch target */
  padding: 0;
  border: 1px solid var(--linje-lys);
  border-radius: var(--radius-pille);
  background: none;
  color: var(--tekst-lys);
  cursor: pointer;
}
.mobilmeny__vis svg { width: 0.8rem; height: 0.8rem; transition: transform 0.25s var(--lett); }
.mobilmeny__vis[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.mobilmeny__vis[aria-expanded="true"] svg { transform: rotate(180deg); }
.mobilmeny__produkter {
  margin: 0 0 0.5rem 0.15rem;
  padding: 0 0 0 1rem;
  list-style: none;
  border-left: 1px solid var(--linje-lys);
}
.mobilmeny__produkter a {
  padding: 0.55rem 0;
  font-size: var(--tekst);
  color: var(--tekst-lys-dempet);
}
.mobilmeny__produkter a:hover { color: var(--tekst-lys); }
/* with JavaScript a group's products stay hidden until its arrow opens them */
html.js .mobilmeny__gruppe:not(.er-apen) .mobilmeny__produkter { display: none; }
html.js .mobilmeny__gruppe.er-apen .mobilmeny__produkter { animation: mm-inn 0.22s var(--lett); }
@keyframes mm-inn {
  from { opacity: 0; transform: translateY(-0.35rem); }
}
/* without JavaScript there is nothing to open: the lists stand open and the arrows are gone */
html:not(.js) .mobilmeny__vis { display: none; }
.mobilmeny .knapp { width: 100%; margin-top: 1.5rem; }
/* with JavaScript the phone menu is closed until the button opens it */
html.js .mobilmeny { display: none; }
html.js .mobilmeny.er-apen { display: block; }
html.meny-apen { overflow: hidden; }
/* without JavaScript the phone menu is a plain list at the bottom of the page */
html:not(.js) .mobilmeny { position: static; inset: auto; }

@media (min-width: 1024px) {
  .meny { display: flex; }
  .topp__verktoy { margin-left: 0.5rem; }
  .topp__kontakt { display: inline-flex; }
  .burger { display: none; }
  .mobilmeny { display: none !important; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--topp);
  overflow: hidden;
  background: var(--natt);
  color: var(--tekst-lys);
}

.hero__bilde,
.hero__farge,
.hero__slor {
  position: absolute;
  inset: 0;
  z-index: -1;
}
/* Multiplies the photo with blue, so bright water turns deep blue, never grey.
   Must stay a direct child of .hero, after .hero__bilde in the DOM (blend order). */
.hero__farge {
  mix-blend-mode: multiply;
  background:
    linear-gradient(180deg, rgb(var(--dyp-rgb)) 0%, rgba(var(--dyp-rgb), 0) 30%),
    linear-gradient(90deg, rgb(var(--dyp-rgb)) 0%, rgb(var(--dyp-rgb)) 30%, #ffffff 82%);
}
.hero__bilde { overflow: hidden; }
/* The water floats: the photo drifts sideways and breathes in and out, slowly, on two
   rhythms that never line up. Only transforms, so it runs on the compositor. */
.hero__flyt,
.hero__flyt-indre {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.hero__flyt { animation: hero-flyt 15s ease-in-out infinite alternate; }
.hero__flyt-indre {
  transform: scale(1.07);
  transform-origin: 62% 45%;
  animation: hero-pust 11s ease-in-out infinite alternate;
}
@keyframes hero-flyt {
  from { transform: translate3d(-1.8%, -0.8%, 0); }
  to { transform: translate3d(1.8%, 1.1%, 0); }
}
@keyframes hero-pust {
  from { transform: scale(1.07); }
  to { transform: scale(1.135); }
}
/* out of view, or a machine that cannot keep up: the photo rests */
.hero.er-ute .hero__flyt,
.hero.er-ute .hero__flyt-indre,
.hero.er-treg .hero__flyt,
.hero.er-treg .hero__flyt-indre { animation-play-state: paused; }

.hero__foto {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 62% 0%;   /* hero-liv.js reads this to find the sun */
  filter: saturate(1.12) brightness(1.1);
}
/* The living light: sun shafts and rising specks, drawn by js/hero-liv.js.
   Sits inside .hero__bilde, so the blue colour layer and the scrim tone it down on the text side. */
.hero__liv {
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--lett);
}
.hero__liv.er-klar { opacity: 1; }

.hero__slor {
  background:
    linear-gradient(90deg,
      rgba(var(--natt-rgb), 0.82) 0%,
      rgba(var(--natt-rgb), 0.62) 28%,
      rgba(var(--natt-rgb), 0.2) 52%,
      rgba(var(--natt-rgb), 0) 70%),
    linear-gradient(180deg,
      rgba(var(--natt-rgb), 0) 0%,
      rgba(var(--natt-rgb), 0) 58%,
      rgba(var(--natt-rgb), 0.88) 100%);
}

.hero__innhold {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(1.5rem, 4.5vh, 3.5rem) clamp(1.25rem, 3.5vh, 2.5rem);
}
.hero__tekst { max-width: 44rem; }

.merke {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 clamp(0.75rem, 2vh, 1.25rem);
  font-family: var(--font-kode);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aksent);
}
.merke::before {
  content: "";
  width: 2.25rem; height: 2px;
  background: var(--aksent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-tittel);
  font-size: clamp(2.25rem, min(5.1vw, 9.3vh), 4.5rem);
  font-weight: var(--vekt-tittel);
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.hero__tekst { min-width: 0; }
.hero__innhold { min-width: 0; }
.hero h1 .lett {
  display: block;
  font-weight: var(--vekt-tittel-lett);
  color: var(--aksent-sterk);
}

.hero__ingress {
  max-width: 35rem;
  margin: clamp(1rem, 2.6vh, 1.5rem) 0 0;
  font-size: var(--tekst-stor);
  color: var(--tekst-lys-dempet);
}

.hero__knapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.25rem, 3.2vh, 2rem);
}

.bevis {
  display: grid;
  gap: 0.75rem 0;
  margin: clamp(1.25rem, 3.4vh, 2.25rem) 0 0;
  padding: 0;
  list-style: none;
}
.bevis li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
}
.bevis svg {
  flex: none;
  width: 1.6rem; height: 1.6rem;
  color: var(--aksent);
}

/* The white strip at the foot of the hero: the five product groups */
.grupper { padding-bottom: clamp(1rem, 3.4vh, 1.75rem); }
.grupper__liste {
  display: grid;
  margin: 0; padding: 0;
  border-radius: var(--radius);
  background: var(--hvit);
  color: var(--blekk);
  box-shadow: var(--skygge-kort);
  list-style: none;
  overflow: hidden;
}
.gruppe + .gruppe { border-top: 1px solid var(--linje); }
.gruppe a {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 0.75rem 1rem;
  text-decoration: none;
  transition: background-color 0.2s var(--lett);
}
.gruppe a:hover { background: var(--skum); }
.gruppe a > span { min-width: 0; }
.gruppe .gruppenavn { overflow-wrap: anywhere; }
.gruppe__bilde {
  width: 100%;
  height: 3.75rem;
  object-fit: contain;
  transition: transform 0.35s var(--lett);
}
.gruppe a:hover .gruppe__bilde { transform: scale(1.06); }
.gruppe__pil {
  width: 1.1rem; height: 1.1rem;
  color: var(--aksent-dyp);
  transition: transform 0.25s var(--lett);
}
.gruppe a:hover .gruppe__pil { transform: translateX(0.25rem); }

/* phones and tablets: the text sits on the photo, so the scrim covers the whole frame */
@media (max-width: 1023px) {
  .hero__farge {
    background: linear-gradient(180deg, rgb(var(--dyp-rgb)) 0%, rgb(var(--dyp-rgb)) 100%);
  }
  .hero__slor {
    background: linear-gradient(180deg,
      rgba(var(--natt-rgb), 0.2) 0%,
      rgba(var(--natt-rgb), 0.3) 40%,
      rgba(var(--natt-rgb), 0.9) 100%);
  }
  .hero__foto { object-position: 58% 0%; }
  .merke { gap: 0.6rem; font-size: 0.75rem; letter-spacing: 0.09em; }
  .merke::before { width: 1.5rem; }
  .hero__knapper .knapp { flex: 1 1 100%; }
}

@media (min-width: 640px) {
  .grupper__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gruppe + .gruppe { border-top: 0; }
  .gruppe:nth-child(n + 3) { border-top: 1px solid var(--linje); }
  .gruppe:nth-child(even) { border-left: 1px solid var(--linje); }
}

@media (min-width: 1024px) {
  .hero__liv { width: 74%; }
  .bevis { grid-auto-flow: column; grid-auto-columns: max-content; gap: 0; }
  .bevis li + li {
    margin-left: 1.25rem; padding-left: 1.25rem;
    border-left: 1px solid var(--linje-lys);
  }
  .grupper__liste { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gruppe:nth-child(n + 3) { border-top: 0; }
  .gruppe:nth-child(even) { border-left: 0; }
  .gruppe + .gruppe { border-left: 1px solid var(--linje); }
  .gruppe a {
    grid-template-columns: clamp(4.25rem, 6.2vw, 5.75rem) 1fr;
    gap: 0.85rem;
    padding: clamp(0.7rem, 1.9vh, 1.1rem) 1.1rem;
  }
  .gruppe__bilde { height: clamp(3.5rem, 9.5vh, 5rem); }
  .gruppe__pil { display: none; }
}

/* Narrow desktops: five tiles get tight, so the picture and the name shrink a step */
@media (min-width: 1024px) and (max-width: 1279px) {
  .gruppe a { grid-template-columns: 3.25rem 1fr; gap: 0.6rem; padding-inline: 0.8rem; }
  .gruppe .gruppenavn { font-size: 0.9375rem; }
  .meny__lenke { padding-inline: 0.7rem; }
}

/* Low desktop windows (Sverre's 1210 x 654): keep the strip on the first screen */
@media (min-width: 1024px) and (max-height: 700px) {
  :root { --topp: 4.25rem; }
  .logo img { height: 2.5rem; }
  .bevis li { font-size: 0.9375rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__liv { display: none; }
  .hero__flyt, .hero__flyt-indre { animation: none; transform: none; }
  html.js .mobilmeny__gruppe.er-apen .mobilmeny__produkter { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Placeholder below the hero while the design gate is open ---------- */
.venter {
  padding: 4.5rem 0 6rem;
  background: var(--skum);
  color: var(--dis);
}
.venter p { max-width: 40rem; margin: 0; }
