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

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070314;
  --ink: #120818;
  --card: #160c22;
  --paper: #f6f1ea;
  --muted: #d2c6e0;
  --cyan: #7af6ff;
  --magenta: #ff4fd8;
  --line: rgba(255, 79, 216, 0.32);
  --line-strong: rgba(122, 246, 255, 0.62);
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.22) 0px,
      rgba(0, 0, 0, 0.22) 1px,
      transparent 1px,
      transparent 4px
    ),
    url("/assets/vapor-grid.svg"),
    url("/assets/vapor-sky.svg");
  background-size: auto, 100% 54%, cover;
  background-position: 0 0, center bottom, center top;
  background-repeat: repeat, no-repeat, no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 16%, transparent 0%, transparent 26%, rgba(5, 2, 12, 0.38) 76%),
    linear-gradient(90deg, rgba(61, 240, 255, 0.14), transparent 10%, transparent 90%, rgba(255, 79, 216, 0.16));
}

.sheet {
  width: min(100% - 1.5rem, 28.5rem);
  margin-inline: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: max(1rem, env(safe-area-inset-top));
  position: relative;
  z-index: 1;
}

.sheet.sheet-home {
  width: 100%;
  max-width: none;
}

.sheet.sheet-home .topbar,
.sheet.sheet-home .hero,
.sheet.sheet-home .site-footer {
  width: min(100% - 1.5rem, 34rem);
  margin-inline: auto;
}

.sheet.sheet-home .topbar,
.sheet.sheet-home .site-footer {
  width: min(100% - 1.5rem, 76rem);
}

main {
  flex: 1;
}

