@font-face {
  font-family: Rajdhani;
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/rajdhani-light.ttf') format('truetype');
}

/* Design tokens */
:root {
  --ink: #0a0908;
  --ink-2: #12100d;
  --paper: #ece6da;
  --muted: #aaa397;
  --dim: #77726a; /* large text only */
  --steel: #8fb0c9;
  --alert: #ffab9c; /* error text, 9:1 on the background */
  --line: rgba(236, 230, 218, 0.16);
  --display: Rajdhani, 'Avenir Next Condensed', 'Arial Narrow', ui-sans-serif, system-ui, sans-serif;
  --serif: ui-serif, 'New York', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --gut: clamp(1.25rem, 5vw, 4.5rem);
  --max: 80rem;
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: clamp(5rem, 14vh, 9rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none; /* no sideways bounce on phones */
}

main {
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote,
pre {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

em {
  font-style: italic;
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--steel);
}

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

img,
video {
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

::selection {
  background: var(--steel);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gut) * 2);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}

.skip {
  position: fixed;
  top: var(--s-1);
  left: var(--s-1);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* Analog grain over everything */
/* The grain layer is cut to the screen: an oversized fixed layer would let phones scroll sideways.
   The moving texture is a larger layer inside it, shifted with --gx / --gy. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.085;
}

.grain::before {
  content: '';
  position: absolute;
  inset: -16rem;
  background: url('../img/analog-grain.png') 0 0 / 192px;
  transform: translate(var(--gx, 0), var(--gy, 0));
}

/* Reading progress: the thread across the top */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 2px;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--steel);
  transform: scaleX(var(--page, 0));
  transform-origin: 0 50%;
}

/* Header */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0.6rem var(--gut) 1.6rem;
  padding-top: max(0.6rem, env(safe-area-inset-top));
  background: linear-gradient(rgba(5, 4, 4, 0.97) 58%, rgba(5, 4, 4, 0));
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.top a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.top a:hover,
.top a[aria-current='true'] {
  color: var(--paper);
}

.top a[aria-current='true'] {
  text-decoration: underline;
  text-decoration-color: var(--steel);
  text-underline-offset: 0.5em;
  text-decoration-thickness: 1px;
}

.top .mark {
  margin-left: -0.35rem;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: var(--paper);
}

.top ul {
  display: flex;
  gap: clamp(0rem, 1.6vw, 1.5rem);
  margin-right: -0.35rem;
}

@media (max-width: 30rem) {
  .top {
    font-size: 0.625rem;
    letter-spacing: 0.04em;
  }

  .top a {
    padding-inline: 0.3rem;
  }

  .top .mark {
    margin-left: -0.3rem;
  }

  .top ul {
    margin-right: -0.3rem;
  }
}

/* Minimap: a code editor's scroll map. Mouse-only extra; the header links are the real navigation. */
.rail {
  display: none;
}

@media (min-width: 60rem) and (hover: hover) {
  .js .rail {
    display: block;
    position: fixed;
    top: 22vh;
    right: 0.9rem;
    bottom: 22vh;
    z-index: 30;
    width: 1px;
    background: var(--line);
  }

  .rail__thumb {
    position: absolute;
    left: -2px;
    width: 5px;
    background: var(--steel);
  }

  .rail a {
    position: absolute;
    right: 0;
    padding: 0.2rem 0.9rem 0.2rem 0.5rem;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: transparent;
    transition: color 0.2s;
  }

  .rail a::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -3px;
    width: 7px;
    height: 1px;
    background: var(--paper);
  }

  .rail:hover a {
    color: var(--muted);
  }

  .rail a:hover {
    color: var(--paper);
  }
}

/* ---------- Opening ---------- */
.hero {
  position: relative;
  height: 230vh;
  height: 230svh;
  background: #000;
}

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero__media,
.hero__photo,
.hero__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__media {
  opacity: calc(1 - var(--out, 0) * 0.8);
}

/* The code field: one fixed WebGL canvas that the opening and the chapter gates draw into */
.field {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  visibility: hidden;
  pointer-events: none;
}

.field.on {
  visibility: visible;
}

.gl .hero {
  background: none;
}

.gl .hero__media {
  opacity: 1;
}

.gl .hero__photo {
  opacity: 0;
}

.gate {
  display: none;
}

.gl .gate {
  display: block;
  height: 210vh;
  height: 210svh;
}

