/* =========================================================
   Dear Founder — landing page
   Club Green #2C4A3B · Claret #8B2129 · Cream #F2ECDF
   ========================================================= */

:root {
  --green: #2C4A3B;            /* brand Club Green: ink on paper */
  --bg: #163527;               /* deep room green, velvet-dark */
  --green-deep: #1E3529;
  --green-night: #0E1A14;
  --claret: #8B2129;
  --claret-deep: #5E1218;
  --cream: #F2ECDF;
  --cream-dim: rgba(242, 236, 223, .62);
  --brass: #D4B47A;
  --lamp: #FFE3A6;

  --serif: "Cormorant Garamond", "Cormorant", "Iowan Old Style", "Palatino", Georgia, serif;
  --hand: "Mrs Saint Delafield", "Snell Roundhand", cursive;

  --ease: cubic-bezier(.22, .9, .24, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);
  --pad: clamp(18px, 3.2vw, 52px);
  --mx: 50vw;
  --my: 50vh;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;            /* the landing page never scrolls */
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--claret); color: var(--cream); }

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

.caps {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
}

[data-mark] svg { display: block; width: 100%; height: auto; }

/* =========================================================
   ROOM — velvet, lamplight, grain
   ========================================================= */
.room { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.room::before {               /* vignette */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 30% 45%, transparent 40%, rgba(3, 12, 8, .62) 100%),
    linear-gradient(180deg, rgba(0,0,0,.12), transparent 30%, transparent 70%, rgba(0,0,0,.28));
}

.drape {                      /* velvet folds, barely moving */
  position: absolute; inset: -10% -20%;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0) 0px, rgba(2,20,11,.14) 70px, rgba(0,0,0,0) 150px,
      rgba(255,255,255,.035) 210px, rgba(0,0,0,0) 260px, rgba(2,20,11,.09) 330px, rgba(0,0,0,0) 400px);
  filter: blur(14px);
  animation: drape 38s ease-in-out infinite alternate;
  opacity: .9;
}
@keyframes drape {
  from { transform: translateX(-3%) skewX(-1deg); }
  to   { transform: translateX(3%) skewX(1deg); }
}

.glow {                       /* lamplight thrown onto the wall */
  position: absolute; inset: 0;
  background:
    radial-gradient(38vmax 30vmax at var(--gx, 72%) var(--gy, 50%), rgba(255, 220, 150, .16), transparent 70%),
    radial-gradient(18vmax 14vmax at var(--gx, 72%) var(--gy, 50%), rgba(255, 226, 166, .14), transparent 70%);
  opacity: 0;
  transition: opacity 1.4s ease;
}
.is-lit .glow { opacity: 1; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .86; } }

.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .07;
  mix-blend-mode: overlay;
  animation: grain 1.1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); }
  80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); }
}

.ink-trail { position: fixed; inset: 0; z-index: 1; pointer-events: none; width: 100%; height: 100%; }

/* =========================================================
   PAGE FRAME
   ========================================================= */
.page {
  position: relative; z-index: 2;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(var(--pad) * .7) var(--pad) calc(var(--pad) * .6);
}

/* header */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--cream); text-decoration: none; justify-self: start;
}
.brand__seal { width: clamp(38px, 3.4vw, 50px); transition: transform 1.2s var(--ease); }
.brand:hover .brand__seal { transform: rotate(-120deg); }
.brand__word { width: clamp(120px, 11vw, 170px); opacity: .92; }

.top__mid { display: flex; align-items: center; gap: 16px; color: var(--cream-dim); margin: 0; }
.rule { display: inline-block; width: 46px; height: 1px; background: currentColor; opacity: .55; }
.top__right { justify-self: end; margin: 0; color: var(--cream-dim); display: flex; align-items: center; gap: 10px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--claret);
  box-shadow: 0 0 0 0 rgba(139,33,41,.7); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(178, 58, 65, .7);} 80%,100% { box-shadow: 0 0 0 10px rgba(178,58,65,0);} }

/* stage */
.stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(16px, 3vw, 56px);
}

/* =========================================================
   THE LETTER (left)
   ========================================================= */
.letter { position: relative; min-width: 0; }

