/* Mobile first: base styles are for phones, min-width queries add room. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --sky: #F2F6F9;
  --sky-deep: #E3ECF3;
  --ink: #132238;
  --slate: #4B5D72;
  --line: #CBD6E0;
  --duck: #F4C21B;
  --duck-shade: #E5AE0B;
  --beak: #EE8A2A;
  --on-duck: #132238;
  --risk: #C2412D;
  --safe: #5B87AE;

  --font: "Schibsted Grotesk", system-ui, sans-serif;

  /* Type scale: phone sizes first */
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: 1.3125rem;
  --step-3: 1.75rem;
  --step-4: 2.375rem;

  --gutter: 1.25rem;
  --space: 3.5rem;
  --max: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --risk: #F07A63;
    --safe: #7FA8CC;
    --sky: #0F1B2D;
    --sky-deep: #16253B;
    --ink: #E8EEF4;
    --slate: #A3B2C3;
    --line: #2A3B53;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); font-weight: 800; margin-bottom: 1.25rem; }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--duck); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--duck); color: var(--on-duck);
  padding: .75rem 1rem; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
/* narrow columns keep the same left edge as the header */
.narrow { max-width: 42rem; margin-left: max(var(--gutter), (100% - var(--max)) / 2); }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top__inner { display: flex; justify-content: space-between; align-items: center; min-height: 3.5rem; }
.name { font-weight: 600; }
.top__link {
  color: var(--slate); text-decoration: none;
  /* comfortable tap target */
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .5rem; margin-right: -.5rem;
}
.top__link:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding-block: 1.75rem 3rem; }
.hero__grid { display: grid; gap: 1.25rem; }
.hero__text { max-width: 40rem; }
.lead { font-size: var(--step-1); color: var(--slate); margin-top: 1.25rem; max-width: 34rem; }

/* Buttons: full width and stacked on phones */
.actions { display: grid; gap: .75rem; margin-top: 1.75rem; }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: .75rem 1.5rem;
  border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 600; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--sky); }
.btn--primary { background: var(--duck); border-color: var(--duck); color: var(--on-duck); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--sky); }

/* Hero photo: small and above the headline on phones */
.hero__photo { grid-row: 1; display: block; width: 7rem; }
.hero__photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--duck); background: var(--sky-deep);
}

/* Duck (duck page): small and above the headline on phones */
.duck { margin: 0; width: 8.5rem; grid-row: 1; }
.duck svg { display: block; width: 100%; height: auto; overflow: visible; }
.duck__body, .duck__head { fill: var(--duck); }
.duck__wing { fill: var(--duck-shade); }
.duck__beak { fill: var(--beak); }
.duck__eye { fill: #132238; }
.duck__shine { fill: #fff; }
.duck__water { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }

.duck svg > :not(.duck__water) { transform-origin: 140px 190px; animation: bob 4.5s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .duck svg > * { animation: none; }
}

/* Sections */
.section { padding-block: var(--space); }
.section--tint { background: var(--sky-deep); }
.section--quiet { border-block: 1px solid var(--line); }

.familiar { list-style: none; margin: 0; padding: 0; }
.familiar li {
  font-size: var(--step-1); line-height: 1.4;
  padding-block: 1rem; border-top: 1px solid var(--line);
}
.familiar li:last-child { border-bottom: 1px solid var(--line); }

.results { display: grid; gap: 1.75rem; margin-top: .5rem; }
.result { border-left: 4px solid var(--duck); padding-left: 1rem; max-width: 30rem; }
.result p { color: var(--slate); margin-top: .4rem; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.5rem 1fr; column-gap: .875rem;
  padding-block: 1.1rem;
}
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--duck); color: var(--on-duck); font-weight: 800;
}
.steps p { color: var(--slate); margin-top: .25rem; }

.big { font-size: var(--step-2); line-height: 1.4; }

.about { display: grid; gap: 1.25rem; }
.about__link { margin-top: 1rem; }
.about__link a, .contact__alt a { font-weight: 600; text-underline-offset: .2em; }
.contact__alt { margin-top: 1.25rem; opacity: .8; }
.foot a { color: inherit; }
.about h2 { margin-bottom: .5rem; }
.about__sub { color: var(--slate); font-size: var(--step-1); margin-bottom: 1rem; }

.contact { background: var(--ink); color: var(--sky); }
.contact .lead { color: inherit; opacity: .8; }
.contact .btn { border-color: var(--sky); }
.contact .btn:hover { background: var(--sky); color: var(--ink); }
.contact .btn--primary { border-color: var(--duck); }
.contact .btn--primary:hover { border-color: var(--sky); }

.foot { padding-block: 1.75rem; color: var(--slate); font-size: .9375rem; }
.foot__inner { display: grid; gap: 1.25rem; }
.foot__block { display: grid; gap: .15rem; }
.foot__block strong { color: var(--ink); font-weight: 600; }
.foot address { font-style: normal; }

