/* ═══════════════════════════════════════════════════════════
   loveletter.ink — site stylesheet
   Concept: the interface is the inkwell, the letter is the paper.
   Chrome flips with the theme. Paper never does.
   ═══════════════════════════════════════════════════════════ */

/* ── tokens ───────────────────────────────────────────────── */
:root {
  --ground: #12131F; --surface: #1A1B29; --surface-sunk: #0D0E18;
  --line: #2E3044;   --line-soft: #232536;
  --text: #EDE7DC;   --text-dim: #A5A2B8; --text-faint: #6E6B84;
  --wax: #D9526A;    --wax-deep: #B32741; --wax-tint: #2A1A26;
  --gilt: #D3B268;   --gilt-deep: #A8842F; --gilt-soft: #5A4B2A;
  --ok: #7FA98C;     --warn: #C79A4E;     --stop: #E0705F;

  /* paper is deliberately theme-invariant */
  --paper: #F6EEE1; --paper-edge: #E4D8C4; --paper-ink: #1E1A24;
  --paper-ink-dim: #6B6070; --paper-rule: #DCCDB6;

  --glow-warm: rgba(211,178,104,.20);
  --glow-core: rgba(246,238,225,.11);
  --vignette: rgba(0,0,0,.5);
  --ember: 245,214,150;

  --lift-letter:
      0 1px 0 rgba(255,255,255,.4) inset,
      0 2px 6px rgba(0,0,0,.5),
      0 24px 50px -12px rgba(0,0,0,.72),
      0 0 150px -30px rgba(246,238,225,.35);
  --lift-scrap:
      0 1px 0 rgba(255,255,255,.35) inset,
      0 10px 24px -14px rgba(0,0,0,.8),
      0 0 60px -26px rgba(246,238,225,.3);

  --font-display: "Canela", "Playfair Display", Didot, "Bodoni MT",
                  "Iowan Old Style", Georgia, serif;
  --font-letter: "EB Garamond", "Iowan Old Style", "Palatino Linotype",
                 Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: "Söhne", ui-sans-serif, -apple-system, "Segoe UI", Inter,
             system-ui, sans-serif;

  --step--1: .8125rem; --step-0: 1.0625rem; --step-1: 1.1875rem;
  --step-2: 1.4375rem; --step-3: 1.9375rem;
  --step-4: clamp(2rem, 4.4vw, 3rem);

  --sp-1: .375rem; --sp-2: .625rem; --sp-3: 1rem; --sp-4: 1.5rem;
  --sp-5: 2.5rem;  --sp-6: 4.5rem;  --sp-7: 8rem;
  --ease: cubic-bezier(.22,.7,.28,1);
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #E7E2DA; --surface: #F2EDE5; --surface-sunk: #DED8CE;
    --line: #CFC7B9;   --line-soft: #DED8CE;
    --text: #1A1A28;   --text-dim: #5C5768; --text-faint: #8A8496;
    --wax: #B32741;    --wax-deep: #8E1830; --wax-tint: #F6E2E4;
    --gilt: #A8842F;   --gilt-deep: #7E6222; --gilt-soft: #E3D3A8;
    --ok: #4A7358;     --warn: #9A6520;     --stop: #A32B22;
    --glow-warm: rgba(168,132,47,.14); --glow-core: rgba(255,252,244,.55);
    --vignette: rgba(90,78,60,.14); --ember: 150,116,48;
    --lift-letter:
        0 1px 0 rgba(255,255,255,.8) inset,
        0 2px 4px rgba(26,26,40,.07),
        0 18px 36px -10px rgba(26,26,40,.2),
        0 48px 70px -36px rgba(26,26,40,.28);
    --lift-scrap:
        0 1px 0 rgba(255,255,255,.8) inset,
        0 8px 18px -12px rgba(26,26,40,.4);
  }
}
:root[data-theme="light"] {
  --ground: #E7E2DA; --surface: #F2EDE5; --surface-sunk: #DED8CE;
  --line: #CFC7B9;   --line-soft: #DED8CE;
  --text: #1A1A28;   --text-dim: #5C5768; --text-faint: #8A8496;
  --wax: #B32741;    --wax-deep: #8E1830; --wax-tint: #F6E2E4;
  --gilt: #A8842F;   --gilt-deep: #7E6222; --gilt-soft: #E3D3A8;
  --ok: #4A7358;     --warn: #9A6520;     --stop: #A32B22;
  --glow-warm: rgba(168,132,47,.14); --glow-core: rgba(255,252,244,.55);
  --vignette: rgba(90,78,60,.14); --ember: 150,116,48;
  --lift-letter:
      0 1px 0 rgba(255,255,255,.8) inset,
      0 2px 4px rgba(26,26,40,.07),
      0 18px 36px -10px rgba(26,26,40,.2),
      0 48px 70px -36px rgba(26,26,40,.28);
  --lift-scrap:
      0 1px 0 rgba(255,255,255,.8) inset,
      0 8px 18px -12px rgba(26,26,40,.4);
}
:root[data-theme="dark"] {
  --ground: #12131F; --surface: #1A1B29; --surface-sunk: #0D0E18;
  --line: #2E3044;   --line-soft: #232536;
  --text: #EDE7DC;   --text-dim: #A5A2B8; --text-faint: #6E6B84;
  --wax: #D9526A;    --wax-deep: #B32741; --wax-tint: #2A1A26;
  --gilt: #D3B268;   --gilt-deep: #A8842F; --gilt-soft: #5A4B2A;
  --ok: #7FA98C;     --warn: #C79A4E;     --stop: #E0705F;
  --glow-warm: rgba(211,178,104,.20); --glow-core: rgba(246,238,225,.11);
  --vignette: rgba(0,0,0,.5); --ember: 245,214,150;
  --lift-letter:
      0 1px 0 rgba(255,255,255,.4) inset,
      0 2px 6px rgba(0,0,0,.5),
      0 24px 50px -12px rgba(0,0,0,.72),
      0 0 150px -30px rgba(246,238,225,.35);
  --lift-scrap:
      0 1px 0 rgba(255,255,255,.35) inset,
      0 10px 24px -14px rgba(0,0,0,.8),
      0 0 60px -26px rgba(246,238,225,.3);
}

