/* playinkwake.com coming-soon. Night-ink tokens from src/ui/tokens.css; gold is the one accent (the date). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #0b0d14;
  --text: #f4f1ea;
  --text-2: rgba(244, 241, 234, 0.74);
  --text-3: rgba(244, 241, 234, 0.6);
  --gold: #ffd66b;
  --hair: rgba(244, 241, 234, 0.14);
  --bubble: #3a3c4a;
  --glass: rgba(24, 26, 40, 0.5);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  --fw: 100vw;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* The art. On a phone it is the whole screen; on a desktop it becomes a 9:16 frame (below). */
.bg { display: none; }
.stage { position: relative; min-height: 100svh; display: flex; flex-direction: column; }
.phone { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #2a2140; }
.art {
  position: absolute;
  left: 50%;
  top: 50%;
  height: max(100lvh, 177.78vw);
  aspect-ratio: 9 / 16;
  translate: -50% -50%;
  transform-origin: 30% 30%;
}
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The lit clock face on the tower, measured at 15.9% / 19.9% of the painting. */
.glow {
  position: absolute;
  left: 15.9%;
  top: 19.9%;
  width: 12%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 228, 160, 0.8), rgba(255, 196, 110, 0.3) 45%, rgba(255, 190, 90, 0));
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}
.scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(11, 13, 20, 0.62) 0%,
    rgba(11, 13, 20, 0.18) 22%,
    rgba(11, 13, 20, 0) 34%,
    rgba(11, 13, 20, 0) 42%,
    rgba(11, 13, 20, 0.72) 60%,
    rgba(11, 13, 20, 0.94) 80%);
}

/* The lock screen */
.lock { position: relative; z-index: 1; padding: calc(env(safe-area-inset-top) + 24px) 10px 0; text-align: center; pointer-events: none; }
.padlock { width: 12px; height: 15px; color: rgba(244, 241, 234, 0.86); }
.day { margin: 4px 0 0; font: 650 calc(var(--fw) * 0.049) / 1.2 var(--display); letter-spacing: 0.005em; color: rgba(244, 241, 234, 0.9); }
.clock {
  margin: 0;
  font: 640 calc(var(--fw) * 0.235) / 1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums;
  text-shadow: 0 2px 30px rgba(11, 13, 20, 0.35);
}

/* The message. Sizes are in em so the desktop frame can scale the whole card. */
.card {
  font-size: 16px;
  margin: calc(var(--fw) * 0.045) 0 0;
  padding: 0.75em 0.85em 0.95em;
  text-align: left;
  border-radius: 1.4em;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(24, 26, 40, 0.9); }
}
.head { display: flex; align-items: center; gap: 0.65em; }
.avatar { position: relative; flex: none; width: 2.35em; height: 2.35em; }
.face { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #a9acba, #6b6e7f); }
.face svg { display: block; width: 100%; height: 100%; }
.badge {
  position: absolute; right: -0.2em; bottom: -0.2em;
  width: 1.1em; height: 1.1em;
  display: grid; place-items: center;
  border-radius: 0.32em;
  background: #545769;
  box-shadow: 0 0 0 1.5px rgba(30, 32, 46, 1);
}
.badge svg { width: 78%; height: 78%; }
.who { flex: 1; min-width: 0; margin: 0; font-weight: 800; font-size: 0.95em; line-height: 1.25; }
.now { font-size: 0.82em; color: var(--text-2); }
.thread { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2em; margin: 0.8em 0 0 0.5em; }
.msg {
  position: relative;
  isolation: isolate;
  margin: 0;
  max-width: 88%;
  padding: 0.5em 0.82em 0.56em;
  border-radius: 1.15em;
  background: var(--bubble);
  font-size: 1.03em;
  line-height: 1.32;
}
/* The tail on the last bubble of a run, drawn the way Messages draws it. */
.msg.tail::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -6px;
  bottom: 0;
  width: 30px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%233a3c4a' d='M6 2V12C6 16 3.5 19 0 20C4.5 20.4 8.6 19.4 11.5 17.6C14.5 19.2 18.5 20 24 20H30V2Z'/%3E%3C/svg%3E") no-repeat 0 0 / 30px 20px;
}
.typing {
  display: none;
  position: relative;
  align-items: center;
  gap: 0.32em;
  margin-top: 0.25em;
  padding: 0.78em 0.9em;
  border-radius: 1.15em;
  background: var(--bubble);
}
.typing.on { display: inline-flex; }
.typing::before, .typing::after { content: ""; position: absolute; border-radius: 50%; background: var(--bubble); }
.typing::before { left: -1px; bottom: -1px; width: 0.7em; height: 0.7em; }
.typing::after { left: -0.45em; bottom: -0.45em; width: 0.34em; height: 0.34em; }
.typing i { width: 0.5em; height: 0.5em; border-radius: 50%; background: rgba(244, 241, 234, 0.92); opacity: 0.32; animation: blink 1.25s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.16s; }
.typing i:nth-child(3) { animation-delay: 0.32s; }