.gl .thread--gate {
  display: none;
}

.gate__stage {
  position: sticky;
  top: 0;
  /* The visible screen as it is right now, so the title sits in its middle on phones whether
     or not the browser's toolbar is showing. */
  height: 100vh;
  height: 100dvh;
}

.gate__tag {
  position: absolute;
  top: 5.5rem;
  left: var(--gut);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--steel);
  opacity: clamp(0, min(var(--g, 0) * 8, (0.62 - var(--g, 0)) * 8), 1);
}

/* Headings appear as their own source line, then render */
.compile {
  position: relative;
}

.compile__src {
  display: none;
}

.compile__out {
  display: block;
}

.js .compile__src {
  display: block;
  position: absolute;
  inset: 0.35em 0 auto 0;
  font-family: var(--mono);
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.9375rem);
  font-style: normal;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  color: var(--steel);
  opacity: calc(1 - var(--r, 1) * 1.6);
}

.js .compile__src .rest {
  visibility: hidden;
}

.js .compile__out {
  clip-path: inset(-0.2em calc((1 - var(--r, 1)) * 100%) -0.35em -0.1em);
}

.hero__media {
  top: 3.5rem;
  height: auto;
}

.hero__photo img {
  object-fit: cover;
  object-position: 50% 0;
}

.hero__shade {
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82) 62%, #000);
}

.hero__copy {
  position: absolute;
  inset: auto 0 0;
  padding-bottom: max(clamp(1.75rem, 6vh, 4rem), env(safe-area-inset-bottom));
  transform: translateY(calc(var(--out, 0) * -8vh));
  opacity: calc(1 - var(--out, 0) * 1.5);
}

