/* Shared chrome for every page: type, tokens, nav, buttons and the hero copy.
   Tokens mirror apps/dashboard/src/components/landing/landing.module.scss. */

/* Self-hosted Inter (SIL OFL, see fonts/LICENSE-Inter.txt): no third-party requests, as the privacy
   statement promises, and the same type for visitors who don't have Inter installed. */
@font-face {
  font-family: "Inter Variable";
  src: url("fonts/inter-var.woff2") format("woff2-variations"), url("fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --surface: #0a0a0c;
  --line: rgb(255 255 255 / 10%);
  --line-strong: rgb(255 255 255 / 18%);
  --text: #fff;
  --muted: rgb(255 255 255 / 62%);
  --faint: rgb(255 255 255 / 40%);
  --accent: #0022ff;
  --accent-strong: #001ad1;
  --accent-ink: #8090ff;
  --accent-line: #4763ff;
  --green: #3ccf7a;
  --orange: #f0a43a;
  --red: #f06b6b;
  --sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- moving between pages: the old page rushes past, the next grows out of the depth ---------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-leave 0.5s cubic-bezier(0.7, 0, 0.3, 1) both;
}

::view-transition-new(root) {
  animation: page-arrive 0.8s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

/* the same move by hand, for browsers without cross-document view transitions (pagina-gedeeld.js) */
html.is-leaving body {
  animation: page-leave 0.42s cubic-bezier(0.7, 0, 0.3, 1) both;
  pointer-events: none;
}

html.is-arriving body {
  animation: page-arrive 0.8s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

@keyframes page-leave {
  to {
    opacity: 0;
    transform: scale(1.1);
    filter: blur(10px);
  }
}

@keyframes page-arrive {
  from {
    opacity: 0;
    transform: scale(0.94);
    filter: blur(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ---------- top navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 40px);
  background: linear-gradient(to bottom, rgb(0 0 0 / 70%), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: radial-gradient(circle at 30% 30%, #8090ff, var(--accent) 60%);
  box-shadow: 0 0 18px rgb(0 34 255 / 70%);
}

.links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
}

.links a {
  position: relative;
  text-decoration: none;
  transition: color 0.2s;
}

.links a:hover {
  color: var(--text);
}

/* a survey line is drawn under the link you point at, and retracts the way it came */
.links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--accent-line);
  box-shadow: 0 0 8px var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.links a:hover::after,
.links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  /* magnetism: pagina-gedeeld.js sets --mx/--my while the pointer is on the button */
  translate: var(--mx, 0px) var(--my, 0px);
  transition:
    background 0.2s,
    translate 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.btn:hover {
  transition:
    background 0.2s,
    translate 0.15s ease-out;
}

/* a light that follows the pointer across the button */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(90px circle at var(--hx, 50%) var(--hy, 50%), rgb(255 255 255 / 26%), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.btn-ghost {
  background: rgb(255 255 255 / 4%);
  border-color: var(--line-strong);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgb(255 255 255 / 10%);
}

/* ---------- the scroll story ---------- */

.story {
  position: relative;
  height: 600vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(120% 85% at 50% 42%, #04071a 0%, #000 62%);
}

.scenes,
.scenes canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scenes canvas {
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scenes canvas.is-on {
  opacity: 1;
}

.scene-error {
  position: absolute;
  inset: auto 0 45% 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
}

.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgb(0 0 0 / 78%), transparent 40%),
    linear-gradient(to bottom, rgb(0 0 0 / 50%), transparent 16%);
}

/* act 0: the real headline, plain HTML, visible on first paint */
.hero-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 96px 24px 150px;
  text-align: center;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(980px, 100%);
  height: 70%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 62%), transparent);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 4%);
  backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-line);
  box-shadow: 0 0 10px var(--accent-line);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.scroll-cue {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 36px;
  margin: 12px auto 0;
  background: linear-gradient(var(--faint), transparent);
}

/* acts 1–5: editorial captions */
.act {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 6vw, 88px);
  bottom: 118px;
  width: min(460px, calc(100% - 40px));
  will-change: opacity, transform;
}