/* The text types itself in for everyone: it is the story beat, not decoration. Reduced motion gets fades only. */
html.js .card { opacity: 0; transition: opacity 0.45s ease; }
html.js .card.in { opacity: 1; }
html.js .msg { display: none; }
html.js .msg.on { display: block; animation: fade 0.3s ease both; }
html.js .typing.on { animation: fade 0.22s ease both; }
html.js .thread.measure .msg { display: block; }
html.js .thread.measure .typing { display: inline-flex; }

/* The title, the date and the ways to remember it */
.info { position: relative; z-index: 1; margin-top: auto; padding: 32px 24px calc(env(safe-area-inset-bottom) + 22px); max-width: 560px; }
.eyebrow { margin: 0 0 12px; font: 800 11.5px/1.2 var(--body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3); }
h1 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.92; }
h1 .t1 { display: block; font-size: clamp(48px, 14.4vw, 66px); }
h1 .t2 {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  font: 700 13.5px/1 var(--body);
  letter-spacing: 0.36em;
  text-transform: uppercase;
}
h1 .t2::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.55; }
.tagline { margin: 16px 0 0; font: 500 18px/1.4 var(--body); color: var(--text-2); }
.when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 22px; }
.when p { margin: 0; }
.date { font: 600 32px/1 var(--display); letter-spacing: 0.01em; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 26px rgba(255, 214, 107, 0.22); }
.count { font: 700 14px/1.3 var(--body); color: var(--text-2); }
.platforms { flex-basis: 100%; margin-top: 6px !important; font-size: 14px; color: var(--text-3); }
.actions { margin-top: 22px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--text);
  color: var(--ink);
  font: 800 16px/1 var(--body);
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  transition: translate 0.18s var(--ease), box-shadow 0.2s var(--ease), scale 0.12s var(--ease);
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { translate: 0 -1px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4); }
.btn:active { scale: 0.98; }
.links { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 6px; }
.link {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--text);
  font: 700 15px/1 var(--body);
  text-decoration: underline;
  text-decoration-color: rgba(244, 241, 234, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s;
}
.link:hover { text-decoration-color: var(--text); }
.link[hidden] { display: none; }
.promise { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); font: 600 13.5px/1.55 var(--body); color: var(--text-3); }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; font: 700 12.5px/1 var(--body); color: var(--text-3); }