/* ── reset & ground ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ground); }
body {
  position: relative; min-height: 100vh; overflow-x: hidden;
  background: var(--ground); color: var(--text);
  font-family: var(--font-ui); font-size: var(--step-0); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

.lamp {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(100vw 70vh at 50% -6%, var(--glow-warm), transparent 62%),
    radial-gradient(70vw 55vh at 50% 26%, var(--glow-core), transparent 66%);
  animation: breathe 11s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .82; } 50% { opacity: 1; } }
#embers { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .28; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vign { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 24vw 11vw var(--vignette); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.shell { position: relative; z-index: 3; max-width: 1040px;
  margin-inline: auto; padding: var(--sp-4) var(--sp-4) var(--sp-7); }
.shell-narrow { max-width: 780px; }

.skip {
  position: absolute; left: -9999px; z-index: 99;
  background: var(--wax-deep); color: #FBF4EA; padding: .8rem 1.2rem;
  border-radius: 2px; font-size: .8125rem;
}
.skip:focus { left: var(--sp-4); top: var(--sp-3); }

/* ── nav ──────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding-block: var(--sp-2) var(--sp-6); flex-wrap: wrap; }
.lockup { display: flex; align-items: center; gap: .55rem;
  text-decoration: none; color: inherit; }
.lockup-mark { width: 26px; height: 26px; flex: none; }
.lockup-word { font-family: var(--font-display); font-size: 1.15rem;
  font-weight: 400; letter-spacing: -.025em; line-height: 1; }
.lockup-word .tld { color: var(--wax); }
.nav-right { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-ui); font-size: .75rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; line-height: 1;
  padding: 1.08rem 1.9rem; border: 0; border-radius: 2px;
  cursor: pointer; color: #FBF4EA; text-decoration: none; white-space: nowrap;
  background: linear-gradient(178deg, var(--wax) 0%, var(--wax-deep) 92%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.3) inset,
    0 -1px 0 rgba(0,0,0,.28) inset,
    0 0 0 1px rgba(142,24,48,.55),
    0 12px 26px -14px rgba(179,39,65,.95);
  transition: transform .28s var(--ease), box-shadow .4s var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  background: linear-gradient(102deg, transparent 34%,
              rgba(255,255,255,.26) 47%, transparent 60%);
  transform: translateX(-130%); transition: transform .9s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.34) inset,
    0 -1px 0 rgba(0,0,0,.28) inset,
    0 0 0 1px rgba(179,39,65,.8),
    0 20px 40px -16px rgba(179,39,65,1),
    0 0 48px -12px rgba(217,82,106,.75);
}
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: translateY(0) scale(.994); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

/* the lantern — "is one waiting for me?"
   Gold reads as discovery, and it's the only control on the page that
   moves on its own, which is what actually pulls the eye. */
