/*
 * The brand colours (docs/design/design-system.md), shared by the app
 * (src/styles.scss loads this file first) and the public landing page
 * (scripts/landing/build-landing.mjs puts it at the top of its CSS, #485).
 * Change a colour here and both follow.
 */
:root {
  --color-navy: #003049;
  --color-orange: #f77f00;
  --color-red: #d62828;
  --color-amber: #fcbf49;
  --color-cream: #eae2b7;
  --color-bg: #fffdf2;
  /*
   * Accessible text variants (WCAG AA 4.5:1, #17): the brand orange and the
   * mockups' grey are too light for text on the app's light surfaces.
   */
  --color-orange-text: #a85600; /* primary.700, ~4.8:1 */
  --color-muted-text: #4a6577; /* ~6:1 on --color-bg */
}

/*
 * The landing page (#485): direction 1 « Carnet de route » of the #438 spike
 * (docs/design/landing/mockups/1-carnet.html) with direction 3's FAQ. The brand
 * colours come first, from src/styles/tokens.css (the generator puts both in one
 * hashed file). Light only, no animation.
 */

/*
 * Raleway (OFL), the app's own files (public/fonts/raleway/LICENSE.txt), preloaded: the WOFF2
 * cut to Latin and Latin Extended (#589, every character of the eight languages), the TTF
 * for a browser without WOFF2.
 * `optional`: a font that misses the first paint is not swapped in later, so the
 * text never moves (CLS 0); the next visit has it from the cache.
 */
@font-face {
  font-family: 'Raleway';
  src:
    url('/fonts/raleway/Raleway-Regular-latin.2cdbc50188.woff2') format('woff2'),
    url('/fonts/raleway/Raleway-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: 'Raleway';
  src:
    url('/fonts/raleway/Raleway-Bold-latin.ceec561d76.woff2') format('woff2'),
    url('/fonts/raleway/Raleway-Bold.ttf') format('truetype');
  font-weight: 600 700;
  font-display: optional;
}
@font-face {
  font-family: 'Raleway';
  src:
    url('/fonts/raleway/Raleway-ExtraBold-latin.83214cbf25.woff2') format('woff2'),
    url('/fonts/raleway/Raleway-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: optional;
}

:root {
  color-scheme: light;
  /* `--color-orange-text` is 4.0:1 on cream: the eyebrow there uses this one (5.1:1) */
  --landing-orange-on-cream: #8f4a00;
  --landing-on-navy: #dbe6ec; /* ~11:1 on navy */
  --landing-footer: #00253a;
  --radius: 14px;
  --gutter: min(32px, 5vw);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: auto;
}
html,
body {
  margin: 0;
}
body {
  font-family: 'Raleway', system-ui, sans-serif;
  color: var(--color-navy);
  background: var(--color-bg);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
picture {
  display: block;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}
p,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
:focus-visible {
  outline: 3px solid var(--color-navy);
  outline-offset: 3px;
}
.hero :focus-visible,
.cta :focus-visible,
.footer :focus-visible {
  outline-color: var(--color-amber);
}
main:focus {
  outline: none;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--color-amber);
  color: var(--color-navy);
  font-weight: 700;
}
.skip:focus {
  top: 16px;
}

/* ---------- Buttons: navy text on orange (5.4:1) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn--primary {
  background: var(--color-orange);
  color: var(--color-navy);
}
.btn--big {
  min-height: 60px;
  padding: 8px 34px;
  font-size: 1.25rem;
}
.btn--ghost-dark {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.arrow {
  font-size: 1.1em;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  min-height: 72px;
  color: #fff;
}
.topbar__home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: none;
}
.topbar__logo {
  height: 34px;
  width: auto;
}
.topbar__nav {
  display: flex;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}
.topbar__nav a,
.topbar__login {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
}
.topbar__nav a {
  text-decoration: none;
}
.topbar__right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 1rem;
}
.topbar .btn {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1rem;
}

/* ---------- Language selector: links in a <details>, no JavaScript needed ---------- */
.lang {
  position: relative;
}
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid currentColor;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}
.lang summary::-webkit-details-marker {
  display: none;
}
.lang summary::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}
.lang[open] summary::after {
  transform: rotate(180deg);
}
.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 180px;
  /* never wider than a phone; the selector script shifts it inside the screen */
  max-width: calc(100vw - 16px);
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  color: var(--color-navy);
  box-shadow: 0 12px 30px -8px rgba(0, 20, 32, 0.45);
}
.lang--up .lang__menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.lang__menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.lang__menu a:hover {
  background: var(--color-cream);
}
.lang__menu a[aria-current='page'] {
  font-weight: 800;
  text-decoration: underline;
}
.lang__menu :focus-visible {
  outline-color: var(--color-navy);
  outline-offset: -3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Device frames around the real captures ---------- */
.screen {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 30px 60px -20px rgba(0, 20, 32, 0.45),
    0 0 0 1px rgba(0, 48, 73, 0.12);
}
.screen__bar {
  height: 26px;
  background: #e9edf0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}
.screen__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8c3ca;
}
.phone {
  border-radius: 34px;
  padding: 9px;
  background: #0b1a22;
  box-shadow: 0 30px 60px -18px rgba(0, 20, 32, 0.55);
}
.phone img {
  border-radius: 26px;
}

/* ---------- Hero: the app's navy band, the captures as proof ---------- */
.hero {
  background: var(--color-navy);
  color: #fff;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0 0;
}
.hero__text {
  padding-bottom: 72px;
  min-width: 0;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-top: 14px;
}
.hero h1 em {
  font-style: normal;
  color: var(--color-amber);
}
.hero__lead {
  margin-top: 22px;
  font-size: 1.25rem;
  color: var(--landing-on-navy);
  max-width: 34ch;
}
.hero__actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.hero__login {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--landing-on-navy);
}
.hero__login a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-weight: 700;
}
.hero__visual {
  position: relative;
  align-self: end;
  margin-right: -120px;
}
.hero__screen {
  border-radius: 12px 12px 0 0;
}
.hero__phone {
  position: absolute;
  left: -56px;
  bottom: 28px;
  width: 190px;
}
.band {
  height: 10px;
  background: linear-gradient(
    90deg,
    var(--color-red) 0 25%,
    var(--color-orange) 25% 50%,
    var(--color-amber) 50% 75%,
    var(--color-cream) 75%
  );
}