/* Desktop: the painting becomes a phone-sized frame, the words sit beside it over a blurred copy. */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  :root {
    --fh: min(calc(100svh - 64px), 1060px);
    --fw: calc(var(--fh) * 9 / 16);
  }
  .bg {
    display: block;
    position: fixed;
    inset: -10%;
    z-index: 0;
    background: #2a2140 url("/assets/img/courtyard-dusk.webp") center / cover;
    filter: blur(60px) saturate(1.25) brightness(0.4);
  }
  .stage {
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 500px) var(--fw);
    grid-template-areas: "info phone";
    justify-content: center;
    align-items: center;
    column-gap: clamp(56px, 7vw, 136px);
    padding: 32px 40px;
  }
  .phone {
    grid-area: phone;
    position: relative;
    inset: auto;
    width: var(--fw);
    height: var(--fh);
    border-radius: calc(var(--fw) * 0.09);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 50px 120px rgba(0, 0, 0, 0.55), 0 0 180px rgba(255, 170, 120, 0.1);
  }
  .art { left: 0; top: 0; width: 100%; height: 100%; translate: none; }
  .scrim {
    background: linear-gradient(180deg,
      rgba(11, 13, 20, 0.58) 0%,
      rgba(11, 13, 20, 0.12) 26%,
      rgba(11, 13, 20, 0) 40%,
      rgba(11, 13, 20, 0) 80%,
      rgba(11, 13, 20, 0.35) 100%);
  }
  .lock { grid-area: phone; align-self: start; height: var(--fh); padding: calc(var(--fh) * 0.05) calc(var(--fw) * 0.035) 0; }
  .lock::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(var(--fh) * 0.012);
    width: 36%;
    height: 5px;
    translate: -50% 0;
    border-radius: 3px;
    background: rgba(244, 241, 234, 0.78);
  }
  .card { font-size: calc(var(--fw) * 0.039); }
  .info { grid-area: info; margin: 0; padding: 0; max-width: none; }
  .eyebrow { font-size: 12.5px; }
  h1 .t1 { font-size: clamp(54px, 4.8vw, 92px); }
  h1 .t2 { font-size: 15px; margin-top: 18px; }
  .tagline { font-size: 20px; margin-top: 20px; }
  .when { margin-top: 30px; }
  .date { font-size: 40px; }
  .count, .platforms { font-size: 15px; }
  .actions { margin-top: 30px; }
  .btn { display: inline-flex; width: auto; }
  .promise { margin-top: 30px; max-width: 420px; font-size: 14px; }
}

/* Movement. Everything below is skipped when the visitor asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation-name: dot; }
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    background: #000;
    pointer-events: none;
    animation: wake 0.9s ease-out 0.05s both;
  }
  .art { animation: drift 40s ease-in-out infinite alternate; }
  .glow { animation: breathe 6.5s ease-in-out infinite; }
  .info > * { animation: rise 0.9s var(--ease) both; animation-delay: calc(0.3s + var(--i, 0) * 0.07s); }

  html.js .card { translate: 0 -14px; scale: 0.97; }
  html.js .card.in { translate: 0 0; scale: 1; transition: opacity 0.45s ease, translate 0.6s var(--ease), scale 0.6s var(--ease); }
  html.js .msg.on { animation: pop 0.34s cubic-bezier(0.3, 1.35, 0.5, 1) both; transform-origin: 0 100%; }
  html.js .typing.on { animation: pop 0.26s var(--ease) both; transform-origin: 0 100%; }
}
@keyframes dot {
  0%, 60%, 100% { opacity: 0.32; translate: 0 0; }
  30% { opacity: 0.95; translate: 0 -2px; }
}
@keyframes blink { 0%, 60%, 100% { opacity: 0.32; } 30% { opacity: 0.95; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wake { from { opacity: 1; } to { opacity: 0; } }
@keyframes drift { from { scale: 1; } to { scale: 1.07; } }
@keyframes breathe { 0%, 100% { opacity: 0.5; scale: 0.9; } 50% { opacity: 0.95; scale: 1.08; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes pop { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }


/* ---------- Living details: dust in the light, the tower light you can tap, a warm cursor ---------- */

.motes { position: absolute; inset: 0; pointer-events: none; display: none; }
.motes i {
  position: absolute; left: var(--x); top: var(--y);
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 238, 200, 0.95);
  box-shadow: 0 0 6px 1px rgba(255, 214, 150, 0.6);
  opacity: 0;
}
.tower-hit {
  position: absolute; left: 15.9%; top: 19.9%;
  width: 15%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.glow::after {
  content: ""; position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 178, 92, 0.9), rgba(255, 140, 70, 0.3) 48%, rgba(255, 140, 70, 0));
  opacity: 0; transition: opacity 1.6s ease;
}
.glow.warm::after { opacity: 1; transition-duration: 0.25s; }
.cursor-glow { display: none; }

.cue { display: none; }

/* ---------- Shared section type ---------- */