.btn-gold {
  color: #17131C;
  background: linear-gradient(178deg,
              color-mix(in srgb, var(--gilt) 92%, #FFF6DC) 0%, var(--gilt-deep) 96%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.55) inset,
    0 -1px 0 rgba(0,0,0,.22) inset,
    0 0 0 1px color-mix(in srgb, var(--gilt-deep) 80%, transparent),
    0 12px 28px -14px rgba(211,178,104,.9),
    0 0 0 0 rgba(211,178,104,.5);
  animation: lantern 3.6s var(--ease) infinite;
  padding-inline: 1.7rem;
}
@keyframes lantern {
  0%, 100% { box-shadow:
    0 1px 0 rgba(255,255,255,.55) inset, 0 -1px 0 rgba(0,0,0,.22) inset,
    0 0 0 1px color-mix(in srgb, var(--gilt-deep) 80%, transparent),
    0 12px 28px -14px rgba(211,178,104,.9), 0 0 0 0 rgba(211,178,104,.42); }
  55%     { box-shadow:
    0 1px 0 rgba(255,255,255,.55) inset, 0 -1px 0 rgba(0,0,0,.22) inset,
    0 0 0 1px color-mix(in srgb, var(--gilt-deep) 80%, transparent),
    0 16px 40px -14px rgba(211,178,104,1), 0 0 0 9px rgba(211,178,104,0); }
}
.btn-gold::after {            /* shimmer runs on a loop, not just on hover */
  background: linear-gradient(102deg, transparent 36%,
              rgba(255,255,255,.55) 48%, transparent 60%);
  animation: sheen 4.4s var(--ease) infinite;
}
@keyframes sheen {
  0%, 62%  { transform: translateX(-130%); }
  88%, 100% { transform: translateX(130%); }
}
.btn-gold:hover {
  transform: translateY(-2px);
  background: linear-gradient(178deg,
              color-mix(in srgb, var(--gilt) 80%, #FFFCF0) 0%, var(--gilt) 96%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 -1px 0 rgba(0,0,0,.22) inset,
    0 0 0 1px var(--gilt),
    0 22px 46px -16px rgba(211,178,104,1),
    0 0 60px -10px rgba(211,178,104,.85);
  animation-play-state: paused;
}
.btn-gold:hover::after { animation-play-state: paused; transform: translateX(130%); }
.btn-gold .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--wax-deep);
  flex: none; box-shadow: 0 0 0 3px rgba(142,24,48,.18);
}

.btn-line {
  color: var(--text); background: transparent;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gilt) 42%, transparent);
  transition: transform .28s var(--ease), box-shadow .4s var(--ease),
              background-color .4s var(--ease);
}
.btn-line::after { background: none; }
.btn-line:hover {
  transform: translateY(-2px);
  background-color: color-mix(in srgb, var(--gilt) 9%, transparent);
  box-shadow: 0 0 0 1px var(--gilt), 0 0 36px -14px var(--gilt);
}
.btn-quiet { background: none; box-shadow: none; color: var(--text-dim);
  padding: .55rem .3rem; }
.btn-quiet::after { background: none; }
.btn-quiet:hover { transform: none; box-shadow: none; color: var(--gilt); }
.btn-sm { padding: .72rem 1.15rem; font-size: .6875rem; }

/* ── shared type ──────────────────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .19em;
  text-transform: uppercase; color: var(--gilt); margin-bottom: var(--sp-4);
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--gilt); opacity: .7; }
.sec { padding-block: var(--sp-6); }
.sec-head { margin-bottom: var(--sp-5); }
.sec-title { font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-4); line-height: 1.08; letter-spacing: -.025em;
  margin: 0 0 var(--sp-3); text-wrap: balance; max-width: 22ch; }
.sec-lede { font-family: var(--font-letter); font-size: var(--step-1);
  line-height: 1.72; color: var(--text-dim); max-width: 54ch; margin: 0;
  text-wrap: pretty; }
.rule { height: 1px; border: 0; margin: 0;
  background: linear-gradient(to right, var(--gilt), transparent 72%); opacity: .35; }
.fine { font-size: .8125rem; color: var(--text-faint); margin: 0; max-width: 54ch; }
.label { font-size: .625rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-faint); }

/* ── hero ─────────────────────────────────────────────────── */
.hero { display: grid; gap: var(--sp-6); align-items: center; padding-bottom: var(--sp-6); }
@media (min-width: 920px) { .hero { grid-template-columns: 1.05fr .95fr; gap: var(--sp-5); } }
.hero-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.02;
  letter-spacing: -.032em; margin: 0 0 var(--sp-4);
}
.hero-title em { font-style: italic; color: var(--wax);
  text-shadow: 0 0 44px color-mix(in srgb, var(--wax) 45%, transparent); }