.act-num {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
}

.act-num::after {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.act h2 {
  margin: 12px 0 14px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.act p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
}

.codes li {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgb(10 10 14 / 55%);
  backdrop-filter: blur(6px);
  color: var(--muted);
}

.codes.threat li {
  color: #ff9d9d;
  border-color: rgb(240 107 107 / 35%);
  background: rgb(60 10 10 / 35%);
}

.codes:empty {
  display: none;
}

.codes .sev {
  margin-right: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.codes li[data-sev="critical"] .sev,
.codes li[data-sev="high"] .sev {
  color: var(--red);
}

.codes li[data-sev="medium"] .sev {
  color: var(--orange);
}

.codes.found li[data-sev="medium"]::before {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

.codes.found li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.act-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.grade {
  flex: none;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  border: 1px solid currentColor;
  background: rgb(10 10 14 / 55%);
  backdrop-filter: blur(8px);
  font-size: 54px;
  font-weight: 600;
  letter-spacing: -0.04em;
  transition: color 0.3s;
}

.grade[data-letter="D"] {
  color: var(--orange);
}
.grade[data-letter="C"] {
  color: #e8c44a;
}
.grade[data-letter="B"] {
  color: #a6d96a;
}
.grade[data-letter="A"] {
  color: var(--green);
}

.act-final {
  left: 0;
  right: 0;
  top: 15vh;
  bottom: auto;
  width: min(640px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
}

.act-final .act-num {
  justify-content: center;
}

.act-final .act-num::before {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.act-final .cta-row {
  margin-top: 24px;
}

/* chapter rail */
.rail {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 3vw, 36px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.rail button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
  transition: color 0.3s;
}

.rail button::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s, background 0.3s;
}

.rail .rail-name {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.3s;
}

.rail:hover .rail-name,
.rail button[aria-current="true"] .rail-name {
  opacity: 1;
  transform: none;
}

.rail button:hover,
.rail button[aria-current="true"] {
  color: var(--text);
}

.rail button[aria-current="true"]::after {
  width: 40px;
  background: var(--accent-line);
}

.rail button:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 3vw, 36px);
  bottom: 30px;
  font-size: 13px;
  color: var(--faint);
  text-decoration: none;
}

.skip:hover {
  color: var(--text);
}

/* what follows the hero on the real page */
.after {
  min-height: 80vh;
  padding: 140px clamp(20px, 6vw, 88px);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.after .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.after h2 {
  max-width: 820px;
  margin: 16px 0 0;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--muted);
}

/* ---------- concept switcher ---------- */

.switcher {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgb(12 12 16 / 72%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 40px rgb(0 0 0 / 55%);
}

.switcher-label {
  padding: 0 8px 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.options {
  display: flex;
  gap: 2px;
}

.options button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.options kbd {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font: 600 11px/1 var(--mono);
}

.options button:hover {
  color: var(--text);
  background: rgb(255 255 255 / 7%);
}

.options button[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
}

.options button[aria-pressed="true"] kbd {
  border-color: rgb(255 255 255 / 45%);
  background: rgb(255 255 255 / 14%);
}

.options button:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

.fps {
  min-width: 7ch;
  padding: 0 12px 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  text-align: right;
}

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .links {
    display: none;
  }
  .nav {
    gap: 10px;
    padding: 12px 14px;
  }
  .brand {
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
  }
  .nav .btn-sm {
    height: 34px;
    padding: 0 13px;
    font-size: 13px;
    white-space: nowrap;
  }
  .rail,
  .skip {
    display: none;
  }
  .act {
    bottom: 84px;
  }
  .act p {
    font-size: 15px;
  }
  .grade {
    width: 68px;
    height: 68px;
    font-size: 40px;
    border-radius: 16px;
  }
  .options button {
    padding: 6px;
  }
  .options button span,
  .switcher-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scenes canvas,
  .rail button,
  .rail button::after,
  .rail .rail-name {
    transition: none;
  }
}