.greeting {
  margin: 0 0 clamp(8px, 2.2vh, 26px) -0.6%;
  display: flex; align-items: flex-end;
  font-weight: 400;
  line-height: 1;
}
.greeting__mark {
  display: block;
  width: min(49vw, 70vh, 820px);
  color: var(--cream);
  -webkit-mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
          mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.25));
}
.is-ready .greeting__mark {
  animation: write 2.1s cubic-bezier(.55,.1,.35,1) .15s forwards;
}
@keyframes write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

.greeting__comma {
  font-family: var(--hand);
  font-size: min(9vw, 13vh, 150px);
  line-height: .2;
  margin: 0 0 .02em -.05em;
  color: var(--cream);
  opacity: 0;
  transform: translateY(-.3em) scale(.4);
}
.is-ready .greeting__comma { animation: drop .7s var(--ease) 2.15s forwards; }
@keyframes drop {
  60% { opacity: 1; transform: translateY(.04em) scale(1.12); }
  100% { opacity: 1; transform: none; }
}

.body { margin: 0 0 clamp(14px, 3.4vh, 40px); }
.line { margin: 0; overflow: hidden; padding-bottom: .06em; }
.line > span {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  filter: blur(6px);
}
.is-ready .line > span {
  transition: transform 1.2s var(--ease), opacity 1.2s var(--ease), filter 1.2s var(--ease);
  transform: none; opacity: 1; filter: none;
}
.is-ready .line:nth-child(1) > span { transition-delay: 1.15s; }
.is-ready .line:nth-child(2) > span { transition-delay: 1.3s; }
.is-ready .line:nth-child(3) > span { transition-delay: 1.65s; }
.is-ready .line:nth-child(4) > span { transition-delay: 1.78s; }

.line:not(.line--small) {
  font-size: clamp(25px, min(3.3vw, 5.4vh), 58px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.012em;
}
.line--rotor { min-height: 1.18em; }
.rotor {
  font-style: italic;
  font-weight: 400;
  color: var(--brass);
  white-space: nowrap;
  display: inline-block;
}
.rotor .ch {
  display: inline-block;
  white-space: pre;
  animation: chIn .9s var(--ease) both;
  animation-delay: calc(var(--k) * 22ms);
}
.rotor.is-out .ch { animation: chOut .55s var(--ease-io) both; animation-delay: calc(var(--k) * 12ms); }
@keyframes chIn { from { opacity: 0; transform: translateY(.45em) rotate(4deg); filter: blur(5px); } }
@keyframes chOut { to { opacity: 0; transform: translateY(-.35em); filter: blur(6px); } }

.line--small {
  font-size: clamp(16px, min(1.45vw, 2.5vh), 23px);
  font-weight: 400;
  line-height: 1.45;
  color: var(--cream-dim);
  font-style: italic;
}
.line--small:first-of-type { margin-top: .5em; }
.line--rotor + .line--small { margin-top: clamp(10px, 1.8vh, 22px); }

/* =========================================================
   THE FORM — address the envelope
   ========================================================= */
.post { position: relative; max-width: 560px; }
.post > *:not(.post__done) { transition: opacity .6s ease, transform .8s var(--ease); }
.post__label { display: block; color: var(--cream-dim); margin-bottom: 10px; }

.post__row { display: flex; align-items: flex-end; gap: clamp(12px, 1.6vw, 22px); }
.post__field { position: relative; flex: 1 1 auto; min-width: 0; }
.post input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--cream);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, min(1.7vw, 2.9vh), 27px);
  padding: 10px 2px 10px;
  caret-color: var(--brass);
  border-radius: 0;
}
.post input::placeholder { color: rgba(242,236,223,.34); }
.post__rule {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 12px;
  overflow: visible; pointer-events: none;
}
.post__rule path {
  fill: none; stroke: var(--cream); stroke-width: 1.4; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .55;
  transition: opacity .4s ease, stroke .4s ease;
}
.is-ready .post__rule path { animation: inkline 1.4s var(--ease) 2.1s forwards; }
@keyframes inkline { to { stroke-dashoffset: 0; } }
.post__field:focus-within .post__rule path { opacity: 1; stroke: var(--brass); }
.post.is-error .post__rule path { stroke: #E0848A; opacity: 1; }

.post__send {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px;
  padding: 0 22px 0 26px;
  border: 0; border-radius: 999px;
  background: var(--claret);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -2px 0 rgba(0,0,0,.18);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), width .6s var(--ease), padding .6s var(--ease), border-radius .6s var(--ease);
}
.post__send::before {          /* sheen */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.22) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.post__send:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 0 rgba(0,0,0,.18); }
.post__send:hover::before { transform: translateX(120%); }
.post__send:active { transform: translateY(1px) scale(.98); }
.post__send:focus-visible { outline: 1.5px solid var(--brass); outline-offset: 4px; }
.post__nib { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
.post__send:hover .post__nib { transform: translate(3px, -3px) rotate(-8deg); }

.post__wax {                  /* the button becomes a wax seal on submit */
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--claret-deep); opacity: 0;
}
.post__wax span { width: 30px; filter: drop-shadow(0 1px 0 rgba(255,255,255,.2)) drop-shadow(0 -1px 0 rgba(0,0,0,.35)); }

