/* ===========================================================================
   for stella
   Cream paper, handwritten type, dusty pink with sage and mustard alongside.
   Tokens live here at the top — change these, not the rules below.
   =========================================================================== */

:root {
  --cream:        #faf4e9;
  --cream-2:      #f3e9d7;
  --card:         #ffffff;
  --ink:          #4a3f35;
  --ink-soft:     #6f6255;
  --ink-faint:    #9a8d7e;

  --pink:         #e8b4bc;
  --pink-deep:    #d98a97;
  --sage:         #a8b89a;
  --sage-deep:    #7e9070;
  --mustard:      #e0ac55;

  --rule:         rgba(74, 63, 53, .14);
  --paper-shadow: rgba(74, 63, 53, .18);

  --shadow-rest:  0 6px 18px -6px var(--paper-shadow);
  --shadow-lift:  0 16px 30px -10px var(--paper-shadow);

  --radius:       10px;
  --radius-lg:    18px;

  --font-display: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --font-body:    "Patrick Hand", "Segoe Print", "Comic Sans MS", -apple-system,
                  "Segoe UI", Roboto, sans-serif;

  --ease:         cubic-bezier(.22, .68, .28, 1);
  --ease-out:     cubic-bezier(.16, 1, .3, 1);

  --gutter:       clamp(1.25rem, 5vw, 3.5rem);
  --measure:      1180px;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-color: var(--cream);
  /* Three soft washes of the secondary colours, so the paper isn't flat. */
  background-image:
    radial-gradient(circle at 18% 8%,  rgba(232, 180, 188, .28) 0, transparent 42%),
    radial-gradient(circle at 84% 26%, rgba(168, 184, 154, .26) 0, transparent 40%),
    radial-gradient(circle at 46% 78%, rgba(224, 172, 85,  .20) 0, transparent 44%);
  background-attachment: fixed;
}

img {
  display: block;
  max-width: 100%;
  /* Phone photos carry EXIF rotation — respect it rather than showing them sideways. */
  image-orientation: from-image;
}

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

:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 4px;
  border-radius: 5px;
}

/* --- texture -------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .38;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

#page { position: relative; z-index: 1; }

/* --- scroll progress ------------------------------------------------------ */

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--pink-deep);
  opacity: .8;
}

/* --- reveal primitives ---------------------------------------------------- */

/* Everything with .reveal starts down and faded, then app.js adds .is-in.
   The hidden state is scoped to .js throughout this file: without scripting
   the page just renders, rather than staying blank forever. */
.reveal {
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Words in a split heading rise out from behind a mask. */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .06em;
}
.word > i {
  display: inline-block;
  font-style: inherit;
  transition: transform 1s var(--ease-out);
}
.js .word > i { transform: translateY(105%); }
.js .is-in .word > i { transform: none; }

/* --- opening -------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4rem, 12vh, 7rem) var(--gutter) clamp(6rem, 16vh, 10rem);
}

.hero__inner {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 7vh, 4rem);
  }
}

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pink-deep);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 8.5vw, 6rem);
  line-height: 1.02;
  color: var(--ink);
}
/* the name itself picks up the accent */
.hero__title .word:last-child > i { color: var(--pink-deep); }

.hero__sub {
  max-width: 30ch;
  margin: 1.1rem 0 0;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink-soft);
  transition-delay: .55s;
}

.date-badge {
  display: inline-block;
  margin: 1.9rem 0 0;
  padding: .35rem 1.5rem .5rem;
  background: var(--pink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1.2;
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--pink-deep);
  transform: rotate(-2deg);
  transition-delay: .75s;
}
.js .date-badge { transform: translateY(16px) rotate(-2deg); }
.js .date-badge.is-in { transform: rotate(-2deg); }

/* the loose pile of photos */
.fan {
  position: relative;
  width: 100%;
  max-width: 430px;
  aspect-ratio: 1 / 1;
  justify-self: end;
  pointer-events: none;
}

@media (max-width: 900px) {
  .fan { justify-self: start; max-width: 300px; }
}

/* On a phone the whole opening has to fit one screen, cue included, so the
   pile shrinks rather than pushing the cue below the fold. */
@media (max-width: 640px) {
  .hero { padding-bottom: clamp(4rem, 11vh, 6rem); }
  .fan { max-width: 240px; }
  .hero__sub { font-size: 1.08rem; }
}