/* ---------- Sections ---------- */
.eyebrow {
  display: inline-block;
  /* a long single word (nb « Dagsoppsummeringen ») breaks instead of widening the page */
  max-width: 100%;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-orange-text);
}
.hero .eyebrow {
  color: var(--color-amber);
}
.steps .eyebrow {
  color: var(--landing-orange-on-cream);
}
.section {
  padding: 96px 0;
}
.section--pictures {
  padding-top: 0;
}
.section__title {
  font-size: 2.5rem;
  font-weight: 800;
  max-width: 20ch;
}
.muted {
  color: var(--color-muted-text);
}

/* Key features: the owner's twelve, four columns */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.highlight {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: 0 0 0 1px rgba(0, 48, 73, 0.08);
}
.highlight h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 16px 0 6px;
}
.highlight p {
  font-size: 1rem;
  color: var(--color-muted-text);
}
.icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-orange);
  color: var(--color-navy);
}
.icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* In pictures: text and capture, alternating */
.feature {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 64px;
  align-items: center;
  margin-top: 80px;
}
.feature > * {
  min-width: 0;
}
.feature--flip {
  grid-template-columns: 1.25fr 1fr;
}
.feature--flip .feature__text {
  order: 2;
}
.feature h2 {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 10px 0 14px;
}
.feature ul {
  margin: 18px 0 0;
  display: grid;
  /* a long single word (sv « Övernattningsstopp ») wraps instead of widening the list */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.feature li {
  padding-left: 30px;
  position: relative;
}
.feature li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-orange);
}
.phones {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.phones .phone {
  width: 250px;
}

/* How it works, on cream */
.steps {
  background: var(--color-cream);
}
.steps__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}
.step {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 28px;
}
.step__n {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-orange);
  color: var(--color-navy);
  font-weight: 800;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
}
.step h3 {
  font-size: 1.3125rem;
  margin: 18px 0 8px;
}
.extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 48, 73, 0.12);
}

