/* Hop Awake — website styles
   Mobile-first: the base rules are for a phone; the @media (min-width: ...)
   blocks at the bottom add the layout for bigger screens. */

/* 1. Tokens — copied from design/redesign/tokens.md (Figma).
   CSS variables let us change a colour in one place for the whole site. */
:root {
  --achtergrond-basis: #0A1430;
  --achtergrond-diep: #060B1C;
  --oppervlak-kaart: #141E3D;
  --oppervlak-verhoogd: #1C2850;
  --oppervlak-rand: #FFFFFF14;
  --tekst-primair: #F5F1EA;
  --tekst-secundair: #A3AECB;
  --tekst-tertiair: #8794B8;
  --tekst-op-primair: #1B1206;
  --merk-oranje: #F2A659;
  --merk-oranje-zacht: #F2A65929;
  --merk-oranje-rand: #F2A65966;
  --merk-maan: #8EA8FF;
  --merk-maan-zacht: #8EA8FF29;

  --ruimte-1: 4px;
  --ruimte-2: 8px;
  --ruimte-3: 12px;
  --ruimte-4: 16px;
  --ruimte-5: 20px;
  --ruimte-6: 24px;
  --ruimte-8: 32px;
  --ruimte-12: 48px;

  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --radius-rond: 999px;

  /* SF Pro Rounded exists only on Apple devices. ui-rounded asks the browser
     for it; other systems fall back to their normal sans-serif font. */
  --font-rond: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-tekst: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  --breedte: 1120px;
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--achtergrond-basis);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

/* Smooth scrolling to #anchors, but only for people who did not ask
   their system for less motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-tekst);
  font-size: 17px;
  line-height: 1.5;
  color: var(--tekst-primair);
  background: var(--achtergrond-basis);
}

img, video { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-rond);
  line-height: 1.15;
  margin: 0 0 var(--ruimte-3);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 9vw, 4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 var(--ruimte-4); text-wrap: pretty; }

a { color: var(--merk-oranje); text-underline-offset: 3px; }

/* A clear focus ring for keyboard users (Tab key). */
:focus-visible {
  outline: 3px solid var(--merk-oranje);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* First item for keyboard users: jump past the navigation. */
.skip-link {
  position: absolute;
  left: var(--ruimte-4);
  top: -100px;
  z-index: 100;
  padding: var(--ruimte-2) var(--ruimte-4);
  background: var(--merk-oranje);
  color: var(--tekst-op-primair);
  border-radius: var(--radius-rond);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--ruimte-3); }

.wrap {
  width: 100%;
  max-width: var(--breedte);
  margin: 0 auto;
  padding: 0 var(--ruimte-5);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 var(--ruimte-3);
  font-family: var(--font-rond);
  font-size: 15px;
  font-weight: 600;
  color: var(--merk-oranje);
}

.lead { font-size: 1.125rem; color: var(--tekst-secundair); }
.muted { color: var(--tekst-secundair); }

/* 3. Buttons — same as the app: 52 px high capsule, no shadow or glow. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 var(--ruimte-6);
  border-radius: var(--radius-rond);
  font-family: var(--font-tekst);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primair { background: var(--merk-oranje); color: var(--tekst-op-primair); }
.btn-primair:hover { background: #f5b472; }
.btn-secundair { background: var(--oppervlak-verhoogd); color: var(--tekst-primair); }
.btn-secundair:hover { background: #24325f; }
.btn-klein { min-height: 44px; padding: 0 var(--ruimte-4); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active { transform: none; }
}

/* 4. Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 20, 48, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--oppervlak-rand);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ruimte-4);
  min-height: 64px;
}
.brand {
  font-family: var(--font-rond);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--tekst-primair);
  text-decoration: none;
}
.nav-links {
  display: none; /* on a phone only the name and the button fit */
  gap: var(--ruimte-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  color: var(--tekst-secundair);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.nav-links a:hover { color: var(--tekst-primair); }

/* 5. Media (render loops). The poster image shows first; main.js adds the
   video only when motion is allowed. Edges fade into the page colour. */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--achtergrond-diep);
}
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-fade {
  border-radius: 0;
  background: transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

/* 6. Hero */
.hero { padding: var(--ruimte-6) 0 var(--ruimte-12); }
.hero-grid { display: grid; gap: var(--ruimte-6); }
/* On a phone we crop the bottom of the render a bit (object-position: top),
   so the puck and the headline both fit on the first screen. */
.hero-media { aspect-ratio: 720 / 820; margin: 0 calc(var(--ruimte-5) * -1); }
.hero-media video { object-position: center top; }
.hero-text { margin-top: calc(var(--ruimte-12) * -2); position: relative; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--ruimte-4);
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-rond);
  background: var(--merk-oranje-zacht);
  color: var(--merk-oranje);
  font-size: 13px;
  font-weight: 600;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.actions { display: flex; flex-wrap: wrap; gap: var(--ruimte-3); margin-top: var(--ruimte-6); }