.post__fine {
  margin: 12px 0 0; font-size: clamp(13px, 1.1vw, 15px); font-style: italic; color: rgba(242,236,223,.5);
  min-height: 1.4em;
}
.post.is-error .post__fine { color: #F0A3A8; }

.post__done {
  position: absolute; left: 0; top: 0; right: 0;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.post__done-script {
  font-family: var(--hand); font-size: clamp(44px, min(4.6vw, 8vh), 76px); line-height: 1;
  color: var(--cream);
  -webkit-mask-image: linear-gradient(100deg, #000 42%, transparent 58%); mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  padding: .15em 0 0 .05em;
}
.post__done-sub { color: var(--brass); opacity: 0; transform: translateY(8px); transition: all .8s var(--ease) 1.2s; }

/* submit states */
.post.is-sending .post__send {
  width: 52px; padding: 0; border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 36% 32%, #B23A41, var(--claret) 58%, var(--claret-deep));
  animation: stamp .7s var(--ease) .25s both;
}
.post.is-sending .post__send-text, .post.is-sending .post__nib { opacity: 0; width: 0; }
.post.is-sending .post__wax { opacity: 1; transition: opacity .3s ease .35s; }
@keyframes stamp {
  0% { transform: scale(1); }
  40% { transform: scale(1.45) rotate(-8deg); box-shadow: 0 30px 40px -10px rgba(0,0,0,.6); }
  70% { transform: scale(.92) rotate(2deg); box-shadow: 0 2px 4px rgba(0,0,0,.5); }
  100% { transform: scale(1) rotate(0); }
}
.post.is-sent .post__label,
.post.is-sent .post__field,
.post.is-sent .post__fine { opacity: 0; transform: translateY(-10px); transition-delay: 0s; transition-duration: .5s; }
.post.is-sent .post__send { transform: translate(var(--fly-x, 40vw), var(--fly-y, -30vh)) scale(.4) rotate(40deg); opacity: 0; transition: transform 1.1s var(--ease-io), opacity 1.1s ease; }
.post.is-sent .post__done-script { animation: write 1.6s cubic-bezier(.55,.1,.35,1) .45s forwards; }
.post.is-sent .post__done-sub { opacity: 1; transform: none; }

/* sign-off */
.signoff {
  width: clamp(170px, min(18vw, 30vh), 290px);
  margin: clamp(10px, 2.6vh, 34px) 0 0 auto;
  margin-right: 8%;
  color: var(--brass);
  -webkit-mask-image: linear-gradient(100deg, #000 42%, transparent 58%); mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  transform: rotate(-4deg);
}
.is-ready .signoff { animation: write 1.8s cubic-bezier(.55,.1,.35,1) 2.6s forwards; }

/* =========================================================
   THE DESK (right) — inked illustration
   ========================================================= */
.desk {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.scene {
  height: min(100%, 80dvh);
  width: auto;
  max-width: 100%;
  overflow: visible;
}

.layer { will-change: transform; }

.ink {
  fill: none;
  stroke: var(--cream);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.ink--thin { stroke-width: 1.3; }
.ink--faint { stroke-width: 1.1; opacity: .55; }
.ink--hi { stroke-width: 2.4; opacity: .5; }
.ink--green { stroke: var(--green); stroke-width: 1.8; }
.is-drawn .ink {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.9s cubic-bezier(.5,.1,.25,1);
  transition-delay: calc(var(--i, 0) * 28ms);
}

.paper { opacity: 0; transition: opacity 1.2s ease; transition-delay: calc(.9s + var(--i, 0) * 28ms); }
.is-drawn .paper { opacity: 1; }
.paper--claret { fill: #6E1A21; }
.paper--deep   { fill: #1A3024; }
.paper--brown  { fill: #4A3323; }
.paper--glass  { fill: #0F1F17; }
.paper--cream  { fill: var(--cream); }
.paper--brass  { fill: #A9874F; }
.paper--back   { fill: #E2D8C4; }
.paper--front  { fill: #F2ECDF; }
.paper--shadow { fill: #D6C9AF; }

.shade { opacity: 0; transition: opacity 1.2s ease 1.2s; }
.is-drawn .shade { opacity: .96; }
.shade__under { fill: var(--lamp); opacity: 0; transition: opacity .3s ease; }
.is-lit .shade__under { opacity: .95; }

/* lamplight */
.light { opacity: 0; mix-blend-mode: screen; }
.is-lit .light { animation: flickerOn 1.3s steps(1) forwards; }
.is-lit.is-settled .light { animation: none; opacity: 1; }
@keyframes flickerOn {
  0% { opacity: 0; } 10% { opacity: .8; } 16% { opacity: .1; } 26% { opacity: .9; }
  32% { opacity: .35; } 44% { opacity: 1; } 100% { opacity: 1; }
}
.dust circle { fill: var(--lamp); opacity: 0; animation: mote var(--d, 9s) linear var(--delay, 0s) infinite; }
@keyframes mote {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: var(--o, .7); }
  85% { opacity: var(--o, .7); }
  100% { opacity: 0; transform: translate(var(--dx, 20px), var(--dy, -80px)); }
}

/* pull chain */
.chain { cursor: pointer; transform-box: view-box; transform-origin: 246px 307px; animation: sway 4.5s ease-in-out infinite; }
.chain__beads { stroke: var(--brass); stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 0 6.2; fill: none; }
.chain__bob { fill: var(--brass); }
.chain__hit { fill: transparent; }
.chain:hover { animation-duration: 1.4s; }
.chain.is-pulled { animation: pull .55s var(--ease) both; }
@keyframes sway { 0%,100% { transform: rotate(2.2deg); } 50% { transform: rotate(-2.2deg); } }
@keyframes pull { 0% { transform: translateY(0); } 35% { transform: translateY(16px); } 100% { transform: translateY(0); } }
.chain:focus { outline: none; }

.hint { opacity: 0; transition: opacity 1s ease; pointer-events: none; }
.is-settled .hint { opacity: .9; }
.is-dark .hint, .has-pulled .hint { opacity: 0; }
.hint__text { font-family: var(--hand); font-size: 30px; fill: var(--brass); }
.hint__arrow { fill: none; stroke: var(--brass); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* the letter in the envelope */
.floater { transform-box: fill-box; transform-origin: center; animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(.8deg); } }
.envelope { cursor: default; }
.sheet { transform: translateY(170px); transition: transform 1.6s var(--ease); }
.is-drawn .sheet { transform: translateY(44px); transition-delay: 1.4s; }
.is-drawn .floater:hover .sheet,
.is-drawn .sheet.is-peek { transform: translateY(-46px); transition: transform 1s var(--ease); transition-delay: 0s; }
.sheet__hello { font-family: var(--hand); font-size: 31px; fill: var(--green); }
.sheet__lines { stroke: var(--green); stroke-width: 1.5; stroke-linecap: round; opacity: .42; stroke-dasharray: 26 5 38 5 16 5 44 5 20 5 30 5; fill: none; }
.sheet__secret { font-family: var(--hand); font-size: 23px; fill: var(--claret); }
.sheet__sig { font-family: var(--hand); font-size: 23px; fill: var(--green); }

.seal { opacity: 0; transition: opacity .6s ease 2.6s; }
.is-drawn .seal { opacity: 1; }
.seal__half { transition: transform .8s var(--ease); transform-box: fill-box; transform-origin: center; }
.seal__half--l { transform: translate(-3px, 1px) rotate(-6deg); }
.seal__half--r { transform: translate(3px, 0) rotate(5deg); }
.floater:hover .seal__half--l { transform: translate(-7px, 3px) rotate(-14deg); }
.floater:hover .seal__half--r { transform: translate(7px, 2px) rotate(12deg); }
.seal__shine { fill: none; stroke: rgba(255,230,230,.35); stroke-width: 2; stroke-linecap: round; }
.seal__df { font-family: var(--serif); font-weight: 600; font-size: 12px; fill: #4E0E13; opacity: .7; letter-spacing: -.5px; }

/* stamp */
.stamp { opacity: 0; transition: opacity 1.2s ease 2.2s; }
.is-drawn .stamp { opacity: 1; }
.stamp__float { animation: drift 9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes drift { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-6px, 10px) rotate(-5deg); } }
.stamp__paper { fill: var(--claret); }
.stamp__perf { fill: none; stroke: #163527; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 0 7.5; }
.stamp__frame { fill: none; stroke: var(--cream); stroke-width: 1; opacity: .65; }
.stamp__df { font-family: var(--serif); font-weight: 600; font-size: 22px; fill: var(--cream); }
.stamp__est { font-family: var(--serif); font-weight: 600; font-size: 6px; letter-spacing: 1.6px; fill: var(--cream); opacity: .8; }
.stamp__cancel { fill: none; stroke: var(--cream); stroke-width: 1.3; opacity: .5; stroke-linecap: round; }

/* postmark */
.postmark {
  position: absolute; top: 2%; left: 4%;
  width: clamp(84px, 8vw, 124px);
  opacity: 0;
  transform: rotate(-14deg);
  transition: opacity 1.5s ease 2.8s;
}
.is-ready .postmark { opacity: .5; }
.postmark text, .postmark circle { animation: none; }
.pm__ring { fill: none; stroke: var(--cream); stroke-width: 1.6; }
.pm__text { font-family: var(--serif); font-weight: 600; font-size: 13.6px; letter-spacing: 2.6px; fill: var(--cream); }
.pm__mid { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: 3px; fill: var(--cream); }
.postmark { animation: spin 60s linear infinite; }
@keyframes spin { from { rotate: 0deg; } to { rotate: 360deg; } }

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 28px;
  color: var(--cream-dim);
  padding-top: 10px;
}
.foot p { margin: 0; }
.ticker {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker__track { display: inline-flex; gap: 22px; white-space: nowrap; animation: tick 60s linear infinite; padding-right: 22px; }
.ticker__track i { font-style: normal; color: var(--claret); filter: brightness(1.5); }
@keyframes tick { to { transform: translateX(-50%); } }

.foot__r {
  background: none; border: 0; color: var(--cream-dim); cursor: pointer; padding: 6px 0;
  display: inline-flex; align-items: center; gap: 10px;
  transition: color .3s ease;
}
.foot__r::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--lamp); box-shadow: 0 0 10px 2px rgba(255,227,166,.6);
  transition: all .4s ease;
}
.foot__r:hover { color: var(--cream); }
.foot__r:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }
.is-dark .foot__r::before { background: transparent; box-shadow: inset 0 0 0 1px var(--cream-dim); }

/* staged entrance for the frame */
.top, .foot { opacity: 0; transform: translateY(-8px); transition: opacity 1.2s ease, transform 1.2s var(--ease); }
.foot { transform: translateY(8px); }
.is-ready .top { opacity: 1; transform: none; transition-delay: .6s; }
.is-ready .foot { opacity: 1; transform: none; transition-delay: 2.2s; }
.post__label, .post__fine, .post__send { opacity: 0; }
.is-ready .post__label { opacity: 1; transition-delay: 2s; }
.is-ready .post__send { opacity: 1; transition: opacity 1s ease 2.3s, transform .5s var(--ease), box-shadow .5s var(--ease), width .6s var(--ease), padding .6s var(--ease), border-radius .6s var(--ease); }
.is-ready .post__fine { opacity: 1; transition-delay: 2.6s; }
.is-ready.is-settled .post__send { transition: transform .5s var(--ease), box-shadow .5s var(--ease), width .6s var(--ease), padding .6s var(--ease), border-radius .6s var(--ease); }

/* =========================================================
   LIGHTS OUT
   ========================================================= */
.night {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(circle 170px at var(--mx) var(--my), rgba(8,14,11,0) 0%, rgba(8,14,11,.55) 45%, rgba(6,11,9,.95) 100%);
  opacity: 0;
  transition: opacity 1.1s ease;
}
.is-dark .night { opacity: 1; }
.night__note {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  margin: 0; width: min(92vw, 1100px);
  text-align: center;
  font-family: var(--hand);
  font-size: clamp(42px, min(6.2vw, 10vh), 110px);
  line-height: 1.05;
  color: #E9F5C9;
  text-shadow: 0 0 18px rgba(214, 240, 160, .55), 0 0 60px rgba(180, 220, 120, .35);
  opacity: 0;
  transition: opacity 2.2s ease .9s;
}
.night__note span { display: block; }
.night__note span + span { font-size: .52em; margin-top: .3em; opacity: .85; }
.is-dark .night__note { opacity: .92; }
.night__hint { position: absolute; left: 0; right: 0; bottom: 7vh; text-align: center; color: rgba(233,245,201,.4); opacity: 0; transition: opacity 1s ease 2.5s; margin: 0; }
.is-dark .night__hint { opacity: 1; }
.is-dark .glow { opacity: 0; }

/* =========================================================
   INTRO — the envelope
   ========================================================= */
.intro {
  position: fixed; inset: 0; z-index: 100;
  perspective: 1800px;
  overflow: hidden;
  cursor: pointer;
}
.intro > * { position: absolute; inset: 0; }
.intro__inside {
  background:
    repeating-linear-gradient(135deg, rgba(242,236,223,.06) 0 1px, transparent 1px 9px),
    radial-gradient(80% 60% at 50% 30%, #2F5040, var(--green-deep));
  transition: transform 1.1s var(--ease-io);
}
.intro__letter {
  inset: 14% 10% -6% 10%;
  background:
    radial-gradient(120% 80% at 50% 0%, #FBF7EE, var(--cream) 60%, #E8DFCC);
  box-shadow: 0 -10px 60px -20px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 7vh;
  color: var(--claret);
  transform: translateY(26%);
  transition: transform 1.2s var(--ease), opacity .9s ease;
}
.intro__letter-mark { width: min(54vw, 560px); }
.intro__letter-est { font-family: var(--serif); font-weight: 600; letter-spacing: .4em; font-size: 12px; color: var(--green); margin-top: 14px; padding-left: 20%; }

.intro__flap { transition: transform 1.1s var(--ease-io); }
.intro__flap--l {
  clip-path: polygon(0 0, 53% 51%, 0 100%);
  background: linear-gradient(90deg, #EFE8DA 0%, #F3EDE1 55%, #E2D8C4 100%);
}
.intro__flap--r {
  clip-path: polygon(100% 0, 47% 51%, 100% 100%);
  background: linear-gradient(270deg, #EFE8DA 0%, #F3EDE1 55%, #E2D8C4 100%);
}
.intro__flap--b {
  clip-path: polygon(0 100%, 50% 45%, 100% 100%);
  background: linear-gradient(0deg, #F2ECDF 0%, #F6F1E7 70%, #E9E0CD 100%);
  filter: drop-shadow(0 -2px 2px rgba(0,0,0,.06));
}
.intro__flap--t {
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 10px 18px rgba(60, 40, 20, .22));
  z-index: 2;
}
.intro__flap-face {
  position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  backface-visibility: hidden;
}
.intro__flap-face--front { background: linear-gradient(180deg, #F7F2E8 0%, #EFE7D8 70%, #E3D9C5 100%); }
.intro__flap-face--back {
  transform: rotateX(180deg);
  background:
    repeating-linear-gradient(135deg, rgba(242,236,223,.08) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #24402F, #1A3024);
}
.intro::after {                 /* paper tooth on the whole envelope */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .22; mix-blend-mode: multiply;
  transition: opacity .6s ease;
}

.intro__seal {
  inset: auto; left: 50%; top: 60%;
  width: clamp(112px, 13vw, 170px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.wax {
  position: absolute; inset: 0;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,190,190,.35), transparent 32%),
    radial-gradient(circle at 50% 50%, #9E2A32 0%, var(--claret) 52%, var(--claret-deep) 100%);
  box-shadow:
    0 14px 30px -8px rgba(60, 10, 14, .55),
    inset 0 -6px 12px rgba(0,0,0,.35),
    inset 0 4px 8px rgba(255,255,255,.12);
  display: grid; place-items: center;
  color: #63131A;
  transition: transform 1.1s var(--ease-io), opacity 1s ease;
}
.wax::before {
  content: ""; position: absolute; inset: 15%; border-radius: 50%;
  box-shadow: inset 0 3px 5px rgba(0,0,0,.4), inset 0 -2px 3px rgba(255,255,255,.12), 0 1px 0 rgba(255,255,255,.12);
}
.wax span { width: 44%; filter: drop-shadow(0 1.5px 0 rgba(255,200,200,.22)) drop-shadow(0 -1.5px 0 rgba(0,0,0,.45)); }
.wax--l { clip-path: polygon(0 0, 52% 0, 46% 22%, 55% 41%, 45% 60%, 53% 79%, 48% 100%, 0 100%); }
.wax--r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 48% 100%, 53% 79%, 45% 60%, 55% 41%, 46% 22%); }

.intro__seal { animation: press .8s var(--ease) .25s both; }
@keyframes press {
  0% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; filter: blur(3px); }
  55% { transform: translate(-50%, -50%) scale(.94); opacity: 1; filter: none; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.intro__hint {
  inset: auto 0 5vh 0; margin: 0; text-align: center; z-index: 5;
  font-family: var(--serif); font-weight: 600; font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: rgba(44, 74, 59, .55);
  opacity: 0; animation: fadeIn 1s ease 1s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

/* intro sequence */
.intro.is-break .wax--l { transform: translate(-36%, 70vh) rotate(-38deg); opacity: 0; }
.intro.is-break .wax--r { transform: translate(36%, 72vh) rotate(42deg); opacity: 0; }
.intro.is-break .intro__hint { opacity: 0; animation: none; transition: opacity .3s ease; }
.intro.is-open .intro__flap--t { transform: rotateX(178deg); }
.intro.is-open .intro__flap--t { transition: transform 1.2s cubic-bezier(.6,.05,.25,1); }
.intro.is-rise .intro__letter { transform: translateY(-9%); }
.intro.is-leave { pointer-events: none; }
.intro.is-leave .intro__flap--l,
.intro.is-leave .intro__flap--r,
.intro.is-leave .intro__flap--b,
.intro.is-leave .intro__inside { transform: translateY(105%); transition: transform 1.15s cubic-bezier(.7,0,.25,1); }
.intro.is-leave .intro__flap--t { transform: rotateX(178deg) translateY(-30%); opacity: 0; transition: transform 1s ease, opacity .5s ease; }
.intro.is-leave .intro__letter { transform: translateY(-120%) rotate(-4deg); transition: transform 1.3s cubic-bezier(.7,0,.25,1); }
.intro.is-leave::after { opacity: 0; }
.intro.is-gone { display: none; }

/* =========================================================
   RESPONSIVE — always one screen, never a scroll
   ========================================================= */
@media (max-height: 760px) and (min-width: 821px) {
  .signoff { display: none; }
  .postmark { display: none; }
}
@media (max-height: 620px) and (min-width: 821px) {
  .line--topics { display: none; }
  .post__fine { display: none; }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .top__mid { display: none; }
  .top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .top { grid-template-columns: 1fr auto; }
  .top__mid { display: none; }
  .brand__word { width: 120px; }
  .top__right { font-size: 9.5px; letter-spacing: .26em; white-space: nowrap; gap: 0; }
  .top__right .dot { margin-right: 10px; }
  .hide-sm { display: none; }

  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px;
  }
  .desk { order: -1; height: 100%; }
  .scene { height: 100%; max-height: 34dvh; }
  .postmark { display: none; }
  .greeting__mark { width: min(80vw, 46vh); }
  .greeting__comma { font-size: min(17vw, 11vh); }
  .line:not(.line--small) { font-size: clamp(22px, min(6.4vw, 3.7vh), 34px); }
  .rotor { white-space: normal; }
  .line--rotor { min-height: 2.3em; }
  .line--topics { display: none; }
  .line--small { font-size: clamp(15px, 4vw, 18px); }
  .signoff { display: none; }
  .post__send { height: 48px; padding: 0 16px 0 18px; letter-spacing: .2em; font-size: 11px; }
  .post.is-sending .post__send { width: 48px; }
  .post input { font-size: 18px; }
  .foot { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .foot__l { display: none; }
  .caps { font-size: 10px; }
  .hint__text { font-size: 34px; }
}
@media (max-width: 820px) and (max-height: 700px) {
  .post__fine { display: none; }
  .line--small { display: none; }
  .scene { max-height: 28dvh; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; transition-delay: 0s !important; }
  .intro { display: none; }
  .ticker__track { animation: none; }
}
