/* BEMREL — a pane of reeded glass, and what stands behind it */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* owner palette */
  --sky: #0593C6;
  --white: #FCFFFF;
  --pink: #D83995;
  /* derived in OKLab from the palette */
  --sea: #04679A;
  --deep: #00507C;
  --abyss: #00254D;
  --pink-deep: #A9207A;

  --ink: var(--white);
  --ink-soft: rgb(252 255 255 / 0.94);
  --ink-faint: rgb(252 255 255 / 0.86);
  --hair: rgb(252 255 255 / 0.26);

  --gutter: clamp(18px, 3.4vw, 48px);
  --rail: 0px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --f-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;

  color-scheme: dark;
  scrollbar-color: rgb(252 255 255 / 0.45) var(--deep);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
}
/* With a mouse or trackpad the page settles on its own pages (main.js);
   touch keeps the browser's snapping. */
@media (hover: hover) and (pointer: fine) { html { scroll-snap-type: none; } }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 450;
  color: var(--ink);
  background-color: var(--sea);
  background-image:
    repeating-linear-gradient(90deg,
      rgb(252 255 255 / 0) 0px,
      rgb(252 255 255 / 0.07) 7px,
      rgb(252 255 255 / 0) 13px,
      rgb(0 37 77 / 0.09) 22px,
      rgb(252 255 255 / 0) 28px),
    radial-gradient(26% 48% at 72% 40%, rgb(237 155 159 / 0.7), rgb(216 57 149 / 0.45) 50%, rgb(216 57 149 / 0) 100%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky) 22%, var(--sea) 58%, var(--deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  overflow-x: clip;
}

::selection { background: var(--pink); color: var(--white); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.24em; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: fixed; left: var(--gutter); top: 12px; z-index: 50;
  padding: 10px 16px; border-radius: 999px;
  background: var(--white); color: var(--abyss); font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}
.skip:focus-visible { transform: none; }

/* ───────── the pane ───────── */

.glass-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100lvh;
  z-index: -1;
  display: block;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.gl-ready .glass-canvas { opacity: 1; }
.no-gl .glass-canvas { display: none; }

/* ───────── the wordmark ───────── */

.wordmark,
.mark {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--f-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.82;
  white-space: nowrap;
}
.wm-word { display: inline-block; white-space: nowrap; }
.wm-reeds { position: absolute; pointer-events: none; }
.wm-slice {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  will-change: transform, opacity;
}
.wordmark:not(.is-crisp) .wm-word { color: transparent; }
.is-crisp .wm-reeds { visibility: hidden; }
.js .wordmark:not(.is-built) { opacity: 0; }

.wordmark {
  font-size: clamp(4rem, 18vw, 21rem);
  padding-right: 0.04em;
  cursor: default;
}

/* ───────── header and rail ───────── */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(22px, env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
  color: var(--white);
  transition: color 0.6s var(--ease-out);
}
.top > * { pointer-events: auto; }
/* After the cover the header stays, quietly: a soft shade behind it so the
   name and the address read over any room. */
.top::before {
  content: '';
  position: absolute;
  inset: 0 0 -36px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(0 10 25 / 0.22), rgb(0 10 25 / 0));
  opacity: 1;
  transition: opacity 0.6s var(--ease-out), background 0.6s var(--ease-out);
}
[data-ink-top="dark"] .top::before { background: linear-gradient(180deg, rgb(255 255 255 / 0.32), rgb(255 255 255 / 0)); }
[data-panel="0"] .top::before { opacity: 0; }

/* The logo in the header is the way back to top. On the cover the giant
   wordmark already says the name, so the header keeps only the mark. */
.mark {
  display: block;
  line-height: 0;
  text-decoration: none;
}
.mark-svg { display: block; height: 20px; width: auto; overflow: visible; }
.mark-word { transition: opacity 0.6s var(--ease-out); }
[data-panel="0"] .mark-word { opacity: 0; }

.top-mail {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.3s;
}
.top-mail:hover { text-decoration-color: currentColor; }

/* The rail: one tick per page, the current page named. */
.rail {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  z-index: 20;
  display: grid;
  gap: 2px;
  transform: translateY(-50%);
  color: var(--white);
  transition: color 0.6s var(--ease-out);
}
.rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 22px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}
.rail a::after {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  transform: scaleX(0.4);
  transform-origin: right center;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
}
.rail .label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.rail a[aria-current="true"]::after { transform: scaleX(1); opacity: 1; }
.rail a[aria-current="true"] .label,
.rail:hover .label,
.rail a:focus-visible .label { opacity: 1; transform: none; }
.rail:hover a:not([aria-current="true"]) .label { opacity: 0.86; }
.rail a:hover::after { opacity: 1; transform: scaleX(0.7); }