/* 7. Sections */
.section { padding: var(--ruimte-12) 0; }
.section-head { max-width: 640px; margin-bottom: var(--ruimte-8); }

.card {
  background: var(--oppervlak-kaart);
  border: 1px solid var(--oppervlak-rand);
  border-radius: var(--radius-l);
  padding: var(--ruimte-6);
}
.card p:last-child { margin-bottom: 0; }

/* Steps: an ordered list, so screen readers announce "1 of 3" etc. */
.steps {
  display: grid;
  gap: var(--ruimte-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stap;
}
.step { counter-increment: stap; display: grid; grid-template-columns: 88px 1fr; gap: var(--ruimte-4); align-items: center; }
.step img { width: 88px; height: 88px; object-fit: contain; }
.step h3::before {
  content: counter(stap) ". ";
  color: var(--merk-oranje);
}

.split { display: grid; gap: var(--ruimte-4); }
.moment { padding: 0; overflow: hidden; }
.moment .media { border-radius: 0; aspect-ratio: 4 / 3; }
.moment .media video { object-position: center 35%; }
.moment-body { padding: var(--ruimte-6); }
.tag {
  display: inline-block;
  margin-bottom: var(--ruimte-2);
  font-size: 13px;
  font-weight: 600;
}
.tag-maan { color: var(--merk-maan); }
.tag-oranje { color: var(--merk-oranje); }

.note {
  display: flex;
  gap: var(--ruimte-4);
  align-items: center;
  margin-top: var(--ruimte-4);
}
.note img { width: 64px; height: 64px; flex: none; }
.note p { margin: 0; color: var(--tekst-secundair); }

.rules { display: grid; gap: var(--ruimte-4); }
.rule h3 { margin-bottom: var(--ruimte-2); }

/* Emergency counter: three blocks, like the "Noodroute-teller" in the app. */
.counter { display: flex; align-items: center; gap: var(--ruimte-3); margin-bottom: var(--ruimte-4); }
.counter-blocks { display: flex; gap: 6px; }
.counter-blocks span { width: 28px; height: 10px; border-radius: 5px; background: var(--merk-oranje); }
.counter-text { font-size: 15px; font-weight: 600; color: var(--tekst-secundair); }

/* FAQ: <details> works with keyboard and screen readers without any JS. */
.faq { display: grid; gap: var(--ruimte-3); max-width: 760px; }
.faq details {
  background: var(--oppervlak-kaart);
  border: 1px solid var(--oppervlak-rand);
  border-radius: var(--radius-m);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ruimte-4);
  min-height: 56px;
  padding: var(--ruimte-3) var(--ruimte-5);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-rond);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--merk-oranje);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 var(--ruimte-5); color: var(--tekst-secundair); }
.faq details p:last-child { padding-bottom: var(--ruimte-2); }