.fan__card {
  position: absolute;
  /* --l / --t / --r / --d are set per card in app.js */
  left: var(--l, 0%);
  top: var(--t, 0%);
  width: 53%;
  padding: 8px 8px 14px;
  background: var(--card);
  border-radius: 4px;
  box-shadow: var(--shadow-rest);
  transform: translateY(30px) rotate(0deg) scale(.96);
  opacity: 0;
  transition: transform 1.1s var(--ease-out), opacity .8s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.fan.is-in .fan__card {
  transform: translateY(0) rotate(var(--r, 0deg)) scale(1);
  opacity: 1;
}
.fan__card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  background: var(--cream-2);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.75rem, 5vh, 3rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  opacity: 0;
  color: var(--ink-faint);
  animation: cueIn 1s var(--ease-out) 1.9s forwards;
  transition: opacity .4s var(--ease);
}
.scroll-cue.is-gone { opacity: 0 !important; }
.scroll-cue__text { font-size: .95rem; }
.scroll-cue__arrow {
  font-size: 1.15rem;
  animation: bounce 2s var(--ease) infinite;
}

@keyframes cueIn { to { opacity: .75 } }
@keyframes bounce {
  0%, 100% { transform: translateY(0) }
  50%      { transform: translateY(7px) }
}

/* --- the note from you ---------------------------------------------------- */

.note-section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(4rem, 12vh, 7rem);
}

.note {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2.25rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem) clamp(1.75rem, 4vw, 2.25rem);
  background: var(--card);
  border-radius: 5px;
  box-shadow: 0 10px 30px var(--paper-shadow);
  transform: rotate(-0.7deg);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
}
.js .note { transform: translateY(16px) rotate(0deg); }
.js .note.is-in { transform: translateY(0) rotate(-0.7deg); }

/* a torn strip of tape holding it down */
.note::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 28px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(224, 172, 85, .5);
  border-left: 1px solid rgba(255, 255, 255, .5);
  border-right: 1px solid rgba(255, 255, 255, .5);
}

.note__body {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.32rem);
  line-height: 1.7;
  color: var(--ink);
}

.note__sign {
  margin: 1.1rem 0 0;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  color: var(--pink-deep);
}

/* --- section heads -------------------------------------------------------- */

.wall-section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  line-height: 1.1;
  color: var(--ink);
}

.section-sub {
  margin: .35rem auto 0;
  max-width: 34ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.js .section-head .section-title,
.js .section-head .section-sub {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.js .section-head.is-in .section-title { opacity: 1; transform: none; }
.js .section-head.is-in .section-sub   { opacity: 1; transform: none; transition-delay: .16s; }

/* --- the collage ---------------------------------------------------------- */

/* Rows are 1px with no row gap, so a tile's row span IS its height in pixels —
   app.js measures each tile and sets --span. That's what lets photos of any
   shape pack together without leaving holes. `dense` backfills the gaps a
   double-width tile would otherwise leave behind. */
.wall {
  display: grid;
  /* Two things going on in the track size:
     - the 128px floor keeps two even columns fitting down to a 320px screen.
       Any higher and a double-width tile forces an implicit extra track
       narrower than the minimum, giving visibly uneven columns.
     - min(100%, …) stops the track minimum ever exceeding the container, which
       is what would otherwise push the grid wider than the screen. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(128px, 20vw, 230px)), 1fr));
  grid-auto-rows: 1px;
  grid-auto-flow: dense;
  row-gap: 0;
  column-gap: clamp(14px, 1.8vw, 28px);
  align-items: start;
}

.tile {
  grid-row: span var(--span, 320);
  min-width: 0;
}

/* Tiles carrying a message, and a scattering of plain ones, take two columns
   so the collage never settles into a single repeating width. */
.tile--wide { grid-column: span 2; }

/* On a phone the grid is two columns. Plain photos go back to one so they sit
   two-up, but a captioned tile keeps the full width — a long message in a
   160px column is an unreadable ribbon. */
@media (max-width: 640px) {
  .tile--wide:not(.tile--lead) { grid-column: span 1; }
}

.tile__box {
  /* The bottom spacing is padding, not margin, so it's inside the measured
     height and the row span accounts for it. */
  padding-bottom: clamp(16px, 2.2vw, 30px);
  transition: opacity .85s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js .tile__box { opacity: 0; transform: translateY(26px); }
.js .tile.is-in .tile__box { opacity: 1; transform: none; }

.frame {
  position: relative;
  background: var(--card);
  padding: 11px 11px 10px;
  border-radius: 4px;
  box-shadow: var(--shadow-rest);
  /* Settles into its own slight tilt as the tile comes in. */
  transform: rotate(0deg);
  transition: transform 1s var(--ease-out), box-shadow .4s var(--ease);
  transition-delay: var(--d, 0s);
}
.tile.is-in .frame { transform: rotate(var(--tilt, 0deg)); }

/* Three treatments, so it reads as a scrapbook of different things rather than
   one component repeated fifty times. */
.frame--0 { padding: 13px 13px 26px; }        /* deep polaroid chin */
.frame--1 { padding: 10px; }                   /* even white border  */
.frame--2 { padding: 6px; }                    /* thin white border  */

/* a scrap of tape — only on the deep-chinned ones */
.frame--0::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 58px;
  height: 19px;
  transform: translateX(-50%) rotate(var(--tape, -2deg));
  background: rgba(224, 172, 85, .42);
  border-left: 1px solid rgba(255, 255, 255, .5);
  border-right: 1px solid rgba(255, 255, 255, .5);
}

/* The photo is the button; the name and message stay plain text, so a screen
   reader reads them as prose instead of one enormous button label. */
.tile__open {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 2px;
  background: var(--cream-2);
  cursor: zoom-in;
}

/* Parallax lives on this wrapper, the hover zoom on the image inside it, so
   the two never fight over the same transform. */
.tile__pan {
  display: block;
  transform: translateY(var(--py, 0px));
  will-change: transform;
}

.tile__photo {
  width: 100%;
  height: auto;
  /* Cap it so one enormous portrait can't run away with a column. */
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  aspect-ratio: var(--ratio, auto);
  /* Slightly oversized on purpose: gives the parallax room to move inside the
     frame without ever exposing an edge. The 6% here is what caps the drift
     factor in app.js — 3% of height of headroom top and bottom. */
  transform: scale(1.06);
  transition: transform 1.1s var(--ease-out);
}

.tile__index {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: .72rem;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .45s var(--ease);
}

/* The caption block borrows the look of a note card. */
.tile__body {
  margin-top: .7rem;
  padding: .85rem 1rem .9rem;
  background: var(--cream-2);
  border-left: 5px solid var(--sage);
  border-radius: 4px;
}

.tile__name {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--sage-deep);
}

/* "45 photos" beside the name, for whoever sent a pile of them. */
.tile__much {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--font-body);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pink-deep);
}