.hero-sub { font-family: var(--font-letter); font-size: var(--step-2);
  line-height: 1.55; color: var(--text-dim); max-width: 34ch;
  margin: 0 0 var(--sp-5); text-wrap: pretty; }
.hero-foot { display: flex; align-items: center; gap: .6rem; margin-top: var(--sp-4);
  font-size: .75rem; color: var(--text-faint); }
.tick { width: 6px; height: 6px; border-radius: 999px; background: var(--wax); flex: none;
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--wax) 70%, transparent);
  animation: pulse 3.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.count { font-variant-numeric: tabular-nums; color: var(--text-dim); }

/* ── the letter object ────────────────────────────────────── */
.stage { perspective: 1500px; display: flex; justify-content: center; }
.env {
  position: relative; width: min(100%, 430px); cursor: pointer;
  background: var(--paper); color: var(--paper-ink);
  border-radius: 3px; box-shadow: var(--lift-letter);
  padding: 182px var(--sp-5) var(--sp-5);
  transform-style: preserve-3d; transition: box-shadow .8s var(--ease);
}
.env-lg { width: min(100%, 560px); }
.env::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px;
  pointer-events: none; opacity: .45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23p)' opacity='0.35'/%3E%3C/svg%3E");
}
.flap {
  position: absolute; top: 0; left: 0; right: 0; height: 126px;
  background: linear-gradient(168deg, var(--paper-edge), var(--paper));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center; transform: rotateX(0deg);
  transition: transform 1.05s var(--ease); z-index: 3; border-radius: 3px 3px 0 0;
}
.flap::after { content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 -3px 14px rgba(30,26,36,.16) inset; }
.env.open .flap { transform: rotateX(-174deg); }
.seal-halves { position: absolute; top: 88px; left: 50%; width: 76px; height: 76px;
  margin-left: -38px; z-index: 4; pointer-events: none; }
.seal-half { position: absolute; inset: 0;
  filter: drop-shadow(0 5px 10px rgba(142,24,48,.45));
  transition: transform 1.15s var(--ease), opacity 1.15s var(--ease); }
.seal-half.l { clip-path: inset(0 50.2% 0 0); }
.seal-half.r { clip-path: inset(0 0 0 50.2%); }
.env.open .seal-half.l { transform: translate(-104px, 152px) rotate(-64deg); opacity: 0; }
.env.open .seal-half.r { transform: translate(104px, 138px) rotate(58deg); opacity: 0; }
.seal-svg { width: 100%; height: 100%; display: block; }
.postmark { position: absolute; top: 16px; right: 14px; z-index: 5;
  width: 84px; height: 84px; transform: rotate(-12deg); opacity: .3;
  color: var(--wax-deep); pointer-events: none; }
.env-tag {
  position: absolute; left: 0; right: 0; top: 172px; text-align: center;
  font-size: .625rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--paper-ink-dim);
  transition: opacity .5s var(--ease); z-index: 2; pointer-events: none;
}
.env.open .env-tag { opacity: 0; }
.letter-dateline { font-size: .625rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--paper-ink-dim); margin: 0 0 var(--sp-3);
  opacity: 0; transition: opacity .6s var(--ease) .45s; }
.env.open .letter-dateline { opacity: 1; }
.letter-body {
  font-family: var(--font-letter); font-size: var(--step-1); line-height: 1.82;
  margin: 0 0 var(--sp-3); filter: blur(5.5px); opacity: .3; user-select: none;
  transition: filter 1.1s var(--ease) .35s, opacity 1.1s var(--ease) .35s;
}
.env.open .letter-body { filter: blur(0); opacity: 1; user-select: auto; }
.letter-body p { margin: 0 0 .85rem; }
.letter-sign { font-family: var(--font-letter); font-style: italic;
  font-size: var(--step-1); color: var(--paper-ink-dim); margin: 0;
  filter: blur(5.5px); opacity: .3;
  transition: filter 1.1s var(--ease) .6s, opacity 1.1s var(--ease) .6s; }
