:root {
  --navy: #0B3B67;
  --ink: #0B2440;
  --teal: #19B8B5;
  --orange: #F05A16;
  --slate: #56657A;
  --bg: #EAF4FA;
  --line: #C9DCE8;
  --font: Aptos, "Figtree", "Segoe UI", Calibri, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "mast"
    "intro"
    "stage"
    "foot";
}

.masthead { grid-area: mast; padding: 20px var(--gutter) 0; }
.intro    { grid-area: intro; padding: 40px var(--gutter) 8px; }
.stage    { grid-area: stage; }
.foot     { grid-area: foot; padding: 0 var(--gutter) 28px; }

@media (min-width: 960px) {
  .page {
    height: 100vh;
    height: 100svh;
    min-height: 640px;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "mast  stage"
      "intro stage"
      "foot  stage";
  }
  .masthead { padding-top: 36px; }
  .intro { align-self: center; padding-top: 24px; padding-bottom: 24px; padding-right: 0; }
  /* Scale the headline by height too, so short laptop screens keep breathing room. */
  .intro h1 { font-size: clamp(2.5rem, min(1.2rem + 4.6vw, 8.2vh), 4.75rem); }
  .intro .lede { margin-bottom: clamp(20px, 3.5vh, 32px); }
  .foot { padding-bottom: 36px; padding-right: 0; }
}

/* ---------- Masthead ---------- */

.logo {
  display: block;
  width: clamp(150px, 16vw, 210px);
  height: auto;
}

/* ---------- Intro ---------- */

h1 {
  margin: 0 0 22px;
  max-width: 15ch;
  color: var(--navy);
  font-weight: 800;
  font-size: clamp(2.5rem, 1.2rem + 4.6vw, 4.75rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 32px;
  max-width: 46ch;
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--ink);
}

/* ---------- Notify form ---------- */

.notify { max-width: 460px; }

.notify label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--navy);
}

.field {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px -18px rgba(11, 59, 103, 0.45);
  transition: border-color 0.2s;
}
.field:focus-within { border-color: var(--teal); }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}
.field input::placeholder { color: #8796A6; }
.field input:focus { outline: none; }

.field button {
  flex: 0 0 auto;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}
.field button:hover { background: var(--ink); }
.field button:disabled { opacity: 0.6; cursor: progress; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  min-height: 1.5em;
  margin: 10px 2px 0;
  font-size: 0.94rem;
  color: var(--slate);
}
.form-status.is-ok { color: #0E6E6C; font-weight: 600; }
.form-status.is-error { color: #B23C0B; font-weight: 600; }

/* ---------- 3D stage ---------- */

.stage {
  position: relative;
  /* On phones and tablets the stack's size is set by the screen width, so the stage follows the width too
     (a height-based stage left a large empty band above the stack). */
  aspect-ratio: 4 / 3;
  max-height: 75svh;
  margin-top: 8px;
  overflow: hidden;
}
@media (min-width: 960px) {
  .stage { aspect-ratio: auto; max-height: none; margin-top: 0; }
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.6s;
}
.stage.is-3d #scene { opacity: 1; }

/* Layer labels: a plain list without WebGL, positioned beside each 3D frame with it. */
.layers {
  list-style: none;
  margin: 0;
  padding: 72px var(--gutter) 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
}

.layers li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  padding-left: 40px;
  line-height: 1.25;
}
.layers li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
}
.layers .n { color: var(--slate); font-weight: 500; font-variant-numeric: tabular-nums; }
.layers .t { font-weight: 700; color: var(--ink); }
.layers .d { grid-column: 2; font-size: 0.88rem; color: var(--slate); }

.stage.is-3d .layers { padding: 0; display: block; }
.stage.is-3d .layers li {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  translate: 14px 0;
  transition: opacity 0.5s ease-out, translate 0.6s cubic-bezier(.2,.8,.2,1);
}
.stage.is-3d .layers li.on { opacity: 1; translate: 0 0; }

.stage-caption {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 12px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--slate);
  text-align: center;
  text-wrap: balance;
}
@media (min-width: 960px) {
  .stage-caption { bottom: 36px; }
}

/* Compact labels on small stages */
@media (max-width: 559px) {
  .stage.is-3d .layers .d { display: none; }
  .stage.is-3d .layers li { padding-left: 26px; font-size: 0.9rem; }
  .stage.is-3d .layers li::before { width: 18px; }
}

/* ---------- Footer ---------- */

.foot { font-size: 0.9rem; color: var(--slate); text-align: center; padding-top: 20px; }
.foot p { margin: 0; }
.purpose {
  margin-bottom: 8px !important;
  font-weight: 600;
  color: var(--navy);
  text-wrap: balance;
}
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }

/* Desktop: the footer sits under the left column, aligned with the headline. */
@media (min-width: 960px) {
  .foot { text-align: left; padding-top: 0; }
  .links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