.hero h1 {
  margin: 0.5rem 0 0.8rem -0.03em;
  font-size: clamp(2.6rem, 13.6vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__lede {
  max-width: 34ch;
  font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.5rem);
  line-height: 1.35;
}

.hero__hint {
  margin-top: var(--s-3);
  max-width: 44ch;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Tall, narrow screens: head and shoulders on top, name right below it.
   Nothing important sits at the very bottom, where phone browser toolbars cover the page. */
@media (max-aspect-ratio: 4/5) {
  .hero__media {
    bottom: auto;
    height: 50%;
  }

  .hero__shade {
    inset: 36% 0 0;
    background: linear-gradient(rgba(0, 0, 0, 0), #000 20%);
  }

  .hero__copy {
    inset: 47% 0 auto;
    padding-bottom: 0;
  }
}

/* Wide screens: portrait on the right with the whole head in frame, name stacked on the left */
@media (min-width: 60rem) and (min-aspect-ratio: 1/1) {
  .hero__media {
    top: 4.25rem;
    left: 38%;
    width: auto;
  }

  .hero__photo {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%);
    mask-image: linear-gradient(90deg, transparent, #000 20%);
  }

  .hero__shade {
    inset: 62% 0 0;
    background: linear-gradient(rgba(0, 0, 0, 0), #000);
  }

  .hero__copy {
    inset: 50% 0 auto;
    padding-bottom: 0;
    transform: translateY(calc(-46% + var(--out, 0) * -8vh));
  }

  .hero h1 {
    font-size: clamp(5rem, 10.5vw, 11.5rem);
    line-height: 0.86;
  }

  .hero h1 em {
    display: block;
  }

  .hero__lede {
    max-width: 24ch;
  }

  .hero__hint {
    max-width: 30ch;
  }
}

.js .hero__copy > * {
  animation: rise 1.1s var(--ease) both;
}

.js .hero__copy > :nth-child(1) {
  animation-delay: 0.5s;
}

.js .hero__copy > :nth-child(2) {
  animation: none;
}

.js .hero__copy > :nth-child(3) {
  animation-delay: 0.85s;
}

.js .hero__copy > :nth-child(4) {
  animation-delay: 1.5s;
}

@keyframes develop {
  to {
    clip-path: inset(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
}

/* ---------- About ---------- */
.about {
  position: relative;
  background: linear-gradient(#000, var(--ink) 40vh);
}

.premise {
  height: 230vh;
  height: 230svh;
}

.premise__pin {
  position: sticky;
  top: 0;
  display: grid;
  align-content: center;
  height: 100vh;
  height: 100svh;
}

.premise__text {
  margin-top: var(--s-3);
  max-width: 26em;
  font-size: clamp(1.75rem, 0.9rem + 3.6vw, 4.1rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.js .w {
  color: var(--dim);
  transition: color 0.4s;
}

.js .w.lit {
  color: var(--paper);
}

.bio {
  display: grid;
  gap: var(--s-3);
  padding-bottom: var(--s-6);
}

.bio p {
  max-width: 62ch;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.65;
}

/* The opening sentence, written out like a heading */
.bio .bio__lead {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}

.bio .bio__lead + p {
  margin-top: calc(var(--s-3) * -0.5);
}

@media (min-width: 60rem) {
  .bio p {
    margin-left: 34%;
  }
}

/* Phones: the statement stays pinned while the bio slides up over it like a curtain, the same
   way the quotes and blurbs cover the Work scenes. The section runs longer so the statement
   finishes lighting before the curtain arrives (see main.js). */
@media (max-width: 699px) {
  /* Sit the statement a touch above the true middle, where the eye reads as centered on a phone */
  .premise__pin {
    padding-bottom: 8vh;
    padding-bottom: 8svh;
  }
}

@media (max-width: 699px) and (prefers-reduced-motion: no-preference) {
  .js .premise {
    height: 300vh;
    height: 300svh;
  }

  .js .bio {
    position: relative;
    z-index: 1;
    margin-top: -100vh;
    margin-top: -100svh;
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    background: var(--ink);
    box-shadow: 0 -3rem 4rem rgba(0, 0, 0, 0.6);
  }
}

/* Thread between chapters */
.thread {
  position: relative;
  height: clamp(5rem, 16vh, 9rem);
  background: var(--ink);
}

.thread::before,
.thread::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 50%;
  width: 1px;
  background: var(--line);
}

.thread::after {
  background: var(--steel);
  transform: scaleY(var(--e, 1));
  transform-origin: 50% 0;
}

.work,
.record,
.contact,
.foot {
  background: var(--ink);
}

/* Chapter headings */
.chapter-head {
  padding-block: var(--s-5) var(--s-4);
}

.chapter-head h2 {
  margin-top: var(--s-2);
  max-width: 18em;
  font-size: clamp(2rem, 1.1rem + 3.6vw, 4.25rem);
}

.chapter-intro {
  margin-top: var(--s-3);
  max-width: 40ch;
  font-size: 1.1875rem;
  color: var(--muted);
}

/* ---------- Work: three strengths ---------- */
.strength {
  position: relative;
  border-top: 1px solid var(--line);
}

.scene {
  position: relative;
  padding-block: var(--s-5) var(--s-3);
}

.scene__canvas,
.scene__spacer {
  display: none;
}

.verb {
  font-size: clamp(4rem, 1.5rem + 12vw, 11rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.strength__line {
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}

.strength__body {
  margin-top: var(--s-3);
  max-width: 30ch;
  font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.5rem);
  line-height: 1.4;
}

.strength__proof {
  position: relative;
  z-index: 2;
  padding-block: var(--s-4) var(--s-6);
  background: var(--ink);
}

.strength__proof-grid {
  display: grid;
  gap: var(--s-3);
}

.strength blockquote {
  margin-bottom: var(--s-4);
  padding-left: var(--s-3);
  border-left: 1px solid var(--steel);
  max-width: 34ch;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.875rem);
  font-style: italic;
  line-height: 1.35;
}

.proof__blurb {
  max-width: 40rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.55;
}

.proof__blurb + .proof__blurb {
  margin-top: var(--s-2);
}

/* "Go Heels!" types out like a terminal line under the education entry, then the caret blinks */
.cheer {
  margin-top: var(--s-3);
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  color: var(--steel);
}

.cheer__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: currentColor;
  animation: caret 1.05s step-end infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cheer__caret {
    animation: none;
  }
}

.strength__proof.strength__proof--empty,
.scenes .strength__proof.strength__proof--empty {
  padding: 0;
  border: 0;
  box-shadow: none;
}

@media (min-width: 60rem) {
  .strength__proof-grid {
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: var(--s-4);
  }

  /* A quote on its own keeps to the text column */
  .strength__proof-grid > :only-child {
    grid-column: 2;
  }
}

/* With motion: the scene pins full-screen and what follows slides up over it like a curtain */
.scenes .strength {
  border-top: 0;
}

.scenes .scene {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}

.scenes .scene__canvas {
  touch-action: pan-y;
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scenes .scene__spacer {
  display: block;
  height: 150vh;
  height: 150svh;
}

.scenes .scene__copy {
  position: absolute;
  inset: 5rem 0 auto;
}

.scenes .strength__proof {
  border-top: 1px solid var(--line);
  box-shadow: 0 -3rem 4rem rgba(0, 0, 0, 0.6);
}

@media (min-width: 60rem) and (min-aspect-ratio: 1/1) {
  .scenes .scene__copy {
    inset: 50% 0 auto;
    transform: translateY(-50%);
  }

  .scenes .scene__spacer {
    height: 190vh;
    height: 190svh;
  }

  .scenes .verb {
    font-size: clamp(4rem, 8.5vw, 9.5rem);
  }

  /* Wide enough that each blurb runs about six lines; the graphics sit further right to make room. */
  .scenes .strength__body {
    max-width: 18em;
  }
}

/* Phones: "How I work" pins in place and Connect slides up over it like a curtain, the same
   hand-off as the About statement and the bio. */
@media (max-width: 699px) and (prefers-reduced-motion: no-preference) {
  .scenes .work__intro {
    height: 220vh;
    height: 220svh;
  }

  .scenes .work__pin {
    position: sticky;
    top: 0;
    display: grid;
    align-content: center;
    height: 100vh;
    height: 100svh;
    padding-bottom: 8vh;
    padding-bottom: 8svh;
  }

  .scenes .work__pin .chapter-head {
    padding-block: 0;
  }

  .scenes .work__intro + .strength {
    z-index: 1;
    margin-top: -100vh;
    margin-top: -100svh;
    border-top: 1px solid var(--line);
    background: var(--ink);
    box-shadow: 0 -3rem 4rem rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Record ---------- */
.record__stage {
  display: none;
}

.role {
  padding-block: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line);
}

.role__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.role__meta span:first-child {
  color: var(--steel);
}

.role h3 {
  margin-block: var(--s-2) var(--s-3);
  font-size: clamp(2.5rem, 1.2rem + 5vw, 5.25rem);
  text-transform: uppercase;
}

.role--edu h3 {
  font-size: clamp(1.875rem, 1.1rem + 2.6vw, 3.25rem);
}

.role__summary {
  display: grid;
  gap: var(--s-2);
  max-width: 58ch;
  font-size: 1.0625rem;
}

.brands {
  margin-top: var(--s-3);
  max-width: 30rem;
}

.brands ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--s-2);
}

.brands li {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* With JavaScript: one frame sticks in view and every role's media plays inside it.
   Phones: the frame sticks to the top and the text scrolls beneath it. */
.js .record__stage {
  display: block;
  position: sticky;
  top: 0;
  z-index: 3;
  /* The picture is a short, wide frame (about 1.86 to 1), sized from the screen's width so it is
     the same in every phone browser (browsers report the screen's height differently). The
     frame sits 6.25rem inside this. Short enough to leave room to read each role's text. */
  height: min(calc((100vw - 2 * var(--gut)) / 1.86 + 6.25rem), 30rem);
  margin-inline: calc(var(--gut) * -1);
  padding-inline: var(--gut);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.record__frame {
  position: absolute;
  inset: 3.75rem var(--gut) 2.5rem;
  overflow: hidden;
  background: #060505;
  border: 1px solid var(--line);
}

.record__canvas,
.record__media,
.record__media img,
.record__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.record__media img,
.record__media video {
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.record__canvas {
  display: none;
}

.record__media {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s,
    visibility 0.5s;
}

.record__media.is-on {
  opacity: 1;
  visibility: visible;
}

/* Brand wheel: every brand as a word on a drum; the button spins it and one lights up */
.wheel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.wheel__logo {
  position: relative;
  order: 2;
}

/* The chosen name, set large. The code field draws it when running; this is the fallback. */
.wheel__name {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 8%;
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.is-gl .wheel__name {
  opacity: 0;
}

.wheel__drum {
  --row: 1.7rem;
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
  mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}

/* The centre line the wheel stops on */
.wheel__drum::before {
  content: '';
  position: absolute;
  inset: calc(50% - var(--row) / 2) 8% auto;
  height: var(--row);
  border-block: 1px solid var(--steel);
  opacity: 0.6;
}

.wheel__list {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
}

.wheel__list li {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--row);
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
  opacity: 0;
  transition:
    opacity 0.4s calc(var(--i) * 55ms),
    color 0.25s,
    text-shadow 0.25s,
    transform 0.25s;
}

.is-on .wheel__list li {
  opacity: 1;
}

.wheel__list li.is-near {
  color: var(--muted);
}

.wheel__list li.is-lit {
  color: var(--paper);
  text-shadow:
    0 0 0.6em rgba(143, 176, 201, 0.9),
    0 0 1.6em rgba(143, 176, 201, 0.5);
  transform: scale(1.14);
}

/* Golden aura: the word a spin lands on is revealed in gold from left to right. A bright streak
   shoots across the word, and the gold copy of the word (li::after) is uncovered behind it,
   with warm light held close to the letters and a soft leading edge. The word then flickers
   gently until the glow fades. */
.wheel__list {
  z-index: 1;
}

.wheel__word {
  position: relative;
}

.wheel.is-gold .wheel__list li.is-lit {
  font-weight: 500;
  transform: scale(1.2);
  transition:
    opacity 0.4s calc(var(--i) * 55ms),
    color 0.25s,
    text-shadow 0.25s,
    transform 0.45s;
}

/* The gold word, laid exactly over the plain one */
.wheel__word::after {
  content: attr(data-word);
  position: absolute;
  /* Larger than the word, so its glow is not cut off at the edges */
  inset: -1em -1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(255, 210, 125);
  text-shadow:
    0 0 0.06em rgb(255, 246, 220),
    0 0 0.16em rgba(255, 220, 145, 1),
    0 0 0.16em rgba(255, 220, 145, 1),
    0 0 0.35em rgba(255, 190, 90, 1),
    0 0 0.35em rgba(255, 190, 90, 0.8),
    0 0 0.7em rgba(255, 165, 55, 0.6);
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s;
}

.wheel.is-gold .wheel__list li.is-lit .wheel__word::after {
  opacity: 1;
  transition: none;
  animation:
    aura-reveal 0.75s cubic-bezier(0.3, 0.6, 0.2, 1) both,
    aura-flicker 1.6s 0.75s ease-in-out infinite alternate;
}

/* The streak of light that shoots across the word */
.wheel__word::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 2.4em;
  height: 2.4em;
  background: radial-gradient(closest-side, rgba(255, 248, 225, 0.95), rgba(255, 196, 104, 0.55) 45%, rgba(255, 160, 50, 0) 100%);
  transform: translate(-50%, -50%) scaleX(1.8);
  opacity: 0;
  pointer-events: none;
}

.wheel.is-gold .wheel__list li.is-lit .wheel__word::before {
  animation: aura-streak 0.75s cubic-bezier(0.3, 0.6, 0.2, 1) both;
}

@keyframes aura-reveal {
  from {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }

  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes aura-streak {
  0% {
    left: 0;
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

/* The glow stays on the letters themselves; the word flickers gently until it fades. */
@keyframes aura-flicker {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.35);
  }
}

@media (min-width: 60rem) and (min-aspect-ratio: 1/1) {
  .wheel {
    grid-template-columns: none;
    grid-template-rows: minmax(0, 0.7fr) minmax(0, 1fr);
  }

  .wheel__logo {
    order: 0;
  }

  .wheel__drum {
    --row: 2.5rem;
  }

  .wheel__list li {
    font-size: 1.625rem;
    letter-spacing: 0.08em;
  }
}

/* When the code field is running, it draws the media; the originals stay for assistive tech. */
.is-gl .record__canvas {
  display: block;
}

.is-gl .record__media img,
.is-gl .record__media video {
  opacity: 0;
}

/* The UNC footage only exists inside the code field. */
.record__media[data-kind='staged'] video {
  opacity: 0;
}

.record__media[data-kind='staged'] .film__toggle {
  display: none;
}

.is-gl .record__media .film__toggle {
  display: block;
}

/* The wheel shows every brand, so the plain list is kept for assistive tech only. */
.js .brands {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.film__toggle,
.wheel__spin {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  background: rgba(5, 4, 4, 0.82);
  border: 1px solid rgba(236, 230, 218, 0.5);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 59.99rem) {
  .film__toggle,
  .wheel__spin {
    right: 0.35rem;
    bottom: 0.35rem;
    min-height: 1.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.5625rem;
  }
}

.film__toggle:hover,
.wheel__spin:hover {
  background: var(--paper);
  color: var(--ink);
}

.record__hud {
  position: absolute;
  right: var(--gut);
  bottom: 0.85rem;
  left: var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.record__src {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record__ticks {
  display: flex;
  flex: none;
  gap: 4px;
}

.record__ticks i {
  width: 1.25rem;
  height: 2px;
  background: var(--line);
  transition: background 0.4s;
}

.record__ticks i.is-on {
  background: var(--steel);
}

.js .role:first-child {
  border-top: 0;
}

@media (min-width: 60rem) and (min-aspect-ratio: 1/1) {
  .js .record__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    column-gap: var(--s-5);
    align-items: start;
  }

  .js .record__stage {
    order: 2;
    height: 100vh;
    height: 100svh;
    margin: 0;
    padding: 0;
    background: none;
  }

  .record__frame {
    inset: 13vh 0;
  }

  .record__hud {
    right: 0;
    bottom: calc(13vh - 1.9rem);
    left: 0;
  }

  .js .role {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92vh;
    min-height: 92svh;
    border-top: 0;
  }
}

/* ---------- Photography ---------- */
.photos {
  background: var(--ink);
}

.photos__stage {
  position: relative;
  padding: var(--s-5) var(--gut);
}

.photos__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.photos__intro p {
  margin-top: 0.4rem;
  max-width: 24ch;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--muted);
}

.photos__count {
  display: none;
}

.shot {
  aspect-ratio: 3 / 2;
}

.shot--portrait {
  aspect-ratio: 2 / 3;
}

.shot--square {
  aspect-ratio: 1;
}

.shot__open,
.shot img,
.shot__blank {
  display: block;
  width: 100%;
  height: 100%;
}

.shot img {
  object-fit: cover;
}

/* Real photographs keep their own proportions; nothing is cropped. */
.shot--photo {
  aspect-ratio: auto;
}

.shot--photo img {
  height: auto;
}

/* Placeholders: stand-ins until real photographs are added in content.json */
.shot__blank {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #4a453e, #23201c 60%, #57514a);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
}

.shot__blank--1 {
  background: linear-gradient(200deg, #4b5a66, #1d2226 55%, #3a4650);
}

.shot__blank--2 {
  background: radial-gradient(circle at 30% 30%, #5f574d, #1f1c19 72%);
}

.shot__blank--3 {
  background: linear-gradient(20deg, #26221e, #4d473f 50%, #2a3138);
}

.shot__blank--4 {
  background: radial-gradient(circle at 70% 65%, #4a5964, #1c1f22 74%);
}

/* With motion: a pinned stage, and the scroll flies through the photographs */
.fly .photos__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}

.fly .photos__intro {
  position: absolute;
  top: 5rem;
  left: var(--gut);
  z-index: 200;
}

.fly .photos__list {
  display: block;
  position: absolute;
  inset: 0;
  margin: 0;
}

.fly .shot {
  position: absolute;
  top: 52%;
  left: 50%;
  width: min(86vw, 105vh);
  width: min(86vw, 105svh);
  will-change: transform, opacity;
}

.fly .shot--photo {
  width: auto;
}

.fly .shot--photo img {
  width: auto;
  max-width: min(86vw, 105vh);
  max-width: min(86vw, 105svh);
  height: auto;
  max-height: 60vh;
  max-height: 60svh;
}

.fly .shot--photo {
  top: 56%;
}

@media (min-width: 60rem) and (min-aspect-ratio: 1/1) {
  .fly .shot--photo img {
    max-height: 72vh;
    max-height: 72svh;
  }

  .fly .shot--photo {
    top: 53%;
  }
}

.fly .shot--portrait {
  width: min(70vw, 46vh);
  width: min(70vw, 46svh);
}

.fly .shot--square {
  width: min(82vw, 68vh);
  width: min(82vw, 68svh);
}

.fly .photos__count {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  position: absolute;
  top: 4.4rem;
  right: var(--gut);
  z-index: 200;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.photos__count b {
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--paper);
}

/* Full-screen viewer */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #050404;
  color: var(--paper);
}

.viewer::backdrop {
  background: #000;
}

.viewer__frame {
  position: absolute;
  inset: 4rem 1rem 5.5rem;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}

.viewer__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer__frame > * {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.viewer__frame > .shot__blank {
  width: min(100%, 60rem);
  aspect-ratio: 3 / 2;
}

.viewer__frame[data-shape='portrait'] > .shot__blank {
  width: auto;
  height: 100%;
  aspect-ratio: 2 / 3;
}

.viewer__frame[data-shape='square'] > .shot__blank {
  width: auto;
  height: 100%;
  aspect-ratio: 1;
}

.viewer__bar {
  position: absolute;
  inset: auto 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.viewer__bar button {
  min-width: 2.75rem;
  height: 2.75rem;
  padding-inline: 0.9rem;
  border: 1px solid rgba(236, 230, 218, 0.5);
  letter-spacing: inherit;
  text-transform: inherit;
}

.viewer__bar button:hover {
  background: var(--paper);
  color: var(--ink);
}

.viewer__count {
  min-width: 4.5rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  align-content: center;
  min-height: 92vh;
  min-height: 92svh;
  padding-block: var(--s-6);
}

.contact h2 {
  margin-block: var(--s-3);
  margin-left: -0.04em;
  font-size: clamp(3.25rem, 1rem + 11.5vw, 11.5rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.contact__body {
  max-width: 34ch;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--muted);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.contact__pending {
  margin-top: var(--s-4);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--steel);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  background: var(--paper);
  border: 1px solid var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.cta:hover {
  background: transparent;
  color: var(--paper);
}

.cta--quiet {
  background: transparent;
  border-color: rgba(236, 230, 218, 0.5);
  color: var(--paper);
}

.cta--quiet:hover,
.cta--quiet:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  padding-block: var(--s-3);
  padding-bottom: max(var(--s-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
}

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

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-3);
}

/* 404 */
.lost__main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--s-3);
  min-height: 100vh;
  min-height: 100svh;
}

.lost__main h1 {
  font-size: clamp(3rem, 1rem + 10vw, 9rem);
}

/* Contact page */
.letter {
  max-width: 44rem;
  padding-top: calc(var(--s-6) + 2rem);
  padding-bottom: var(--s-6);
}

.letter__title {
  margin-top: var(--s-2);
  font-size: clamp(2.5rem, 1rem + 6vw, 5rem);
  line-height: 1;
}

.letter__intro {
  margin-top: var(--s-3);
  max-width: 34ch;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--muted);
}

.letter__pending {
  margin-top: var(--s-3);
  padding: var(--s-2);
  border: 1px solid var(--steel);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--steel);
}

/* Privacy page */
.policy {
  margin-top: var(--s-5);
  max-width: 38rem;
}

.policy h2 {
  font-size: clamp(1.375rem, 1rem + 1.2vw, 1.875rem);
  line-height: 1.15;
}

.policy p {
  margin-top: var(--s-2);
  line-height: 1.65;
  color: var(--muted);
}

.policy a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--paper);
}

.policy__updated {
  margin-top: var(--s-5);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.letter__back {
  margin-top: var(--s-5);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.letter__back a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
}

.form {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.form__field {
  display: grid;
  gap: var(--s-1);
}

.form__field label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form__req {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}

.form__field input,
.form__field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  background: var(--ink-2);
  border: 1px solid rgba(236, 230, 218, 0.45);
  border-radius: 0;
  color: var(--paper);
  font: inherit;
  font-size: 1.0625rem; /* 16px or more, so iPhones do not zoom in on focus */
  line-height: 1.5;
}

.form__field textarea {
  resize: vertical;
}

.form__field input:focus-visible,
.form__field textarea:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
  border-color: var(--steel);
}

.form__field [aria-invalid='true'] {
  border-color: var(--alert);
}

.form__error,
.form__status {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--alert);
}

.form__error:empty,
.form__status:empty {
  display: none;
}

.form__error::before {
  content: 'Error: ';
}

.form__trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__privacy {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.form .cta {
  justify-self: start;
  cursor: pointer;
}

.form .cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.form .cta:disabled:hover {
  background: var(--paper);
  color: var(--ink);
}

.form__done {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

/* The layout rules above would otherwise override the hidden attribute */
.form[hidden],
.form__done[hidden] {
  display: none;
}

.form__done h2 {
  font-size: clamp(1.75rem, 1rem + 3vw, 2.75rem);
  line-height: 1.1;
}

/* Anchors land below the fixed header */
#work,
#record,
#photos,
#contact {
  scroll-margin-top: 3rem;
}

/* ---------- Motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .js .w {
    color: var(--paper);
  }

  .premise {
    height: auto;
  }

  .premise__pin {
    position: static;
    height: auto;
    padding-block: var(--s-6) var(--s-5);
  }

  .hero {
    height: 100vh;
    height: 100svh;
  }
}