/* Support timeline */
.narrow-text { max-width: 42rem; }
.narrow-text .lead { margin-top: 0; }
.tl { --track-l: 0rem; --track-r: 0rem; position: relative; margin-top: 2.25rem; }
.tl__axis { position: relative; height: 1.5rem; margin: 0 var(--track-r) .25rem var(--track-l); border-bottom: 1px solid var(--line); }
.tl__axis span { position: absolute; transform: translateX(-50%); font-size: .8125rem; color: var(--slate); }
.tl__axis span:first-child { transform: none; }
.tl__axis span:nth-last-child(2) { transform: translateX(-100%); }
.tl__tick--minor { display: none; }
.tl__axis-today {
  position: absolute; transform: translateX(-50%); font-size: .8125rem; font-weight: 600;
  background: var(--sky); padding-inline: .25rem;
}
.tl__group { font-size: var(--step-0); margin: 1.25rem 0 .25rem; color: var(--slate); }
.tl__list { list-style: none; margin: 0; padding: 0; }
.tl__row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  column-gap: 1rem; row-gap: .35rem; padding-block: .5rem;
}
.tl__name { font-weight: 600; }
.tl__status { grid-row: 1; grid-column: 2; font-size: .9375rem; color: var(--slate); text-align: right; }
.tl__track { grid-row: 2; grid-column: 1 / -1; position: relative; height: .625rem; border-radius: 99px; background: var(--sky-deep); }
/* phones: a small today mark on each bar instead of one line through the text */
.tl__track::after {
  content: ""; position: absolute; top: -.2rem; bottom: -.2rem; width: 2px;
  left: calc(var(--x, 0) * 100%); background: var(--ink); opacity: .6;
}
.tl__bar { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--safe); }
.tl__row--ended .tl__bar { background: var(--risk); opacity: .55; }
.tl__row--ended .tl__status { color: var(--risk); font-weight: 600; }
.tl__row--soon .tl__bar { background: var(--duck); }
.tl__row--soon .tl__status { color: var(--ink); font-weight: 600; }
.tl__row--soon .tl__name::after {
  content: ""; display: inline-block; width: .5rem; height: .5rem; margin-left: .5rem;
  border-radius: 50%; background: var(--duck); vertical-align: middle;
}
.tl__today {
  display: none; position: absolute; top: 1.5rem; bottom: 0; width: 0;
  left: calc(var(--track-l) + (100% - var(--track-l) - var(--track-r)) * var(--x));
  border-left: 2px dashed var(--ink); opacity: .6; pointer-events: none;
}
.tl__legend { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9375rem; color: var(--slate); }
.tl__key::before { content: ""; display: inline-block; width: 1.25rem; height: .5rem; border-radius: 99px; margin-right: .5rem; vertical-align: middle; }
.tl__key--ended::before { background: var(--risk); opacity: .55; }
.tl__key--soon::before { background: var(--duck); }
.tl__key--ok::before { background: var(--safe); }
.tl__source { margin-top: .75rem; font-size: .9375rem; color: var(--slate); }
.tl__source a { color: inherit; }
.capacity { margin-top: .75rem; opacity: .8; }

/* ≥ 30rem: large phones in landscape, small tablets */
@media (min-width: 30rem) {
  .actions { display: flex; flex-wrap: wrap; }
  .btn { display: inline-flex; min-height: 3rem; }
}

/* ≥ 48rem: tablets */
@media (min-width: 48rem) {
  :root {
    --step-1: 1.25rem;
    --step-2: 1.5rem;
    --step-3: 2rem;
    --step-4: 3rem;
    --gutter: 2rem;
    --space: 5rem;
  }
  .hero { padding-block: 3.5rem 4.5rem; }
  .duck { width: 11rem; }
  .hero__photo { width: 9rem; }
  .familiar li { font-size: var(--step-2); line-height: 1.35; padding-block: 1.1rem; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; }
  .result { padding-left: 1.25rem; }
  .steps li { grid-template-columns: 3rem 1fr; column-gap: 1rem; padding-block: 1.25rem; }
  .steps li::before { width: 2.5rem; height: 2.5rem; }
  .tl { --track-l: 8.5rem; --track-r: 11rem; }
  .tl__row { grid-template-columns: 7.5rem 1fr 10rem; padding-block: .4rem; }
  .tl__track { grid-row: auto; grid-column: auto; }
  .tl__track::after { display: none; }
  .tl__status { grid-row: auto; grid-column: auto; text-align: left; }
  .tl__tick--minor { display: inline; }
  .tl__today { display: block; }
  .foot__inner { grid-template-columns: repeat(4, auto); justify-content: space-between; align-items: start; gap: 1rem 3rem; }
}

/* ≥ 64rem: laptops and up */
@media (min-width: 64rem) {
  :root {
    --step-4: 3.75rem;
    --step-3: 2.25rem;
    --gutter: 2.5rem;
    --space: 7rem;
  }
  .hero { padding-block: 6rem 5rem; }
  .hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 5rem; align-items: center; }
  .duck { grid-row: auto; width: min(100%, 22rem); justify-self: center; }
  .hero__photo { grid-row: auto; width: min(100%, 20rem); justify-self: center; }
  .hero__photo img { border-width: 6px; }
  .results { gap: 3.5rem 5rem; }
}

/* Duck page */
.duck-page .hero { padding-bottom: clamp(2rem, 6vw, 4rem); }
.duck-page .duck { width: 12rem; }
.takeover { list-style: none; margin: 0; padding: 0; }
.takeover li { padding-block: .9rem; border-top: 1px solid var(--line); font-size: var(--step-1); }
.takeover li:last-child { border-bottom: 1px solid var(--line); }
.back { margin-top: 1.5rem; }
.back a { font-weight: 600; text-underline-offset: .2em; }
@media (min-width: 64rem) {
  .duck-page .duck { width: min(100%, 22rem); }
}