.tile__message {
  margin: .4rem 0 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink);
  /* Emma's message is a poem — its line breaks matter. */
  white-space: pre-line;
}

/* :focus-within covers keyboard users landing on the photo button. */
.tile:focus-within .frame { box-shadow: var(--shadow-lift); }
.tile:focus-within .tile__index { opacity: 1; }

@media (hover: hover) {
  .tile:hover { z-index: 2; }
  .tile.is-in:hover .frame {
    transform: translateY(-6px) rotate(0deg) scale(1.03);
    box-shadow: var(--shadow-lift);
  }
  .tile:hover .tile__photo { transform: scale(1.12); }
  .tile:hover .tile__index { opacity: 1; }
}

.tile.is-in:active .frame { transform: translateY(-2px) rotate(0deg); }

.empty { color: var(--ink-soft); text-align: center; }
.empty code {
  font-size: .9em;
  background: var(--cream-2);
  padding: .12em .4em;
  border-radius: 4px;
}

/* --- closing -------------------------------------------------------------- */

.closing {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(5rem, 15vh, 9rem) var(--gutter) 0;
  text-align: center;
}

.closing__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.12;
  color: var(--ink);
}

.closing__line {
  max-width: 34ch;
  margin: 1rem auto 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-soft);
  transition-delay: .12s;
}

.heart-row {
  margin: 1.9rem 0 0;
  font-size: 1.5rem;
  letter-spacing: .55rem;
  transition-delay: .24s;
}

.site-footer {
  padding: clamp(3.5rem, 9vh, 6rem) var(--gutter) clamp(3rem, 8vh, 4.5rem);
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: .95rem;
  color: var(--ink-faint);
}

/* --- larger view (modal) -------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 3vw, 2.5rem);
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 48, 40, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }

/* Deliberately no position and no transform here. The close button positions
   itself against .modal, and either one would make this panel the containing
   block instead — a transform captures absolute AND fixed descendants. The
   photo animates via the FLIP in app.js, so the panel only needs to fade. */
.modal__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.85rem, 2vh, 1.35rem);
  max-width: 100%;
  opacity: 0;
  transition: opacity .35s var(--ease-out);
}
.modal.is-open .modal__panel { opacity: 1; }

/* Same white border and proportions as the tiles on the wall, just bigger. */
.modal__figure {
  margin: 0;
  max-width: 100%;
  padding: 13px 13px 11px;
  background: var(--card);
  border-radius: 5px;
  box-shadow: 0 30px 70px -20px rgba(40, 32, 24, .7);
  will-change: transform;
}

#modal-photo {
  display: block;
  width: auto;
  max-width: 100%;
  /* Uncropped — this view exists so she can see the whole photo. */
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 2px;
  background: var(--cream-2);
}

.modal__caption {
  padding: .7rem .2rem .05rem;
  text-align: center;
}