.story, .class, .keepsake, .weeks, .outro { position: relative; z-index: 1; background: var(--ink); }
.wrap { padding-inline: max(24px, calc((100% - 760px) / 2)); }
.kicker { margin: 0 0 12px; font: 800 11.5px/1.2 var(--body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3); }
.class h2, .keepsake h2, .weeks h2, .outro h2 {
  margin: 0;
  font: 700 clamp(32px, 9vw, 50px) / 1.04 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ---------- The story: three beats, each a plate that develops in a sweep of warm light ---------- */

.beat { position: relative; height: 100svh; min-height: 600px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate; }
.beat[data-copy="top"] { justify-content: flex-start; }
.beat-bg { display: none; }
.beat-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #1b1830; }
.beat-art img {
  position: absolute; left: 0; top: -7%;
  width: 100%; height: 114%;
  object-fit: cover; object-position: var(--fx, 50%) 50%;
  translate: 0 calc(var(--p, 0) * 6%);
}
.beat-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--ink) 0%, rgba(11, 13, 20, 0.5) 12%, rgba(11, 13, 20, 0) 30%, rgba(11, 13, 20, 0) 56%, rgba(11, 13, 20, 0.78) 82%, var(--ink) 100%);
}
.beat[data-copy="top"] .beat-art::after {
  background: linear-gradient(180deg, var(--ink) 0%, rgba(11, 13, 20, 0.8) 16%, rgba(11, 13, 20, 0.3) 38%, rgba(11, 13, 20, 0) 54%, rgba(11, 13, 20, 0) 84%, var(--ink) 100%);
}
.beat-copy { padding: 0 24px clamp(72px, 12svh, 120px); }
.beat[data-copy="top"] .beat-copy { padding: clamp(84px, 14svh, 140px) 24px 0; }
.line {
  margin: 0;
  max-width: 13ch;
  font: 700 clamp(34px, 9.8vw, 54px) / 1.04 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
  text-shadow: 0 2px 28px rgba(11, 13, 20, 0.55);
}
.whisper { margin: 14px 0 0; font: 600 18px/1.4 var(--body); color: var(--text-2); }
.leak {
  position: absolute; top: -10%; bottom: -10%; left: 0;
  width: 70%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 241, 214, 0) 0%, rgba(255, 241, 214, 0.5) 30%, rgba(255, 246, 228, 0.92) 50%, rgba(255, 241, 214, 0.5) 70%, rgba(255, 241, 214, 0) 100%);
  filter: blur(24px);
  mix-blend-mode: screen;
}
html.js .beat .beat-art { opacity: 0; }
html.js .beat.lit .beat-art { animation: fade 0.8s ease both; }
html.js .beat .beat-copy > * { opacity: 0; }
html.js .beat.lit .beat-copy > * { animation: fade 0.8s ease both; animation-delay: calc(0.3s + var(--k, 0) * 0.14s); }

/* ---------- The yearbook ---------- */

.class { padding: 96px 0 104px; }
.yearbook {
  list-style: none;
  margin: 34px 0 0;
  padding: 10px 24px 30px;
  display: flex; gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 24px;
  scrollbar-width: none;
}
.yearbook::-webkit-scrollbar { display: none; }
.senior { flex: 0 0 76vw; max-width: 320px; scroll-snap-align: start; }
.senior figure {
  margin: 0;
  padding: 10px 10px 18px;
  border-radius: 3px;
  background: #f4eee0;
  color: #1e1e28;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  rotate: var(--r, 0deg);
  transition: rotate 0.45s var(--ease), translate 0.45s var(--ease);
}
.senior:nth-child(1) { --r: -1.2deg; }
.senior:nth-child(2) { --r: 0.8deg; }
.senior:nth-child(3) { --r: -0.6deg; }
.senior:nth-child(4) { --r: 1.1deg; }
.senior figure:hover { rotate: 0deg; translate: 0 -4px; }
.photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #3a4260; }
.photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.photo .blink { opacity: 0; }
.photo.closed .blink { opacity: 1; }
.senior figcaption { display: flex; flex-direction: column; gap: 4px; padding: 14px 6px 0; }
.name { font: 700 22px/1.1 var(--display); letter-spacing: -0.02em; }
.tag { font: 800 11px/1.2 var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: #8a7a5e; }
.hook { margin-top: 6px; font: 500 15px/1.45 var(--body); color: #3d3a44; }

/* ---------- The keepsake: a letter sealed until 12.17.2026, kept only on this device ---------- */

html:not(.js) .keepsake { display: none; }
.keepsake { padding: 104px 24px 112px; overflow: hidden; isolation: isolate; }
.keep-bg { position: absolute; inset: -6%; z-index: -1; background: url("/assets/img/keepsake-desk-s.webp") center / cover; filter: blur(14px) brightness(0.3) saturate(1.1); }
.keepsake::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink), rgba(11, 13, 20, 0) 22%, rgba(11, 13, 20, 0) 78%, var(--ink)); }
.keep-inner { max-width: 520px; margin: 0 auto; text-align: center; }
.keep-sub { max-width: 34ch; margin: 14px auto 0; font: 500 16.5px/1.55 var(--body); color: var(--text-2); }
.keep-stage { display: grid; place-items: center; min-height: 290px; margin: 34px auto 0; }
.keep-stage > * { grid-area: 1 / 1; }
.paper {
  width: min(100%, 440px);
  padding: 20px 22px 12px;
  border-radius: 4px;
  background: #fbf6ea;
  color: #2b2a33;
  text-align: left;
  rotate: -0.6deg;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.paper:focus-within { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--gold); }