a {
  color: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

::selection {
  background: var(--magenta);
  color: #1a0612;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-160%);
  padding: 0.4rem 0.65rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  text-decoration: none;
  z-index: 80;
}

.skip:focus {
  transform: none;
}

.sky-gap {
  height: clamp(4.25rem, 16vh, 8.5rem);
}

@media (max-width: 959px) {
  .sky-gap {
    height: clamp(1.15rem, 6vh, 2.4rem);
  }
}

.topbar {
  position: sticky;
  top: max(0.65rem, env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 2.75rem;
  margin-top: 0;
  padding: 0.4rem 0.55rem 0.4rem 0.4rem;
  border: 1px solid rgba(255, 79, 216, 0.38);
  border-radius: 14px;
  /* No backdrop-filter: the sky behind the bar animates, so a blur here was
     recomputed every frame. A denser fill gives the same frosted read. */
  background: rgba(10, 5, 19, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(122, 246, 255, 0.22),
    0 0 0 1px rgba(122, 246, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(255, 79, 216, 0.12);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  pointer-events: none;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.85rem;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a[aria-current="page"] {
  color: var(--cyan);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 2px #000, 0 0 16px rgba(122, 246, 255, 0.35);
}

.mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 3px;
  background: rgba(12, 6, 20, 0.88);
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(255, 79, 216, 0.55),
    0 0 22px rgba(255, 79, 216, 0.4),
    0 0 14px rgba(122, 246, 255, 0.22);
}

.hero,
.page {
  position: relative;
  margin-top: 0.85rem;
  padding: 1.15rem 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(28, 10, 40, 0.92), rgba(12, 6, 20, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(122, 246, 255, 0.28),
    0 0 0 1px rgba(122, 246, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.34);
}

.hero {
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  width: 78%;
  height: 90%;
  left: 11%;
  top: -28%;
  background: radial-gradient(
    ellipse at var(--hx, 50%) var(--hy, 38%),
    rgba(255, 79, 216, 0.32),
    rgba(122, 246, 255, 0.1) 42%,
    transparent 70%
  );
}

.hero::after {
  inset: 0;
  background:
    linear-gradient(
      104deg,
      transparent 0%,
      transparent 16%,
      rgba(122, 246, 255, 0.16) 16.35%,
      transparent 16.9%,
      transparent 80%,
      rgba(255, 79, 216, 0.18) 80.35%,
      transparent 81%
    );
  mask-image: linear-gradient(to bottom, #000 10%, transparent 78%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1,
.page h1 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: 3.15rem;
  letter-spacing: -0.035em;
  line-height: 0.92;
  color: var(--paper);
}

.hero h1 {
  text-shadow:
    0 0 18px rgba(122, 246, 255, 0.4),
    0 0 42px rgba(255, 79, 216, 0.22);
}

.hero .eyebrow {
  margin-bottom: 0.2rem;
}

.rule {
  width: 4.5rem;
  height: 2px;
  margin: 0.85rem auto 0.9rem;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
}

.role,
.lede {
  margin: 0 auto;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-wrap: balance;
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.action {
  min-width: 5.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(8, 4, 16, 0.55);
  color: var(--paper);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.action-primary {
  border-color: #ffd2f4;
  background: linear-gradient(180deg, #ff7ae4, #e2189a);
  color: #1a0612;
  font-weight: 500;
  box-shadow: 0 0 18px rgba(255, 79, 216, 0.4);
}

.work-section h2 {
  width: fit-content;
  margin: 0;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: rgba(8, 4, 16, 0.78);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.work {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(122, 246, 255, 0.16);
}

/* Pointer glow. A fixed size gradient that moves by transform, so following
   the mouse is a compositor move instead of a repaint. Starts top center. */
.card::before {
  content: "";
  position: absolute;
  left: calc(50% - 420px);
  top: -420px;
  width: 840px;
  height: 840px;
  background: radial-gradient(
    circle 420px at center,
    rgba(122, 246, 255, 0.2),
    rgba(255, 79, 216, 0.07) 34%,
    transparent 52%
  );
  transform: translate3d(var(--glow-x, 0px), var(--glow-y, 0px), 0);
  opacity: 0;
  pointer-events: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.16rem 0.5rem 0.14rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--paper);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.pip {
  width: 0.38rem;
  height: 0.38rem;
  border: 1px solid currentColor;
  border-radius: 1px;
}

.status-live {
  color: var(--cyan);
  border-color: rgba(122, 246, 255, 0.7);
}

.status-live .pip {
  background: currentColor;
}

.status-play {
  color: #b6ffd4;
  border-color: rgba(120, 255, 186, 0.75);
}

.status-play .pip {
  background: currentColor;
}

.card h3 {
  margin: 0.62rem 0 0.28rem;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.index {
  margin-right: 0.45rem;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0;
  position: relative;
  top: -0.08em;
}

.card p,
.page p,
.spec {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.page p {
  margin: 0 0 0.95rem;
  font-size: 0.84rem;
  line-height: 1.6;
}

.visit {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--cyan);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
  margin-top: 1.15rem;
  padding: 0.95rem 0.15rem calc(1.2rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 79, 216, 0.28);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
  text-shadow: 0 1px 2px #000;
}

.site-footer p {
  margin: 0;
}

.site-footer a,
.page a {
  color: var(--paper);
  text-decoration: none;
}

.site-footer a:hover,
.page a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.site-nav a[aria-current="page"] {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.page h1 {
  margin: 0 0 0.85rem;
  font-size: 2.2rem;
  text-align: left;
}

.page code,
.card code {
  font-family: inherit;
  font-size: 0.92em;
  color: var(--cyan);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--magenta);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.spec {
  margin: 0.95rem 0 0;
  padding: 0;
  list-style: none;
}

.spec li + li {
  margin-top: 0.45rem;
}

kbd {
  display: inline-block;
  margin-right: 0.2rem;
  padding: 0.05rem 0.35rem 0.02rem;
  border: 1px solid rgba(122, 246, 255, 0.55);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--paper);
  font-family: inherit;
  font-size: 0.78em;
}

.callout {
  margin: 1rem 0 0;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(255, 79, 216, 0.55);
  border-radius: 12px;
  background: rgba(255, 47, 155, 0.1);
}

.callout p {
  margin: 0;
  color: var(--paper);
}

@media (hover: hover) {
  .action:hover,
  .action:active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--ink);
  }

  .action-primary:hover,
  .action-primary:active {
    background: var(--cyan);
    border-color: #e7fdff;
    color: var(--ink);
  }

  .card:hover {
    border-color: var(--cyan);
    box-shadow:
      inset 0 1px 0 rgba(122, 246, 255, 0.3),
      0 0 18px rgba(122, 246, 255, 0.12),
      0 0 22px rgba(255, 79, 216, 0.1);
  }

  .mark:hover {
    background: var(--cyan);
    color: var(--ink);
  }

  .topnav a:hover {
    color: var(--cyan);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover::before {
    opacity: 1;
  }

  .card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
      115deg,
      transparent 36%,
      rgba(122, 246, 255, 0.13) 48%,
      rgba(255, 79, 216, 0.1) 54%,
      transparent 66%
    );
    transform: translateX(-130%);
    pointer-events: none;
  }

  .card:hover::after {
    transform: translateX(130%);
    transition: transform 720ms linear;
  }

  .card:hover h3 {
    text-shadow: 0 0 10px rgba(122, 246, 255, 0.4);
  }
}

.card:active {
  border-color: var(--cyan);
}

@media (min-width: 800px) {
  .hero h1 {
    font-size: 3.45rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .action,
  .mark {
    transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
  }

  /* The rule's color sweep moves a wider gradient by transform instead of
     animating background-position, which repainted every frame. */
  .hero .rule {
    position: relative;
    overflow: hidden;
    background: none;
  }

  .hero .rule::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 200%;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
    animation: rule-shift 7.5s ease-in-out infinite;
  }

  .hero::after {
    animation: beam-glow 8.5s ease-in-out infinite;
  }

  .status-live .pip,
  .status-play .pip {
    animation: pip-pulse 3.6s ease-in-out infinite;
  }
}

@keyframes rule-shift {
  0%,
  100% { transform: translateX(0); }
  50% { transform: translateX(-50%); }
}

@keyframes beam-glow {
  0%,
  100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes pip-pulse {
  0%,
  100% { opacity: 0.45; }
  50% { opacity: 1; }
}

html.scene-live body::before {
  background: url("/assets/vapor-sky-live.svg") center top / cover no-repeat;
}

html.scene-live body::after {
  opacity: 0;
}

html.scene-live .site-footer {
  text-shadow: 0 1px 2px #000, 0 0 8px #000;
}

.scene,
.scene-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.scene {
  z-index: 0;
  overflow: hidden;
}

.scene-grid {
  z-index: 2;
  display: block;
  /* Only the visible floor: the top 36% of the screen was always masked out.
     Same mask as before, with the stops mapped onto this shorter box.
     Keep top in sync with GRID_TOP in js/scene.js. */
  top: 36%;
  height: 64%;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.42) 18.75%, rgba(0, 0, 0, 0.78) 53.125%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.42) 18.75%, rgba(0, 0, 0, 0.78) 53.125%, #000 100%);
}

.scene-stars,
.scene-matrix,
.scene-planets,
.scene-vignette,
.scene-scan {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.scene-vignette {
  background:
    radial-gradient(ellipse at 50% 16%, transparent 0%, transparent 26%, rgba(5, 2, 12, 0.38) 76%),
    linear-gradient(90deg, rgba(61, 240, 255, 0.14), transparent 10%, transparent 90%, rgba(255, 79, 216, 0.16));
}

.scene-scan {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 4px
  );
}

.sky-body {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.sun-glow {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 140, 0.5) 0%, rgba(255, 77, 138, 0.16) 42%, transparent 70%);
  mix-blend-mode: screen;
}

.planet-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148%;
  height: 29%;
  border: 2px solid rgba(255, 79, 216, 0.62);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 79, 216, 0.22);
  transform: translate(-50%, -50%) rotate(-16deg);
}

.planet-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #12061f;
  box-shadow: 0 0 14px rgba(90, 50, 180, 0.28);
}

.planet-bands,
.planet-haze,
.planet-light,
.planet-lat {
  position: absolute;
  inset: 0;
}

/* Bands and haze are one pattern period wider than the planet and slide by
   transform, so the spin never repaints. */
.planet-bands {
  left: -64px;
  background: repeating-linear-gradient(
    90deg,
    #241246 0 10px,
    #6a48e0 10px 16px,
    #d7ccff 16px 19px,
    #3a1d78 19px 34px,
    #1a0b2e 34px 48px,
    #ff4fd8 48px 52px,
    #2a1468 52px 64px
  );
}

.planet-haze {
  left: -52px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 18px,
    rgba(255, 210, 245, 0.2) 18px 28px,
    transparent 28px 52px
  );
  opacity: 0.55;
}

.planet-light {
  background: radial-gradient(
    circle at 36% 34%,
    rgba(210, 198, 255, 0.62) 0%,
    rgba(109, 77, 255, 0.28) 32%,
    rgba(42, 20, 104, 0.08) 62%,
    rgba(8, 2, 16, 0.72) 100%
  );
}

.planet-lat {
  inset: auto 0;
  top: 34%;
  height: 20%;
  border: 1.5px solid rgba(228, 217, 255, 0.5);
  border-radius: 50%;
}

.moon-disc,
.moon-spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.moon-disc {
  background: #e7fdff;
  box-shadow: 0 0 8px rgba(231, 253, 255, 0.4);
}

.moon-cut {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(18, 6, 31, 0.62);
  transform: translate(-26%, -14%);
}

@media (prefers-reduced-motion: no-preference) {
  .planet-bands {
    animation: spin-bands 34s linear infinite;
  }

  .planet-haze {
    animation: spin-haze 56s linear infinite reverse;
  }

  .planet-ring {
    animation: ring-wobble 22s ease-in-out infinite;
  }

  .moon-spin {
    animation: moon-spin 76s linear infinite;
  }

  .sun-glow {
    animation: sun-pulse 11s ease-in-out infinite;
  }
}

@keyframes spin-bands {
  from { transform: translateX(0); }
  to { transform: translateX(64px); }
}

@keyframes spin-haze {
  from { transform: translateX(0); }
  to { transform: translateX(52px); }
}

@keyframes ring-wobble {
  0%,
  100% { transform: translate(-50%, -50%) rotate(-18deg); }
  50% { transform: translate(-50%, -50%) rotate(-13deg); }
}

@keyframes moon-spin {
  to { transform: rotate(360deg); }
}

@keyframes sun-pulse {
  0%,
  100% { opacity: 0.2; }
  50% { opacity: 0.46; }
}

@media (prefers-reduced-motion: reduce) {
  html.scene-live body::before {
    background-image:
      repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.22) 0px,
        rgba(0, 0, 0, 0.22) 1px,
        transparent 1px,
        transparent 4px
      ),
      url("/assets/vapor-grid.svg"),
      url("/assets/vapor-sky.svg");
    background-size: auto, 100% 54%, cover;
    background-position: 0 0, center bottom, center top;
    background-repeat: repeat, no-repeat, no-repeat;
  }

  html.scene-live body::after {
    opacity: 1;
  }

  .scene,
  .scene-grid {
    display: none;
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 0.4rem;
    padding: 0.32rem 0.45rem 0.32rem 0.35rem;
  }

  .brand {
    font-size: 1.12rem;
  }

  .mark {
    width: 2.15rem;
    height: 2.15rem;
  }

  .topnav {
    flex-wrap: nowrap;
    width: auto;
    justify-content: flex-end;
    gap: 0.15rem 0.4rem;
    padding-left: 0;
    font-size: 0.58rem;
    letter-spacing: 0.03em;
  }

  .topnav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
  }
}