[data-ink-top="dark"] .top,
[data-ink-mid="dark"] .rail { color: var(--abyss); }

/* ───────── panels ───────── */

main { position: relative; z-index: 1; }

.panel {
  position: relative;
  min-height: 100svh;
  outline: none;
  scroll-snap-align: start;
  padding: 104px calc(var(--gutter) + var(--rail)) 56px var(--gutter);
}
.panel[data-ink="dark"] {
  color: var(--abyss);
  --ink-soft: rgb(0 37 77 / 0.92);
  --ink-faint: rgb(0 37 77 / 0.84);
  --hair: rgb(0 37 77 / 0.3);
}

h1, h2, h3 { margin: 0; font-weight: 400; }

/* hero */
.hero {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: clamp(84px, 13vh, 132px);
}
.hero .wordmark { grid-row: 1; justify-self: start; }
.hero-foot {
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 40px;
}
.statement,
.head,
.close-title {
  font-family: var(--f-sans);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.soft { font-weight: 300; }
.soft-all { font-weight: 300; }

/* Panels on a page are not all one size: a loud frame, a whispered one. */
.shot[data-size="loud"] .head {
  max-width: 11em;
  font-size: clamp(3.2rem, 8.4vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.042em;
}
.shot[data-size="loud"][data-side="center"] .head { max-width: 9em; }
.shot[data-size="quiet"] .head {
  max-width: 13em;
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.statement {
  margin: 0;
  max-width: 11em;
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
}

/* shots */
.shot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-content: center;
}
.shot-body { grid-column: 7 / -1; }
.shot[data-side="start"] .shot-body { grid-column: 1 / span 7; }
.shot[data-side="center"] .shot-body { grid-column: 2 / -2; text-align: center; }
.shot[data-side="center"] .head { margin-inline: auto; max-width: 12em; }
/* a caption low in the frame's corner, as on a comic page */
.shot[data-side="corner"] { align-content: end; }
.shot[data-side="corner"] .shot-body { grid-column: 1 / span 6; padding-bottom: clamp(24px, 6vh, 72px); }
/* a wide establishing frame: words up top, the floor below */
.shot[data-side="top"] { align-content: start; padding-top: clamp(110px, 17vh, 170px); }
.shot[data-side="top"] .shot-body { grid-column: 1 / span 7; }

/* On the silent page the words wait until the hand meets the glass. */
@media (prefers-reduced-motion: no-preference) {
  .js .panel[data-hold].is-active [data-r] {
    transition-delay: calc(var(--d, 0) * 110ms + 2300ms);
  }
}

/* Where a page states a fact, its source sits quietly in the corner. */
.source {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(18px, 3vh, 30px);
  margin: 0;
  max-width: min(80ch, 72vw);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-faint);
}
.source a {
  text-decoration: none;
  transition: color 0.3s;
}
.source a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
.source-k {
  margin-right: 0.5em;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.head {
  max-width: 10em;
  font-size: clamp(2.8rem, 6vw, 6rem);
}
.note {
  margin: clamp(22px, 3.6vh, 36px) 0 0;
  max-width: 26rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* contact */
.contact {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-content: start;
}
.contact-body {
  grid-column: 1 / span 7;
  min-height: calc(100svh - 244px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.close-title {
  max-width: 7em;
  font-size: clamp(3.2rem, 7.4vw, 7rem);
}
.close-note {
  margin: clamp(18px, 3vh, 28px) 0 0;
  max-width: 24rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.mail {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: clamp(28px, 5vh, 52px);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.12em;
  transition: background-size 0.6s var(--ease-out);
}
.mail:hover { background-size: 0% 1px; background-position: 100% 100%; }
.arrow {
  width: 0.7em; height: 0.7em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.45s var(--ease-out);
}
.mail:hover .arrow { transform: translate(0.08em, -0.08em); }

.foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.foot p { margin: 0; }
.foot-links { display: flex; gap: clamp(1rem, 2.4vw, 2rem); }
.foot-links a[data-soon] { text-decoration-style: dotted; }
.shot[data-side="center"] .note { margin-inline: auto; }
.foot a { text-decoration-color: rgb(252 255 255 / 0.4); }

/* ───────── arrival: words come through the glass as their panel lands ───────── */

@media (prefers-reduced-motion: no-preference) {
  .js [data-r] {
    opacity: 0;
    transform: translateY(0.6em);
    transition:
      opacity 0.7s var(--ease-out),
      transform 1s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 80ms + 140ms);
  }
  .js .panel.is-active [data-r] {
    opacity: 1;
    transform: none;
  }
}

/* ───────── without the glass: each panel keeps its room in flat colour ───────── */

.no-gl .panel[data-scene="read"] { background: linear-gradient(180deg, #2b1a5e, #130a2e); }
.no-gl .panel[data-scene="waiting"] { background: linear-gradient(180deg, #e2452c, #8a1c10); }
.no-gl .panel[data-scene="untouched"] { background: linear-gradient(180deg, #11151b, #07090d); }
.no-gl .panel[data-scene="child"] { background: linear-gradient(180deg, #1d1250, #0b0726); }
.no-gl .panel[data-scene="touch"] { background: linear-gradient(180deg, #33211a, #0c0705); }
.no-gl .panel[data-scene="nodata"] { background: linear-gradient(180deg, #16181e, #040405); }
.no-gl .panel[data-scene="sim"] { background: linear-gradient(180deg, #0b1626, #03070e); }
.no-gl .panel[data-scene="moving"] { background: linear-gradient(180deg, #eef8fc, #cfe8f3); }
.no-gl .panel[data-scene="ninetysix"],
.no-gl .panel[data-scene="fourdark"] { background: linear-gradient(180deg, #0b2e1d, #010a06); }
.no-gl .panel[data-scene="dexterity"] { background: linear-gradient(180deg, #1a1220, #08060b); }
.no-gl .panel[data-scene="money"] { background: linear-gradient(180deg, #c12a86, #8e1a68); }
.no-gl .panel[data-scene="roommap"] { background: linear-gradient(180deg, #25344a, #0a1019); }
.no-gl .panel[data-scene="safety"] { background: linear-gradient(180deg, #f4ecdc, #dccfb5); }
.no-gl .panel[data-scene="trust"] { background: linear-gradient(180deg, #0a3038, #031417); }
.no-gl .panel[data-scene="waymo"] { background: linear-gradient(180deg, #057fae, #00507c); }
.no-gl .panel[data-scene="alone"] { background: linear-gradient(180deg, #0f5a57, #05302d); }
.no-gl .panel[data-scene="practice"] { background: linear-gradient(180deg, #004468, #00254d); }
.no-gl .panel[data-scene="firstshift"] { background: linear-gradient(180deg, #2a33c4, #0e134a); }
.no-gl .panel[data-scene="close"] { background: linear-gradient(180deg, #b0237f, #7d1660); }

/* ───────── sizes ───────── */

@media (min-width: 1081px) {
  :root { --rail: 150px; }
}

@media (max-width: 1080px) {
  .rail { display: none; }
  .shot-body { grid-column: 4 / -1; }
  .shot[data-side="start"] .shot-body { grid-column: 1 / span 10; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .top-mail { font-size: 0.875rem; }
  .mark-svg { height: 18px; }

  .hero { padding-top: 92px; }
  .wordmark { font-size: 23vw; }
  .hero-foot { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }

  .shot { align-content: end; padding-bottom: 72px; }
  .shot-body,
  .shot[data-side="start"] .shot-body,
  .shot[data-side="center"] .shot-body,
  .shot[data-side="corner"] .shot-body,
  .shot[data-side="top"] .shot-body { grid-column: 1 / -1; }
  .shot[data-side="top"] { align-content: end; padding-top: 104px; }
  .shot[data-side="corner"] .shot-body { padding-bottom: 0; }
  .shot { padding-bottom: 96px; }
  .source { max-width: calc(100vw - 2 * var(--gutter)); font-size: 0.6875rem; }
  .head { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .statement { font-size: clamp(2.2rem, 10vw, 3rem); }
  .contact-body { grid-column: 1 / -1; min-height: calc(100svh - 290px); }
  .foot > a[href="#top"] { margin-left: auto; }
  .foot { flex-wrap: wrap; font-size: 0.75rem; }
}

/* ───────── title cards: headlines rise line by line through their own masks (titles.js) ───────── */

@media (prefers-reduced-motion: no-preference) {
  /* Each line's mask reaches past its line box, so descenders, accents and
     overhangs are never cut at rest; sideways it does not clip at all.
     clip-path leaves the layout alone. */
  .tt-mask { clip-path: inset(-0.2em -100vw -0.34em); }

  /* titles.js moves these itself, so the arrival above stands down for them */
  .js .panel [data-r].is-titled {
    opacity: 1;
    transform: none;
    transition: none;
  }
  /* the address keeps its underline's hover */
  .js .panel .mail.is-titled { transition: background-size 0.6s var(--ease-out); }
}