.paper textarea {
  display: block; width: 100%; height: calc(28px * 7);
  padding: 0; border: 0; outline: 0; resize: none;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 90, 140, 0.16) 27px 28px);
  background-attachment: local;
  color: inherit;
  font: 500 17px/28px var(--body);
}
.paper textarea::placeholder { color: #9a917f; }
.paper-foot { margin: 6px 0 0; text-align: right; font: 700 12px/1 var(--body); color: #9a917f; }
.envelope { display: none; position: relative; width: min(88%, 380px); aspect-ratio: 1.5; perspective: 1000px; rotate: -1.5deg; }
.envelope::before { content: ""; position: absolute; inset: -30% -20%; background: radial-gradient(closest-side, rgba(255, 200, 130, 0.22), rgba(255, 200, 130, 0)); }
.keepsake[data-state="sealing"] .envelope,
.keepsake[data-state="sealed"] .envelope,
.keepsake[data-state="ready"] .envelope { display: block; }
.keepsake[data-state="sealed"] .paper,
.keepsake[data-state="ready"] .paper { display: none; }
.env-back { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(180deg, #efe4cd, #e6d7bb); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
.env-letter { position: absolute; left: 7%; right: 7%; top: 6%; height: 80%; z-index: 1; border-radius: 2px; background: #fbf6ea repeating-linear-gradient(180deg, transparent 0 13px, rgba(70, 90, 140, 0.14) 13px 14px); }
.env-fold { position: absolute; inset: 0; z-index: 2; }
.env-l { background: #eadcc0; clip-path: polygon(0 0, 51% 56%, 0 100%); }
.env-r { background: #e7d8ba; clip-path: polygon(100% 0, 49% 56%, 100% 100%); }
.env-b { background: linear-gradient(0deg, #e2d1b1, #ecdfc6); clip-path: polygon(0 100%, 50% 44%, 100% 100%); }
.env-flap-wrap { position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 3; transform-origin: 50% 0; filter: drop-shadow(0 3px 4px rgba(90, 60, 20, 0.22)); }
.env-flap { width: 100%; height: 100%; background: linear-gradient(180deg, #f1e6d0, #e2d1b0); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-seal {
  position: absolute; left: 50%; top: 56%; z-index: 4;
  width: 17%; aspect-ratio: 1; translate: -50% -50%;
  display: grid; place-items: center;
  border-radius: 50% 46% 52% 48% / 48% 53% 47% 52%;
  color: rgba(96, 52, 10, 0.62);
  background: radial-gradient(circle at 36% 32%, #e7b354, #c3862c 42%, #8f5719 100%);
  box-shadow: 0 4px 10px rgba(60, 30, 0, 0.45), inset 0 -3px 5px rgba(60, 25, 0, 0.35), inset 0 2px 3px rgba(255, 236, 180, 0.45);
}
.env-seal svg { width: 64%; height: 64%; filter: drop-shadow(0 1px 0 rgba(255, 226, 160, 0.45)); }
.env-note { position: absolute; left: 0; right: 0; bottom: 8%; z-index: 4; margin: 0; text-align: center; font: 800 10.5px/1.3 var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: #7b6545; }
.env-note span { display: block; margin-top: 5px; font: 700 20px/1 var(--display); letter-spacing: 0.02em; text-transform: none; color: #a2701c; }
.keep-actions { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; min-height: 112px; margin-top: 28px; }
.keep-actions .btn { width: auto; min-width: 200px; }
.keep-status { min-height: 1.4em; margin: 0; font: 600 15px/1.45 var(--body); color: var(--text-2); }
.link-btn { padding: 10px 6px; border: 0; background: none; color: var(--text); font: 700 14px/1 var(--body); text-decoration: underline; text-decoration-color: rgba(244, 241, 234, 0.32); text-underline-offset: 5px; cursor: pointer; }
.link-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button.btn { border: 0; cursor: pointer; }

/* ---------- One Week at a time ---------- */

.weeks { padding: 96px 0; }
.strip { display: flex; align-items: flex-end; justify-content: space-between; height: 40px; margin: 34px 0 12px; padding: 0; list-style: none; }
.strip li { width: 4px; height: 24px; border-radius: 2px; background: rgba(244, 241, 234, 0.16); }
.strip li:last-child { height: 38px; background: rgba(244, 241, 234, 0.4); }
.strip li.open { background: var(--gold); box-shadow: 0 0 10px rgba(255, 214, 107, 0.6); }
.strip li.next { background: var(--gold); box-shadow: 0 0 14px rgba(255, 214, 107, 0.75); }
.strip-labels { display: flex; justify-content: space-between; font: 700 13px/1.3 var(--body); color: var(--text-2); }
.strip-labels b { font-weight: 800; color: var(--gold); }
.weeks .promise { margin-top: 30px; font-size: 15px; color: var(--text-2); }

/* ---------- The way out ---------- */

.outro { padding: 56px 0 calc(env(safe-area-inset-bottom) + 28px); background: radial-gradient(120% 70% at 50% 125%, rgba(255, 178, 110, 0.32), rgba(255, 140, 90, 0.07) 45%, rgba(255, 140, 90, 0) 70%), var(--ink); }
.outro-sub { margin: 14px 0 0; font: 600 16px/1.4 var(--body); color: var(--text-2); }
.outro .foot { margin-top: 56px; }

@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  :root { --bw: calc(min(100vh - 160px, 900px) * 9 / 16); }
  .cue {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    position: absolute; bottom: 24px;
    left: max(40px, calc((100% - 500px - clamp(56px, 7vw, 136px) - var(--fw)) / 2));
    font: 800 11px/1 var(--body); letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--text-3); text-decoration: none;
  }
  .cue::after { content: ""; width: 1px; height: 30px; background: linear-gradient(var(--text-3), rgba(244, 241, 234, 0)); transform-origin: top; }
  .beat {
    height: 100vh; min-height: 640px;
    display: grid;
    grid-template-columns: var(--bw) minmax(0, 470px);
    grid-template-areas: "art copy";
    justify-content: center; align-items: center;
    column-gap: clamp(56px, 7vw, 136px);
    padding: 0 40px;
  }
  .beat:nth-child(even) { grid-template-columns: minmax(0, 470px) var(--bw); grid-template-areas: "copy art"; }
  .beat[data-copy] { justify-content: center; }
  .beat::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink), rgba(11, 13, 20, 0) 20%, rgba(11, 13, 20, 0) 80%, var(--ink)); }
  .beat-bg { display: block; position: absolute; inset: -10%; z-index: -2; background: var(--img) center / cover; filter: blur(60px) saturate(1.2) brightness(0.34); }
  .beat-art {
    grid-area: art; position: relative; inset: auto; z-index: 0;
    width: var(--bw); aspect-ratio: 9 / 16;
    border-radius: calc(var(--bw) * 0.06);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 40px 100px rgba(0, 0, 0, 0.5);
  }
  .beat-art::after, .beat[data-copy="top"] .beat-art::after { background: linear-gradient(180deg, rgba(11, 13, 20, 0.18), rgba(11, 13, 20, 0) 30%, rgba(11, 13, 20, 0) 74%, rgba(11, 13, 20, 0.28)); }
  .beat-copy, .beat[data-copy="top"] .beat-copy { grid-area: copy; padding: 0; }
  .line { max-width: 12ch; font-size: clamp(44px, 4.4vw, 78px); }
  .whisper { font-size: 21px; }
  .kicker { font-size: 12.5px; }
  .class h2, .keepsake h2, .weeks h2, .outro h2 { font-size: clamp(44px, 4vw, 64px); }
  .class { padding: 128px 0 140px; }
  .class .wrap { padding-inline: max(80px, calc((100% - 1200px) / 2 + 40px)); }
  .yearbook {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
    max-width: 1200px; margin: 48px auto 0; padding: 10px 40px 0;
    overflow: visible;
  }
  .senior { max-width: none; }
  .keepsake { padding: 140px 40px; }
  .keep-sub { font-size: 18px; }
  .weeks, .outro { padding-block: 128px; }
  .strip { height: 52px; }
  .strip li { width: 6px; height: 34px; border-radius: 3px; }
  .strip li:last-child { height: 52px; }
  .outro { padding-bottom: 40px; }
  .outro .btn { display: inline-flex; width: auto; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor-glow {
    display: block; position: fixed; left: 0; top: 0; z-index: 6;
    width: 640px; height: 640px; margin: -320px 0 0 -320px;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 214, 160, 0.09), rgba(255, 214, 160, 0));
    mix-blend-mode: screen;
    opacity: 0; transition: opacity 0.8s ease;
  }
  .cursor-glow.on { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .motes { display: block; }
  .motes i { animation: mote var(--d, 12s) ease-in-out var(--w, 0s) infinite; }
  .beat-art img { will-change: translate; }
  html.js .beat.lit .leak { animation: leak 0.9s cubic-bezier(0.45, 0.05, 0.35, 1) both; }
  html.js .beat.lit .beat-art { animation: develop 1.2s ease both; }
  html.js .beat.lit .beat-copy > * { animation-name: rise; animation-duration: 0.9s; animation-timing-function: var(--ease); }
  .strip li.next { animation: beacon 2.6s ease-in-out infinite; }
  .cue::after { animation: cue 2.4s ease-in-out infinite; }
  .keepsake[data-state="sealing"] .paper { animation: fold-away 0.6s cubic-bezier(0.5, 0, 0.75, 0) both; transform-origin: 50% 0; }
  .keepsake[data-state="sealing"] .envelope { animation: rise 0.5s var(--ease) 0.35s both; }
  .keepsake[data-state="sealing"] .env-letter { animation: letter-in 0.55s var(--ease) 0.6s both; }
  .keepsake[data-state="sealing"] .env-flap-wrap { animation: flap-close 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.1s both; }
  .keepsake[data-state="sealing"] .env-seal { animation: stamp 0.42s cubic-bezier(0.3, 1.5, 0.5, 1) 1.6s both; }
  .keepsake[data-state="sealing"] .env-note { animation: fade 0.5s ease 1.8s both; }
}
.keepsake.appear .envelope { animation: fade 0.4s ease both; }
@keyframes mote {
  0% { opacity: 0; translate: 0 0; }
  20% { opacity: var(--o, 0.8); }
  80% { opacity: calc(var(--o, 0.8) * 0.7); }
  100% { opacity: 0; translate: var(--dx, -16px) var(--dy, -46px); }
}
@keyframes leak {
  0% { opacity: 0; translate: -110% 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; translate: 160% 0; }
}
@keyframes develop {
  from { opacity: 0; filter: brightness(1.7) saturate(0.7); }
  35% { opacity: 1; }
  to { opacity: 1; filter: none; }
}
@keyframes beacon { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes cue { 0% { scale: 1 0; opacity: 1; } 60% { scale: 1 1; opacity: 1; } 100% { scale: 1 1; opacity: 0; } }
@keyframes fold-away {
  0% { transform: none; opacity: 1; }
  45% { transform: scaleY(0.36); opacity: 1; }
  100% { transform: translateY(60px) scaleY(0.36) scale(0.6); opacity: 0; }
}
@keyframes letter-in { from { translate: 0 -78%; } to { translate: 0 0; } }
@keyframes flap-close {
  0% { transform: rotateX(180deg); z-index: 0; }
  1% { z-index: 3; }
  100% { transform: rotateX(0deg); z-index: 3; }
}
@keyframes stamp { from { opacity: 0; scale: 1.6; } to { opacity: 1; scale: 1; } }