@media (max-width: 360px) {
  .sheet {
    width: min(100% - 1.25rem, 28.5rem);
  }

  .hero h1,
  .page h1 {
    font-size: 2.75rem;
  }

  .page h1 {
    font-size: 2rem;
  }
}

.work-section {
  display: grid;
  grid-template-columns: 1fr min(calc(100% - 1.5rem), 76rem) 1fr;
  margin-top: 1.5rem;
  align-items: end;
}

.work-section > h2 {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: end;
  margin: 0 0 0.85rem;
}

.carousel-tools {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
}

.carousel-viewport {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.carousel-foot {
  grid-column: 2;
  grid-row: 3;
  margin-top: 0.15rem;
}

.carousel-count {
  margin: 0;
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000;
}

.carousel-arrows {
  display: flex;
  gap: 0.4rem;
}

.carousel-arrow {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(122, 246, 255, 0.55);
  border-radius: 999px;
  background: rgba(8, 4, 16, 0.72);
  color: var(--paper);
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.16);
  cursor: pointer;
}

.carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.carousel-track {
  --card-w: min(78rem, 70vw);
  --card-h: clamp(23rem, 58vh, 33rem);
  --pad: max(1rem, calc((100% - min(78rem, 70vw)) / 2));
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1.25rem;
  margin: 0;
  padding: 1.35rem var(--pad) 1.7rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  min-width: 0;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  scroll-snap-align: center;
  display: flex;
  min-width: 0;
}