.env.open .letter-sign { filter: blur(0); opacity: 1; }

/* ── scraps ───────────────────────────────────────────────── */
.scraps { display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
.scrap {
  background: var(--paper); color: var(--paper-ink);
  border-radius: 2px; padding: var(--sp-4) var(--sp-4) var(--sp-3);
  box-shadow: var(--lift-scrap);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.scrap:nth-child(3n+1) { --tilt: -.7deg; }
.scrap:nth-child(3n+2) { --tilt: .5deg; }
.scrap:nth-child(3n+3) { --tilt: -.3deg; }
.scrap:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.45) inset,
    0 18px 34px -16px rgba(0,0,0,.75),
    0 0 90px -22px rgba(246,238,225,.55);
}
.scrap-line { font-family: var(--font-letter); font-size: var(--step-1);
  line-height: 1.6; margin: 0; }
.scrap-meta {
  display: flex; align-items: center; gap: .5rem; margin-top: auto;
  padding-top: var(--sp-2); border-top: 1px solid var(--paper-rule);
  font-family: var(--font-ui); font-size: .625rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--paper-ink-dim);
}
.scrap-meta::before { content: ""; width: 5px; height: 5px; border-radius: 999px;
  background: var(--wax-deep); flex: none; opacity: .8; }
.scrap.held .scrap-meta::before { background: var(--paper-ink-dim); opacity: .5; }

/* ── steps ────────────────────────────────────────────────── */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 3.4rem 1fr; gap: var(--sp-4);
  padding: var(--sp-4) 0; border-top: 1px solid var(--line-soft); align-items: start; }
.step:last-child { border-bottom: 1px solid var(--line-soft); }
.step-n { font-family: var(--font-display); font-size: 1.6rem; line-height: 1;
  color: var(--gilt); opacity: .8; padding-top: .15rem; }
.step-t { font-family: var(--font-display); font-size: var(--step-2);
  letter-spacing: -.015em; margin: 0 0 .3rem; }
.step-d { color: var(--text-dim); margin: 0; max-width: 56ch; font-size: .95rem; }

/* ── panels & fields ──────────────────────────────────────── */
.panel {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line); border-radius: 4px; padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-4);
  box-shadow: 0 30px 80px -44px rgba(0,0,0,.85), 0 0 120px -50px var(--glow-warm);
}
@media (min-width: 760px) { .panel { padding: var(--sp-6); } }
.postbox {
  display: flex; align-items: stretch; border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, var(--surface-sunk) 75%, transparent);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .35s var(--ease); max-width: 540px;
}
.postbox:focus-within { box-shadow: 0 0 0 1px var(--gilt), 0 0 32px -12px var(--gilt); }
.postbox input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  padding: 1.05rem 1.15rem; color: var(--text);
  font-family: var(--font-ui); font-size: var(--step-0); }
.postbox input::placeholder { color: var(--text-faint); }
.postbox .btn { border-radius: 0; }
@media (max-width: 520px) {
  .postbox { flex-direction: column; }
  .postbox .btn { width: 100%; }
}
.field-set { display: flex; flex-direction: column; gap: .45rem; max-width: 540px; }
.field {
  font-family: var(--font-ui); font-size: var(--step-0); color: var(--text);
  background: color-mix(in srgb, var(--surface-sunk) 75%, transparent);
  border: 0; border-radius: 2px; padding: 1.02rem 1.15rem; width: 100%; outline: 0;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow .35s var(--ease);
}
.field::placeholder { color: var(--text-faint); }
.field:focus { box-shadow: 0 0 0 1px var(--gilt), 0 0 32px -12px var(--gilt); }

.result { display: flex; align-items: center; gap: .65rem; min-height: 1.6rem;
  font-size: .875rem; color: var(--text-dim);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease); }
.result.show { opacity: 1; transform: none; pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: .45rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .11em;
  text-transform: uppercase; padding: .32rem .7rem; border-radius: 999px;
  border: 1px solid currentColor; color: var(--wax); flex: none; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.stop { color: var(--stop); }

/* six-character key */
.keys { display: flex; gap: .5rem; flex-wrap: wrap; }
.key {
  width: 3rem; height: 3.6rem; text-align: center; border: 0; outline: 0;
  background: color-mix(in srgb, var(--surface-sunk) 75%, transparent);
  box-shadow: 0 0 0 1px var(--line); border-radius: 2px;
  font-family: var(--font-letter); font-size: 1.55rem; color: var(--text);
  text-transform: uppercase; transition: box-shadow .3s var(--ease);
}
.key:focus { box-shadow: 0 0 0 1px var(--gilt), 0 0 26px -10px var(--gilt); }
.key.filled { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gilt) 70%, transparent); }