.modal__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--sage-deep);
}

.modal__sub {
  margin: .1rem 0 0;
  font-size: .85rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}
.modal__sub[hidden] { display: none; }

.modal__nav {
  display: flex;
  align-items: center;
  gap: .65rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--ease-out) .18s, transform .5s var(--ease-out) .18s;
}
.modal.is-open .modal__nav { opacity: 1; transform: none; }
.modal__nav[hidden] { display: none; }

.modal__step {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  transition: background-color .25s var(--ease);
}
.modal__step:hover { background: var(--pink-deep); }
.modal__step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.modal__count {
  min-width: 5.5ch;
  text-align: center;
  font-size: .9rem;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .78);
}

/* Absolute against .modal, not fixed: .modal__panel would capture a fixed
   child the moment it had any transform of its own. */
.modal__close {
  position: absolute;
  top: clamp(.75rem, 2.5vh, 1.5rem);
  right: clamp(.75rem, 2.5vw, 1.5rem);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  transition: background-color .25s var(--ease);
}
.modal__close:hover { background: var(--pink-deep); }
.modal__close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

@media (max-width: 780px) {
  #modal-photo { max-height: 66vh; }
}

body.is-locked { overflow: hidden; }

/* --- reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  /* Nothing may stay hidden just because its animation was switched off. */
  .reveal, .tile__box, .fan__card, .modal__panel, .modal__nav, .note,
  .section-title, .section-sub { opacity: 1 !important; }
  .note { transform: rotate(-0.7deg) !important; }
  .date-badge { transform: rotate(-2deg) !important; }
  .tile__box, .tile__pan, .section-title, .section-sub { transform: none !important; }
  .frame { transform: rotate(var(--tilt, 0deg)) !important; }
  .fan__card { transform: rotate(var(--r, 0deg)) !important; }
  .word > i { transform: none !important; }
  .scroll-cue { display: none; }
}

/* --- the countdown gate ---------------------------------------------------- */

/* Sits over everything until OPENS_AT. Added by JS only, so if scripting
   fails the page is simply open rather than locked shut forever. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 22% 12%, rgba(232, 180, 188, .40) 0, transparent 46%),
    radial-gradient(circle at 78% 30%, rgba(168, 184, 154, .34) 0, transparent 44%),
    radial-gradient(circle at 50% 84%, rgba(224, 172, 85,  .28) 0, transparent 48%);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.gate[hidden] { display: none; }

/* lifting away when the moment arrives */
.gate.is-open { opacity: 0; transform: scale(1.04); pointer-events: none; }

body.is-gated { overflow: hidden; }

.gate__inner {
  max-width: 40rem;
  animation: gateIn 1.1s var(--ease-out) both;
}

@keyframes gateIn {
  from { opacity: 0; transform: translateY(14px) }
  to   { opacity: 1; transform: none }
}

.gate__eyebrow {
  margin: 0 0 .5rem;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pink-deep);
}

.gate__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.02;
  color: var(--ink);
}

.gate__sub {
  margin: .6rem 0 0;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

/* four little taped cards, one per unit */
.gate__clock {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(.6rem, 2.2vw, 1.4rem);
  margin: clamp(2rem, 6vh, 3.25rem) 0 0;
}

.unit {
  position: relative;
  min-width: clamp(64px, 17vw, 104px);
  padding: clamp(.7rem, 2vw, 1rem) clamp(.5rem, 1.6vw, .9rem) clamp(.55rem, 1.6vw, .8rem);
  background: var(--card);
  border-radius: 5px;
  box-shadow: var(--shadow-rest);
  transform: rotate(var(--r, 0deg));
}

/* a scrap of tape on each */
.unit::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 42px;
  height: 16px;
  transform: translateX(-50%) rotate(var(--tape, -3deg));
  background: rgba(224, 172, 85, .45);
  border-left: 1px solid rgba(255, 255, 255, .5);
  border-right: 1px solid rgba(255, 255, 255, .5);
}

/* the digits roll up as they change */
.unit__num {
  display: block;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.unit__num > i {
  display: block;
  font-style: normal;
}
.unit__num.is-tick > i { animation: roll .45s var(--ease-out); }

@keyframes roll {
  from { transform: translateY(105%); opacity: .2 }
  to   { transform: none; opacity: 1 }
}

.unit--seconds .unit__num { color: var(--pink-deep); }

.unit__label {
  display: block;
  margin-top: .15rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.gate__when {
  margin: clamp(1.75rem, 5vh, 2.5rem) 0 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

.gate__hint {
  margin: .35rem 0 0;
  font-size: .85rem;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .gate__inner { animation: none; }
  .unit__num.is-tick > i { animation: none; }
}