.carousel-track.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}

.carousel-track.is-dragging .card {
  cursor: grabbing;
}

@media (hover: hover) and (pointer: fine) {
  .carousel-track {
    cursor: grab;
  }
}

.carousel-slide .card {
  --accent: var(--cyan);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--card-h);
  min-height: var(--card-h);
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 79, 216, 0.38);
  border-top: 2px solid var(--accent);
  background:
    linear-gradient(180deg, rgba(28, 12, 42, 0.96), rgba(10, 5, 18, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(122, 246, 255, 0.2),
    0 18px 40px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  -webkit-user-drag: none;
  user-select: none;
}

.card-briefing { --accent: #7af6ff; }
.card-doc { --accent: #ff4fd8; }
.card-energy { --accent: #9af7ff; }
.card-living { --accent: #d7c4ff; }
.card-ufo { --accent: #7dffb2; }
.card-penta { --accent: #ff4fd8; }

.carousel-slide.is-active .card {
  border-color: rgba(122, 246, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(122, 246, 255, 0.38),
    0 0 0 1px rgba(255, 79, 216, 0.28),
    0 22px 50px rgba(0, 0, 0, 0.46),
    0 0 36px rgba(122, 246, 255, 0.16),
    0 0 64px rgba(255, 79, 216, 0.12);
}

.carousel-slide.is-active .card::before {
  opacity: 0.85;
}

.carousel-slide .card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -4px;
}

.card-stage {
  position: relative;
  flex: 0 0 42%;
  min-height: 9.5rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(122, 246, 255, 0.16);
  background:
    radial-gradient(circle at 50% 30%, rgba(122, 246, 255, 0.16), transparent 58%),
    linear-gradient(160deg, rgba(255, 79, 216, 0.16), rgba(8, 4, 16, 0.1) 62%);
}

.card-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0 1px,
    transparent 1px 4px
  );
  opacity: 0.45;
  pointer-events: none;
}

.card-stage > * {
  pointer-events: none;
}

.watermark {
  position: absolute;
  right: 0.7rem;
  bottom: 0.15rem;
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 7vw, 5.6rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(122, 246, 255, 0.45);
}

.card-copy {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  padding: 1.15rem 1.15rem 1.2rem;
}

.carousel-slide .status {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem 0.24rem;
}

.carousel-slide .card h3 {
  margin: 0.15rem 0 0;
  max-width: 14ch;
  font-size: clamp(2.6rem, 11vw, 3.35rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
}

.carousel-slide .card p {
  margin: 0;
  max-width: 28rem;
  font-size: 1.02rem;
  line-height: 1.45;
}

.carousel-slide .visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  min-height: 2.85rem;
  min-width: 8.5rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(122, 246, 255, 0.55);
  border-radius: 999px;
  background: rgba(8, 4, 16, 0.45);
  color: var(--cyan);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  width: fit-content;
}

.carousel-slide.is-active .visit {
  background: linear-gradient(180deg, rgba(122, 246, 255, 0.16), rgba(255, 79, 216, 0.12));
  box-shadow: 0 0 16px rgba(122, 246, 255, 0.16);
}

.carousel-dots {
  display: none;
  justify-content: center;
  gap: 0;
  margin: 0.15rem 0 0;
}

.dot {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dot::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(210, 198, 224, 0.45);
}

.dot[aria-current="true"]::before {
  width: 1.4rem;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(122, 246, 255, 0.75);
}

.carousel-progress {
  height: 2px;
  margin: 0.45rem 0 0;
  border-radius: 99px;
  background: rgba(255, 79, 216, 0.28);
  overflow: hidden;
}

.carousel-progress span {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 10px rgba(122, 246, 255, 0.55);
}

.stage-briefing .sun {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  top: 14%;
  left: 33%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff4d2, #ffb15a 40%, #ff4fd8 70%, transparent 72%);
  box-shadow: 0 0 36px rgba(255, 79, 216, 0.5);
}

.stage-briefing .horizon {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
}

.stage-briefing .bars {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 12%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.45rem;
  height: 22%;
}

.stage-briefing .bars i {
  display: block;
  width: 0.55rem;
  height: 100%;
  background: linear-gradient(to top, rgba(122, 246, 255, 0.08), var(--cyan));
  box-shadow: 0 0 10px rgba(122, 246, 255, 0.35);
}

.stage-briefing .bars i:nth-child(1) { height: 42%; }
.stage-briefing .bars i:nth-child(2) { height: 78%; }
.stage-briefing .bars i:nth-child(3) { height: 55%; }
.stage-briefing .bars i:nth-child(4) { height: 100%; }
.stage-briefing .bars i:nth-child(5) { height: 64%; }

.stage-doc .sheetlet {
  position: absolute;
  width: 42%;
  height: 58%;
  left: 29%;
  top: 18%;
  border-radius: 10px;
  border: 1px solid rgba(122, 246, 255, 0.45);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 12px,
      rgba(122, 246, 255, 0.28) 12px 13px
    ),
    rgba(16, 8, 28, 0.8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.stage-doc .s1 { transform: rotate(-10deg) translate(-18%, 6%); }
.stage-doc .s2 { border-color: rgba(255, 79, 216, 0.7); }
.stage-doc .s3 { transform: rotate(8deg) translate(16%, -4%); }

.stage-energy .eq {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 18%;
  height: 58%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.4rem;
}

.stage-energy .eq i {
  display: block;
  width: 0.55rem;
  height: 100%;
  border-radius: 99px 99px 2px 2px;
  background: linear-gradient(to top, var(--magenta), var(--cyan));
  box-shadow: 0 0 12px rgba(122, 246, 255, 0.35);
  transform-origin: center bottom;
}

.stage-energy .eq i:nth-child(1) { height: 35%; }
.stage-energy .eq i:nth-child(2) { height: 70%; }
.stage-energy .eq i:nth-child(3) { height: 48%; }
.stage-energy .eq i:nth-child(4) { height: 100%; }
.stage-energy .eq i:nth-child(5) { height: 62%; }
.stage-energy .eq i:nth-child(6) { height: 84%; }
.stage-energy .eq i:nth-child(7) { height: 40%; }
.stage-energy .eq i:nth-child(8) { height: 76%; }

.stage-living .blob {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  left: 33%;
  top: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #f4e9ff, #8a6cff 45%, #2a1468 72%);
  box-shadow: 0 0 28px rgba(176, 140, 255, 0.45);
}

.stage-living .orbit {
  position: absolute;
  left: 50%;
  top: 46%;
  border: 1.5px solid rgba(122, 246, 255, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.stage-living .o1 { width: 58%; height: 28%; }
.stage-living .o2 {
  width: 78%;
  height: 40%;
  border-color: rgba(255, 79, 216, 0.5);
}

.stage-ufo .beam {
  position: absolute;
  left: 32%;
  right: 32%;
  top: 42%;
  height: 42%;
  background: linear-gradient(to bottom, rgba(125, 255, 178, 0.45), transparent);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}

.stage-ufo .saucer {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 40%;
  height: 16%;
  border-radius: 50%;
  background: linear-gradient(90deg, #16324a, #b6ffd4 48%, #123, #7af6ff);
  box-shadow: 0 0 18px rgba(125, 255, 178, 0.4);
}

.stage-ufo .dome {
  position: absolute;
  width: 22%;
  height: 18%;
  left: 39%;
  top: 26%;
  border-radius: 50% 50% 8px 8px;
  background: radial-gradient(circle at 40% 40%, #e7fdff, #3ad7c5 70%);
  box-shadow: 0 0 16px rgba(122, 246, 255, 0.45);
}

.stage-penta .frame {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 42%;
  aspect-ratio: 1;
  border: 1.5px solid rgba(122, 246, 255, 0.7);
  transform: translate(-50%, -50%) rotate(18deg);
  box-shadow: 0 0 16px rgba(122, 246, 255, 0.2);
}

.stage-penta .f2 {
  width: 58%;
  border-color: rgba(255, 79, 216, 0.65);
  transform: translate(-50%, -50%) rotate(42deg);
}

.stage-penta .f3 {
  width: 28%;
  border-color: #f6f1ea;
  transform: translate(-50%, -50%) rotate(70deg);
}

#work {
  scroll-margin-top: 5.5rem;
}

@media (min-width: 960px) {
  .carousel-slide .card {
    flex-direction: row;
    border-top-width: 1px;
    border-left: 3px solid var(--accent);
  }

  .card-copy {
    order: 1;
  }

  .card-stage {
    order: 2;
    flex: 0 0 44%;
    min-height: 0;
    border-bottom: 0;
    border-left: 1px solid rgba(122, 246, 255, 0.16);
  }

  .card-copy {
    padding: 1.6rem 1.45rem 1.55rem 1.75rem;
  }

  .carousel-slide .card h3 {
    max-width: 12ch;
    font-size: clamp(3rem, 4vw, 4.15rem);
  }

  .carousel-slide .status {
    margin-bottom: auto;
  }

  .carousel-slide .visit {
    margin-top: 1.15rem;
  }

  .carousel-track {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
}

@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .carousel-slide .card {
    opacity: 0.7;
    transform: scale(0.94);
    transition: transform 520ms cubic-bezier(0.22, 0.7, 0.2, 1), opacity 420ms linear;
  }

  /* While the pointer is on the active card, tilt follows it directly.
     A long transform transition there made the card lag behind the mouse. */
  .carousel-slide.is-active .card:hover {
    transition: transform 90ms linear, opacity 420ms linear;
  }

  .carousel-slide.is-before .card {
    transform: perspective(1200px) rotateY(8deg) scale(0.94);
  }

  .carousel-slide.is-after .card {
    transform: perspective(1200px) rotateY(-8deg) scale(0.94);
  }

  .carousel-slide.is-active .card {
    opacity: 1;
    transform: perspective(1200px) rotateX(var(--lift, 0deg)) rotateY(var(--tilt, 0deg)) scale(1);
  }
}

@media (max-width: 959px) {
  .work-section > h2 {
    margin-bottom: 0.7rem;
  }

  .carousel-tools {
    grid-row: 4;
    justify-self: stretch;
    justify-content: space-between;
    margin: 0.35rem 0 0;
  }

  .carousel-foot {
    grid-row: 3;
  }

  .carousel-dots {
    display: flex;
  }

  .carousel-arrow {
    width: 3.4rem;
    height: 3.4rem;
  }

  .carousel-track {
    --card-w: calc(100vw - 5.75rem);
    --card-h: clamp(26rem, 68dvh, 34rem);
    --pad: 0.7rem;
    gap: 0.7rem;
    padding: 0.45rem var(--pad) 0.85rem;
    scroll-padding-inline: var(--pad);
    mask-image: none;
  }

  .carousel-slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .carousel-slide .card {
    border-left: 3px solid var(--accent);
  }

  .carousel-slide .visit {
    width: 100%;
    min-height: 3.25rem;
  }

  .carousel-slide:not(.is-active) .card {
    opacity: 0.94;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .carousel-progress span {
    transition: width 320ms ease;
  }

  .stage-energy .eq i {
    animation: eq-bounce 1.8s ease-in-out infinite;
  }

  .stage-energy .eq i:nth-child(2) { animation-delay: -0.2s; }
  .stage-energy .eq i:nth-child(3) { animation-delay: -0.55s; }
  .stage-energy .eq i:nth-child(4) { animation-delay: -0.9s; }
  .stage-energy .eq i:nth-child(5) { animation-delay: -1.2s; }
  .stage-energy .eq i:nth-child(6) { animation-delay: -0.4s; }
  .stage-energy .eq i:nth-child(7) { animation-delay: -1.5s; }
  .stage-energy .eq i:nth-child(8) { animation-delay: -0.75s; }

  .stage-ufo .saucer,
  .stage-ufo .dome {
    animation: saucer-bob 4.8s ease-in-out infinite;
  }

  .stage-living .o1 { animation: orbit-spin 28s linear infinite; }
  .stage-living .o2 { animation: orbit-spin 40s linear infinite reverse; }
  .stage-penta .f2 { animation: frame-spin 36s linear infinite; }
  .stage-briefing .sun { animation: sun-pulse 8s ease-in-out infinite; }
}

/* Set by js/motion.js while a block is out of view. */
.is-offscreen,
.is-offscreen::before,
.is-offscreen::after,
.is-offscreen *,
.is-offscreen *::before,
.is-offscreen *::after {
  animation-play-state: paused !important;
}

@keyframes eq-bounce {
  0%,
  100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

@keyframes saucer-bob {
  0%,
  100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@keyframes orbit-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes frame-spin {
  to { transform: translate(-50%, -50%) rotate(402deg); }
}

@media (hover: hover) {
  .carousel-arrow:hover:not(:disabled) {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--ink);
  }

  .brand:hover {
    color: var(--cyan);
  }
}

@media (prefers-contrast: more) {
  :root {
    --paper: #fff;
    --muted: #f3e9ff;
  }

  .hero,
  .page,
  .card {
    background: #0c0614;
  }
}