/* CTA with the morning loop */
.cta { position: relative; overflow: hidden; text-align: center; padding: 0; }
.cta .media { position: absolute; inset: 0; border-radius: 0; }
.cta .media::after {
  /* darkens the bright day render so white text keeps AA contrast */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 11, 28, 0.45) 0%, rgba(6, 11, 28, 0.75) 100%);
}
.cta-inner { position: relative; padding: var(--ruimte-12) var(--ruimte-6); }
.cta p { color: var(--tekst-primair); max-width: 520px; margin-left: auto; margin-right: auto; }
.cta .actions { justify-content: center; }

/* 8. Footer */
.site-footer {
  padding: var(--ruimte-8) 0 var(--ruimte-12);
  border-top: 1px solid var(--oppervlak-rand);
  color: var(--tekst-tertiair);
  font-size: 15px;
}
.footer-grid { display: grid; gap: var(--ruimte-4); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--ruimte-5); margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--tekst-secundair); }
.site-footer p { margin: 0; }

/* 9. Text pages (privacy, 404) */
.page { padding: var(--ruimte-8) 0 var(--ruimte-12); }
.prose { max-width: 720px; }
.prose h2 { font-size: 1.5rem; margin-top: var(--ruimte-8); }
.prose p, .prose li { color: var(--tekst-secundair); }
.prose li { margin-bottom: var(--ruimte-2); }
.placeholder {
  border: 1px dashed var(--merk-oranje-rand);
  background: var(--merk-oranje-zacht);
  border-radius: var(--radius-m);
  padding: var(--ruimte-5);
}
.placeholder p { color: var(--tekst-primair); }

.notfound { min-height: 70vh; display: grid; align-content: center; text-align: center; }
.notfound img { width: 160px; height: 160px; margin: 0 auto var(--ruimte-6); }

/* 10. Bigger screens */
@media (min-width: 720px) {
  .wrap { padding: 0 var(--ruimte-8); }
  .nav-links { display: flex; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { grid-template-columns: 1fr; align-items: start; }
  .step img { width: 120px; height: 120px; }
  .split { grid-template-columns: 1fr 1fr; }
  .rules { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 1000px) {
  .hero { padding: var(--ruimte-8) 0 var(--ruimte-12); }
  .hero-grid { grid-template-columns: 1.05fr 1fr; align-items: center; gap: var(--ruimte-12); }
  .hero-text { margin-top: 0; order: -1; }
  .hero-media {
    aspect-ratio: 720 / 954;
    max-height: 720px;
    margin: 0;
    border-radius: var(--radius-xl);
    /* Two soft fades (left/right and top/bottom) multiplied together, so the
       render melts into the page on all four sides instead of showing a box. */
    -webkit-mask-image:
      linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%),
      linear-gradient(to bottom, transparent 0%, #000 15%, #000 75%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%),
      linear-gradient(to bottom, transparent 0%, #000 15%, #000 75%, transparent 100%);
    mask-composite: intersect;
  }
  .section { padding: 96px 0; }
  .cta-inner { padding: 96px var(--ruimte-8); }
}

/* 11. Additions for text pages */
.actions-center { justify-content: center; }
.prose h1 { font-size: clamp(2rem, 7vw, 3rem); }
.prose strong { color: var(--tekst-primair); }
.placeholder { margin: var(--ruimte-6) 0; }
.placeholder ol { padding-left: var(--ruimte-5); }
.placeholder li { color: var(--tekst-primair); }
/* Wide tables scroll sideways on a phone instead of breaking the layout. */
.table-wrap { overflow-x: auto; margin: 0 0 var(--ruimte-6); border: 1px solid var(--oppervlak-rand); border-radius: var(--radius-m); }
.prose table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: var(--ruimte-3) var(--ruimte-4); border-bottom: 1px solid var(--oppervlak-rand); }
.prose th { background: var(--oppervlak-kaart); color: var(--tekst-primair); font-weight: 600; }
.prose td { color: var(--tekst-secundair); }
.prose tr:last-child td { border-bottom: 0; }

/* Small floating puck above the CTA title */
.cta-puck { width: 96px; height: 96px; margin: 0 auto var(--ruimte-4); }
@media (min-width: 720px) { .cta-puck { width: 120px; height: 120px; } }