/* FAQ (direction 3's four questions) */
.faq {
  max-width: 780px;
}
.faq .section__title {
  margin-bottom: 20px;
}
.faq details {
  border-bottom: 1px solid rgba(0, 48, 73, 0.15);
  padding: 8px 0;
}
.faq summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 0;
  font-weight: 700;
  font-size: 1.1875rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
/* The disclosure triangle (flex drops the native marker): ▶ closed, ▼ open */
.faq summary::before {
  content: '';
  flex: none;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}
.faq details[open] summary::before {
  transform: rotate(90deg);
}
.faq details p {
  margin: 4px 0 12px;
  color: var(--color-muted-text);
}

/* Final call to action */
.cta {
  background: var(--color-navy);
  color: #fff;
  text-align: center;
}
.cta h2 {
  font-size: 2.75rem;
  font-weight: 800;
}
.cta p {
  margin: 16px auto 32px;
  color: var(--landing-on-navy);
  font-size: 1.1875rem;
  max-width: 46ch;
}

/* Footer */
.footer {
  padding: 40px 0;
  font-size: 0.9375rem;
  background: var(--landing-footer);
  color: var(--landing-on-navy);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
}
.footer__logo {
  height: 28px;
  width: auto;
}
.footer__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
}
.footer__right {
  margin-left: auto;
}

/* ---------- The 404 page (#576): the hero alone, the whole screen ---------- */
.not-found {
  min-height: 100vh;
}
.not-found__text {
  padding: 64px 0 96px;
}
@media (max-width: 600px) {
  .not-found__text {
    padding: 32px 0 64px;
  }
}

/* ---------- Tablet: the header keeps its links, the hero stacks ---------- */
@media (max-width: 1100px) {
  .topbar__nav {
    display: none;
  }
  .hero__visual {
    margin-right: 0;
  }
  .highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Phone width: 16 px gutter, one column ---------- */
@media (max-width: 600px) {
  :root {
    --gutter: min(16px, 5vw);
  }
  body {
    font-size: 1rem;
  }
  .topbar {
    min-height: 60px;
    column-gap: 12px;
  }
  .topbar__logo {
    height: 28px;
  }
  .topbar__join,
  .hide-phone,
  .hero__screen,
  .phones__second {
    display: none;
  }
  .topbar__right {
    gap: 6px;
    font-size: 0.9375rem;
  }
  .section {
    padding: 64px 0;
  }
  .section--pictures {
    padding-top: 0;
  }
  .section__title {
    font-size: 1.8125rem;
  }
  .btn--big {
    min-height: 56px;
    font-size: 1.125rem;
    width: 100%;
  }
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 28px;
  }
  .hero__text {
    padding-bottom: 8px;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
  .hero__lead {
    font-size: 1.0625rem;
  }
  .hero__visual {
    margin: 24px 0 0;
    display: flex;
    justify-content: center;
  }
  .hero__phone {
    position: static;
    width: 240px;
    max-width: 70%;
    border-radius: 34px 34px 0 0;
    padding-bottom: 0;
  }
  .hero__phone img {
    border-radius: 26px 26px 0 0;
  }
  .highlights,
  .steps__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 28px;
  }
  .highlight {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 16px;
    padding: 20px 18px;
  }
  .highlight h3 {
    margin: 0 0 4px;
    align-self: center;
  }
  .highlight p {
    grid-column: 2;
  }
  .feature,
  .feature--flip {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 56px;
  }
  .feature--flip .feature__text {
    order: 0;
  }
  .feature h2 {
    font-size: 1.5625rem;
  }
  .phones .phone {
    width: 72%;
  }
  .cta h2 {
    font-size: 1.875rem;
  }
  .footer__right {
    margin-left: 0;
  }
}