/* ── composer (write) ─────────────────────────────────────── */
.desk { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); }
.sheet {
  position: relative; width: min(100%, 640px);
  background: var(--paper); color: var(--paper-ink);
  border-radius: 3px; box-shadow: var(--lift-letter);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: transform .7s var(--ease), filter .7s var(--ease);
}
.sheet::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px;
  pointer-events: none; opacity: .4; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23p2)' opacity='0.35'/%3E%3C/svg%3E");
}
.sheet-row {
  display: flex; align-items: baseline; gap: .75rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--paper-rule);
}
.sheet-row .label { color: var(--paper-ink-dim); flex: none; }
.sheet-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--font-letter); font-size: var(--step-1); color: var(--paper-ink);
  padding: .15rem 0;
}
.sheet-input::placeholder { color: var(--paper-ink-dim); opacity: .6; }
.sheet-input:focus { box-shadow: 0 1px 0 var(--wax-deep); }
.sheet-body {
  width: 100%; border: 0; outline: 0; background: transparent; resize: vertical;
  min-height: 300px; padding: .3rem 0;
  font-family: var(--font-letter); font-size: var(--step-1); line-height: 28px;
  color: var(--paper-ink);
  background-image: repeating-linear-gradient(to bottom,
      transparent 0 27px, var(--paper-rule) 27px 28px);
}
.sheet-body::placeholder { color: var(--paper-ink-dim); opacity: .55; }
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; padding-top: .4rem;
  font-family: var(--font-ui); font-size: .625rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--paper-ink-dim);
}
.compose-bar {
  width: min(100%, 640px); display: flex; align-items: center;
  justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
}

/* the wax press */
.press {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.press.on { opacity: 1; pointer-events: auto; }
.press-seal { width: 150px; height: 150px; transform: scale(2.4); opacity: 0; }
.press.on .press-seal { animation: press 1.5s var(--ease) forwards; }
@keyframes press {
  0%   { transform: scale(2.4); opacity: 0; }
  38%  { transform: scale(1.06); opacity: 1; }
  52%  { transform: scale(.94); }
  70%  { transform: scale(1); }
  100% { transform: scale(1); opacity: 1; }
}
.press-word {
  position: absolute; bottom: 22%; font-family: var(--font-display);
  font-size: var(--step-2); color: var(--text-dim); opacity: 0;
}
.press.on .press-word { animation: fadeIn .6s var(--ease) 1.1s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ── read view ────────────────────────────────────────────── */
.read-sheet {
  position: relative; width: min(100%, 640px); margin-inline: auto;
  background: var(--paper); color: var(--paper-ink); border-radius: 3px;
  box-shadow: var(--lift-letter); padding: var(--sp-5);
}
.read-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4); border-bottom: 1px solid var(--paper-rule);
  font-family: var(--font-ui); font-size: .625rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--paper-ink-dim);
}
.read-body { font-family: var(--font-letter); font-size: 1.25rem; line-height: 1.85; }
.read-body p { margin: 0 0 1.1rem; }
.read-sign { font-family: var(--font-letter); font-style: italic;
  font-size: 1.25rem; color: var(--paper-ink-dim); margin: var(--sp-4) 0 0; }

/* ── close & footer ───────────────────────────────────────── */
.close-band { text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-4); padding-block: var(--sp-7) var(--sp-6); }
.close-title { font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: var(--step-4); line-height: 1.16; letter-spacing: -.02em;
  margin: 0; max-width: 20ch; text-wrap: balance; }
.foot { display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; padding-top: var(--sp-4);
  border-top: 1px solid var(--line-soft); font-size: .75rem; color: var(--text-faint); }
.foot a { color: var(--text-faint); text-decoration: none;
  border-bottom: 1px solid transparent; }
.foot a:hover { color: var(--gilt);
  border-bottom-color: color-mix(in srgb, var(--gilt) 50%, transparent); }

.rise { opacity: 0; transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rise.in { opacity: 1; transform: none; }

.center-narrow { max-width: 640px; margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important; animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .rise { opacity: 1; transform: none; }
  #embers { display: none; }
  .btn-gold { animation: none; }
  .btn-gold::after { animation: none; }
}
