/* =========================================================================
   Mammoth Creative: Christmas card 2026 ("Go on, give him a tickle")
   VOICE   warm, cheeky, a little bit handmade
   IDEA    a real card: it arrives in an envelope, our ticklish mammoth sneezes the letter out
   PICTURE the mammoth, centre stage, on a snowy Christmas night under fairy lights
   COLOUR  night #121110, paper cream, butter yellow, Christmas red, holly green
   TYPE    New Spirit (Fraunces fallback) for headlines, Archivo for text, Caveat for handwriting
   LAYOUT  one centred column on every screen: words, mammoth, button. The letter opens under his chin
   ========================================================================= */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2-variations"),
       url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations"),
       url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-var.woff2") format("woff2-variations"),
       url("../fonts/caveat-var.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #EFE7DA;      /* warm cream */
  --ink: #121110;        /* near-black */
  --butter: #F2C84B;     /* yellow */
  --sheet: #FBF8F1;      /* the note's paper, a touch lighter than the page */
  --night: #121110;      /* the stage: the mammoth video is painted on exactly this colour */
  --red: #C2302A;        /* Christmas red */
  --green: #3E7B4F;      /* holly */
  --soft: rgba(18, 17, 16, .64);
  --dim: rgba(239, 231, 218, .66);

  --serif: "new-spirit", "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.35);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);

  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --gl: max(18px, env(safe-area-inset-left, 0px));
  --gr: max(18px, env(safe-area-inset-right, 0px));

  /* one headline size for the whole card: fits two lines on a phone, one line on a computer */
  --hl: clamp(36px, min(10.6vw, 7.4vh), 78px);

  /* printed texture */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .97  0 0 0 0 .92  0 0 0 2.2 -1.25'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --noise-paper: 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='.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .27  0 0 0 0 .2  0 0 0 .55 -.24'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }

body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--butter); color: var(--ink); }
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

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

.skip {
  position: fixed; z-index: 100; top: calc(var(--st) + 10px); left: 10px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--butter); color: var(--ink);
  font: 600 15px/1 var(--sans); text-decoration: none;
  transform: translateY(-200%);
  transition: transform .25s var(--ease);
}
.skip:focus { transform: none; }
.is-open .skip { display: none; }

/* a whisper of print grain over everything (no blend mode, so it stays cheap on phones) */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image: var(--grain);
  background-size: 200px 200px;
  opacity: .05;
}

/* =========================================================================
   STAGE
   ========================================================================= */

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "head" "scene" "ctrl";
  justify-items: center;
  padding: calc(var(--st) + 30px) var(--gr) calc(var(--sb) + 18px) var(--gl);
  overflow: hidden;
  background: var(--night);
}
html:not(.js) .stage { display: none; }

/* the layers, back to front */
.sky, .snow, .lights, .baubles, .vignette, .flash { position: absolute; pointer-events: none; }
.sky       { inset: 0; z-index: 1; }
.scene-wrap { z-index: 2; }
.snow      { inset: -28px; width: calc(100% + 56px); height: calc(100% + 56px); }
.snow-far  { z-index: 3; }
.sleigh-layer { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; transition: opacity .35s var(--ease); }
.sleigh-layer.is-hushed { opacity: 0; }
.vignette  { inset: 0; z-index: 4; background: radial-gradient(120% 90% at 50% 46%, transparent 52%, rgba(6, 5, 5, .55) 100%); }
.lights    { left: 0; top: 0; width: 100%; height: 80px; z-index: 5; overflow: visible; }
.baubles   { inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; }
.stage-top, .head-block { z-index: 6; }
.snow-near { z-index: 7; }
.flash     { inset: 0; z-index: 8; background: var(--sheet); opacity: 0; }
.controls  { z-index: 9; }

/* Santa's sleigh, pulled by two mammoths: small and far off, now and then */
.sleigh {
  position: absolute;
  left: 0; top: 0;
  width: clamp(84px, 11vw, 140px);
  visibility: hidden;
  will-change: transform, opacity;
}
.sleigh.is-flying { visibility: visible; }
.sleigh.is-small { width: 66px; }     /* small phones: to fit the gaps between the words and the mammoth */
.sleigh-inner {
  position: relative;
  transform: scaleX(var(--dir, 1));  /* the picture faces left: mirrored when heading right */
  animation: sleigh-bob 1.8s ease-in-out infinite;
}
/* two drawings, swapped back and forth, so the mammoths gallop */
.sleigh img { display: block; width: 100%; height: auto; animation: sleigh-step .34s steps(1, end) infinite; }
.sleigh .sleigh-b { position: absolute; left: 0; top: 0; animation-name: sleigh-step-b; }
.sleigh-trail {                       /* a little trail of sparkle behind the runners */
  position: absolute;
  left: 94%; top: 56%;
  width: 70%; height: 14px;
  background:
    radial-gradient(circle, var(--butter) 0 1.1px, transparent 1.7px) 0 1px / 11px 7px,
    radial-gradient(circle, #F6F0E4 0 .8px, transparent 1.3px) 5px 7px / 13px 7px;
  -webkit-mask-image: linear-gradient(90deg, #000 10%, transparent);
  mask-image: linear-gradient(90deg, #000 10%, transparent);
  animation: sleigh-sparkle .5s ease-in-out infinite alternate;
}
.sleigh:not(.is-flying) .sleigh-inner, .sleigh:not(.is-flying) img, .sleigh:not(.is-flying) .sleigh-trail { animation-play-state: paused; }
@keyframes sleigh-bob { 0%, 100% { translate: 0 0; rotate: -1.5deg; } 50% { translate: 0 -5px; rotate: 1.5deg; } }
@keyframes sleigh-step { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes sleigh-step-b { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 1; } }
@keyframes sleigh-sparkle { from { opacity: .45; } to { opacity: .95; } }

/* stars in the sky: they twinkle at their own pace */
.star-dot {
  position: absolute;
  width: var(--s, 10px); height: var(--s, 10px);
  margin: calc(var(--s, 10px) / -2) 0 0 calc(var(--s, 10px) / -2);
  color: var(--paper);
  opacity: 0;
  animation: star-twinkle var(--t, 3.4s) var(--d, 0s) ease-in-out infinite;
}
.star-dot.is-butter { color: var(--butter); }
.star-dot svg { display: block; width: 100%; height: 100%; }
@keyframes star-twinkle {
  0%, 100% { opacity: .12; transform: scale(.6) rotate(0deg); }
  50% { opacity: var(--o, .8); transform: scale(1) rotate(25deg); }
}

/* fairy lights */
.lights .bulb-g { transform-box: fill-box; transform-origin: 50% 0; }
.lights .glow { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .85; } 45% { opacity: .25; } 60% { opacity: 1; } }
.lights .bulb-on { opacity: 0; transition: opacity .25s var(--ease); transition-delay: var(--on, 0s); }
.lights-on .lights .bulb-on { opacity: 1; }
.lights.is-giggle .bulb-g { animation: bulb-jig .7s var(--ease); animation-delay: calc(var(--on, 0s) * .25); }
@keyframes bulb-jig { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(14deg); } 60% { transform: rotate(-10deg); } }
.lights.is-blown .bulb-g { animation: bulb-blown 1.6s var(--ease); }
@keyframes bulb-blown {
  0% { transform: rotate(0); }
  12% { transform: rotate(-58deg); }
  30% { transform: rotate(32deg); }
  50% { transform: rotate(-18deg); }
  70% { transform: rotate(9deg); }
  100% { transform: rotate(0); }
}
.lights.is-blown .glow { animation: flicker .9s steps(6) 1, twinkle 2.6s ease-in-out .9s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 20% { opacity: .1; } 40% { opacity: .9; } 60% { opacity: .2; } 80% { opacity: 1; } }

/* hanging baubles (wide screens) */
.baubles .b-ball { transition: opacity .6s var(--ease); }

/* wordmark */
.stage-top {
  grid-area: top;
  position: relative;
  display: flex;
  justify-content: center;
  transition: opacity .6s var(--ease), translate .6s var(--ease);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--paper);
}

/* the words */
.head-block {
  grid-area: head;
  position: relative;
  width: 100%;
  max-width: 1100px;
  text-align: center;
}
.eyebrow {
  margin: 14px 0 0;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: .04em;
  color: var(--dim);
  transition: opacity .6s var(--ease), translate .6s var(--ease);
}
.eyebrow .star { color: var(--butter); display: inline-block; margin: 0 6px; }
.headline {
  margin: 10px auto 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--hl);
  line-height: 1.02;
  letter-spacing: -.03em;
  color: var(--paper);
}
.hl-line { display: inline-block; white-space: nowrap; }
.hl .w {
  display: inline-block;
  transition: opacity .5s var(--ease), translate .7s var(--bounce), rotate .7s var(--bounce);
  transition-delay: calc(var(--i, 0) * 70ms + .25s);
}
.mark {
  position: relative;
  isolation: isolate;
  display: inline-block;
  color: var(--ink);
  padding: 0 .12em .02em;
  margin-left: .04em;
}
.mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .12em 0 .02em;
  background: var(--butter);
  border-radius: .05em;
  transform-origin: 0 50%;
  transition: transform .55s var(--ease) .85s;
}
.tk .l { display: inline-block; }
.tk.is-wiggle .l { animation: letter-wiggle .6s var(--ease) both; animation-delay: calc(var(--j) * 45ms); }
@keyframes letter-wiggle {
  0%, 100% { transform: none; }
  35% { transform: translateY(-.16em) rotate(-8deg); }
  70% { transform: translateY(.04em) rotate(5deg); }
}

/* the mammoth */
.scene-wrap {
  grid-area: scene;
  position: relative;
  justify-self: stretch;
  min-height: 0;
  margin: 6px calc(var(--gr) * -1) 0 calc(var(--gl) * -1);
  transform-origin: 50% 70%;
  transition: opacity .8s var(--ease) .1s, translate 1s var(--bounce) .1s, scale 1s var(--bounce) .1s;
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.is-ready .scene { opacity: 1; }
.scene text { font-family: var(--hand); font-weight: 700; }
.scene .say-big { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; }

.tickle-here { transition: opacity .35s var(--ease); }
.tickle-here path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .8s var(--ease) 1.35s; }
.tickle-here text { transition: opacity .5s var(--ease) 1.2s; }
.is-tickled .tickle-here, .is-sneezed .tickle-here, .is-open .tickle-here { opacity: 0; }

/* the mammoth video, lined up under the SVG by js */
.mammoth-video {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: auto;
  display: block;
  pointer-events: none;
  background: var(--night);
  opacity: 0;
  transition: opacity .6s var(--ease);
  /* fade the very edges, so the video's frame can never show */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}
.is-ready .mammoth-video { opacity: 1; }
.scene { z-index: 1; }
.feather { pointer-events: none; }

.tickle-zone {
  position: absolute;
  z-index: 2;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  border-radius: 40%;
}
@media (hover: hover) and (pointer: fine) { .tickle-zone { cursor: none; } }
.is-sneezed .tickle-zone, .is-open .tickle-zone, .is-envelope .tickle-zone { display: none; }

/* the button, the giggle meter and the hint */
.controls {
  grid-area: ctrl;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  transition: opacity .55s var(--ease), translate .7s var(--bounce);
  transition-delay: 1.05s;
}

.meter { display: flex; gap: 12px; align-items: center; height: 16px; }
.pip {
  --p: 0;
  position: relative;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: conic-gradient(var(--butter) calc(var(--p) * 1turn), rgba(239, 231, 218, .07) 0);
  box-shadow: inset 0 0 0 1.5px rgba(239, 231, 218, .4);
  transition: box-shadow .3s var(--ease);
}
.pip.is-full {
  background: var(--butter);
  box-shadow: inset 0 0 0 1.5px var(--butter), 0 0 14px rgba(242, 200, 75, .55);
  animation: pip-pop .55s var(--spring);
}
@keyframes pip-pop { 0% { transform: scale(.6); } 55% { transform: scale(1.45); } 100% { transform: scale(1); } }

.hint {
  margin: 0;
  font-size: 14px;
  color: rgba(239, 231, 218, .62);
  min-height: 1.5em;
  text-align: center;
}
.hint.is-cheeky { font-family: var(--hand); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--paper); }

/* buttons: the same pill as the website */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 28px 0 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 600 16px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s, color .3s, border-color .3s, transform .35s var(--ease), box-shadow .3s;
}
.btn-solid {
  background: var(--butter); color: var(--ink); border-color: var(--butter);
  box-shadow: 0 10px 30px -12px rgba(242, 200, 75, .55);
}
.btn-solid:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.stage :focus-visible { outline-color: var(--paper); }
.btn:active { transform: scale(.96); }
.btn.is-nudge { animation: nudge .9s var(--ease); }
@keyframes nudge {
  0%, 100% { transform: none; }
  20% { transform: translateY(-4px) rotate(-2deg); }
  40% { transform: translateY(0) rotate(2deg); }
  60% { transform: translateY(-2px) rotate(-1deg); }
}
.btn-ico {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .5s var(--spring);
}
.btn-ico svg { width: 26px; height: 13px; display: block; }
.btn:hover .btn-ico { transform: rotate(-14deg) scale(1.08); }

/* ----- the opening choreography (js adds .is-in once the envelope is open) ----- */
html.js:not(.is-in) .stage-top { opacity: 0; translate: 0 -12px; }
html.js:not(.is-in) .eyebrow { opacity: 0; translate: 0 10px; }
html.js:not(.is-in) .hl .w { opacity: 0; translate: 0 .45em; rotate: 5deg; }
html.js:not(.is-in) .headline .mark::before { transform: scaleX(0); }
html.js:not(.is-in) .scene-wrap { opacity: 0; translate: 0 40px; scale: .94; }
html.js:not(.is-in) .tickle-here path { stroke-dashoffset: 1; }
html.js:not(.is-in) .tickle-here text { opacity: 0; }
html.js:not(.is-in) .controls { opacity: 0; translate: 0 18px; }
.is-in .stage-top { transition-delay: .05s; }
.is-in .eyebrow { transition-delay: .15s; }

/* after the sneeze the words and button step aside */
.is-sneezed .head-block, .is-sneezed .controls,
.is-open .head-block, .is-open .controls {
  opacity: 0;
  translate: 0 10px;
  pointer-events: none;
  transition: opacity .4s var(--ease), translate .4s var(--ease);
  transition-delay: 0s;
}
.is-sneezed .stage-top, .is-open .stage-top { opacity: 0; transition-delay: 0s; }

/* static renders and "skip to the card" never animate in */
.no-anim *, .no-anim *::before, .no-anim *::after { transition: none !important; }

/* =========================================================================
   ENVELOPE
   ========================================================================= */

.envelope-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vh, 40px);
  padding: calc(var(--st) + 60px) 24px calc(var(--sb) + 40px);
  text-align: center;
  transition: opacity .55s var(--ease), transform .6s var(--ease);
}
.is-envelope .envelope-layer, .env-done .envelope-layer { display: flex; }
.env-done .envelope-layer { opacity: 0; transform: scale(1.04); pointer-events: none; transition: opacity .75s .15s var(--ease), transform 1s var(--ease); }

.env-to {
  margin: 0;
  max-width: 13em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, min(7.6vw, 5.4vh), 46px);
  line-height: 1.06;
  letter-spacing: -.025em;
  color: var(--paper);
  text-wrap: balance;
  animation: rise-in .9s var(--ease) backwards;
  transition: opacity .4s var(--ease), transform .6s var(--ease);
}
.env-to em { font-style: normal; color: var(--butter); }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.env-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  color: var(--dim);
  animation: rise-in .9s .5s var(--ease) backwards;
  transition: opacity .3s var(--ease);
}
.env-hint .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--butter);
  box-shadow: 0 0 0 0 rgba(242, 200, 75, .6);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242, 200, 75, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(242, 200, 75, 0); } }
.env-opening .env-hint, .env-opening .env-to { opacity: 0; }
.env-opening .env-to { transform: translateY(-10px); }

.env-tilt {
  perspective: 1100px;
  animation: env-arrive 1.1s .15s var(--bounce) backwards;
}
@keyframes env-arrive { from { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.86); } to { opacity: 1; transform: none; } }

.envelope {
  position: relative;
  display: block;
  width: min(80vw, 400px, 52vh);
  aspect-ratio: 10 / 7;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  margin-top: 46px;
}
.envelope:focus-visible { outline: 3px solid var(--paper); outline-offset: 12px; border-radius: 10px; }
.env-bob { position: absolute; inset: 0; perspective: 1000px; animation: env-bob 3.4s ease-in-out infinite; }
.env-card, .env-flap, .env-seal { will-change: transform; }   /* own layers from the start: nothing blinks when they move */
@keyframes env-bob { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(-9px) rotate(1.2deg); } }

.env-back, .env-pocket, .env-flap {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background-color: #E6DCCB;
  background-image: var(--noise-paper);
  background-size: 220px 220px;
}
.env-back { box-shadow: 0 34px 60px -20px rgba(0, 0, 0, .75), 0 2px 0 rgba(255, 255, 255, .06) inset; transition: box-shadow 1.2s var(--ease); }
.env-pocket {
  z-index: 2;
  background-color: var(--paper);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(18, 17, 16, .08);
}
.env-pocket::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(18, 17, 16, .14) 50%, transparent calc(50% + 1px)) left bottom / 50.2% 100% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(18, 17, 16, .14) 50%, transparent calc(50% + 1px)) right bottom / 50.2% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(18, 17, 16, .07));
}
.env-flap {
  z-index: 4;
  background-color: #EDE4D5;
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  transform-origin: 50% 0;
  transform: translateY(0) rotate(0deg) rotateX(0deg);
  transition: transform .75s cubic-bezier(.45, 0, .2, 1) .16s, z-index 0s .5s;
  filter: drop-shadow(0 3px 2px rgba(18, 17, 16, .2));
}

.env-seal {   /* the red wax seal, pressed with the Santa-hat mammoth */
  position: absolute;
  z-index: 5;
  left: 50%; top: 60%;
  width: 33%;
  aspect-ratio: 1;
  margin: -16.5% 0 0 -16.5%;
  transition: transform .45s var(--ease), opacity .35s var(--ease);
}
.env-seal img, .fold-seal img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .32)) drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
}
.envelope:hover .env-seal { transform: scale(1.06) rotate(-5deg); }

.env-card {
  position: absolute;
  z-index: 1;
  left: 7%; right: 7%; top: 6%;
  height: 90%;
  border-radius: 3px;
  background: var(--sheet);
  box-shadow: 0 2px 6px rgba(18, 17, 16, .2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8.5%;
  overflow: hidden;
  color: var(--ink);
  container-type: size;              /* everything on it scales with the card */
  transition: transform .9s cubic-bezier(.2, .85, .25, 1), box-shadow .6s var(--ease);
}

/* opening, in four steps (js adds each class in turn):
   1. the seal lifts off and the flap swings up        .env-opening
   2. the card slides all the way out                  .env-out
   3. the envelope falls away, the card comes forward  .env-drop
   4. it comes right up to you as the scene lights up  .env-done */
.env-opening .env-bob { animation-play-state: paused; }
.env-opening .env-seal { transform: translateY(16%) rotate(-16deg) scale(1.08); opacity: 0; transition: transform .55s cubic-bezier(.4, 0, .6, 1), opacity .4s .1s var(--ease); }
.env-opening .env-flap { transform: translateY(0) rotate(0deg) rotateX(178deg); z-index: 0; }
.env-opening .env-back { box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6); }
.env-out .env-card { transform: translateY(-108%); }
.env-drop .env-back, .env-drop .env-pocket {
  transform: translateY(90%) rotate(5deg);
  opacity: 0;
  transition: transform .85s cubic-bezier(.55, 0, .75, .2), opacity .5s .3s var(--ease);
}
.env-drop .env-flap {
  transform: translateY(90%) rotate(5deg) rotateX(178deg);
  opacity: 0;
  transition: transform .85s cubic-bezier(.55, 0, .75, .2), opacity .5s .3s var(--ease);
}
.env-drop .env-card {
  z-index: 6;
  transform: translateY(-6%) scale(1.24);
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .7);
  transition: transform .9s cubic-bezier(.3, 1.3, .5, 1), box-shadow .6s var(--ease);
}
.env-done .env-card {
  transform: translateY(-6%) scale(2.3);
  opacity: 0;
  transition: transform .85s cubic-bezier(.5, 0, .2, 1), opacity .5s .25s var(--ease);
}
.env-card-small, .env-card-big { position: relative; z-index: 1; }
.env-card-small { font: 700 11px/1 var(--sans); font-size: 4cqw; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.env-card-big { margin-top: .3cqw; font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 8.4vw, 44px); font-size: 12cqw; line-height: 1.05; letter-spacing: -.025em; }

/* the festive bits: a red double frame, holly in the corners, fairy lights across the top */
.env-card-deco, .env-card-lights { position: absolute; left: 0; width: 100%; pointer-events: none; }
.env-card-deco { top: 0; height: 100%; }
.env-card-lights { top: 0; height: auto; aspect-ratio: 273 / 34; z-index: 3; overflow: visible; }

/* the mammoth, in an arched window on a snowy night */
.env-card-window {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 8%;
  height: 56%;
  aspect-ratio: .9;
  translate: -50% 0;
  overflow: hidden;
  border-radius: 999px 999px 3px 3px;
  background: radial-gradient(120% 80% at 50% 18%, #2A251E 0%, var(--night) 70%);
  box-shadow: 0 0 0 1.5px var(--sheet), 0 0 0 2.6px var(--red);
}
.env-card-stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.env-card-snow {
  position: absolute;
  left: 0; right: 0;
  top: -92px; bottom: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 46'><g fill='%23F6F0E4'><circle cx='6' cy='9' r='1.3' opacity='.9'/><circle cx='25' cy='4' r='.9' opacity='.6'/><circle cx='38' cy='18' r='1.4' opacity='.85'/><circle cx='15' cy='30' r='1' opacity='.7'/><circle cx='31' cy='38' r='1.2' opacity='.8'/><circle cx='43' cy='31' r='.7' opacity='.5'/><circle cx='20' cy='19' r='.6' opacity='.5'/></g></svg>") 0 0 / 46px 46px;
  will-change: transform;
  animation: env-snow 3.8s linear infinite paused;
}
.env-card-snow.is-far {
  top: -46px;
  opacity: .55;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23'><g fill='%23F6F0E4'><circle cx='4' cy='5' r='.6'/><circle cx='15' cy='9' r='.5'/><circle cx='9' cy='17' r='.55'/><circle cx='20' cy='20' r='.45'/></g></svg>") 0 0 / 23px 23px;
  animation-name: env-snow-far;
  animation-duration: 3.4s;
}
.env-opening .env-card-snow { animation-play-state: running; }
@keyframes env-snow { to { transform: translateY(92px); } }
@keyframes env-snow-far { to { transform: translateY(46px); } }
.env-card-art {
  position: absolute;
  left: 5%; right: 5%;
  top: 6%; bottom: -8%;
  width: 90%; height: 102%;
  object-fit: contain;
  object-position: 50% 100%;
}

/* =========================================================================
   THE NOTE
   ========================================================================= */

.note-layer {
  position: relative;
  z-index: 3;
  display: none;
  padding: var(--peek, 42svh) var(--gr) calc(var(--sb) + 40px) var(--gl);
}
html:not(.js) .note-layer, .is-open .note-layer, .is-opening .note-layer { display: block; }
html:not(.js) .note-layer { padding-top: 32px; }

.is-measuring .note-layer {
  display: block;
  position: absolute; left: 0; right: 0; top: 0;
  visibility: hidden;
  pointer-events: none;
}
html.is-sneezed:not(.is-open), html.is-opening, html.is-envelope { overflow: hidden; }

.is-opening .note-layer { pointer-events: none; }
.is-opening .flip { visibility: hidden; }

.note-wrap {
  position: relative;
  width: min(100%, 500px);
  margin: 0 auto;
  perspective: 2000px;
}

.flip { position: relative; display: grid; transform-style: preserve-3d; }

.face {
  grid-area: 1 / 1;
  position: relative;
  border-radius: 3px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow:
    0 1px 0 rgba(18, 17, 16, .07),
    0 3px 6px rgba(0, 0, 0, .12),
    0 40px 70px -30px rgba(0, 0, 0, .8);
  transition: box-shadow .7s var(--ease);
}
.is-opening .face { box-shadow: none; }
.face-back { transform: rotateY(180deg); }

/* ----- the letter ----- */
.note {
  padding: 32px 28px 24px;
  background-color: var(--sheet);
  background-image:
    linear-gradient(180deg,
      transparent calc(33.333% - 22px),
      rgba(18, 17, 16, .035) calc(33.333% - 1px),
      rgba(18, 17, 16, .11) calc(33.333% - 1px), rgba(18, 17, 16, .11) 33.333%,
      rgba(255, 255, 255, .95) 33.333%, rgba(255, 255, 255, .95) calc(33.333% + 1.5px),
      rgba(255, 255, 255, .25) calc(33.333% + 2px),
      transparent calc(33.333% + 18px)),
    linear-gradient(180deg,
      transparent calc(66.666% - 18px),
      rgba(255, 255, 255, .25) calc(66.666% - 2px),
      rgba(255, 255, 255, .95) calc(66.666% - 1.5px), rgba(255, 255, 255, .95) 66.666%,
      rgba(18, 17, 16, .11) 66.666%, rgba(18, 17, 16, .11) calc(66.666% + 1px),
      rgba(18, 17, 16, .035) calc(66.666% + 1px),
      transparent calc(66.666% + 22px)),
    var(--noise-paper);
  background-size: 100% 100%, 100% 100%, 220px 220px;
  color: var(--ink);
}

.holly {
  position: absolute;
  top: -28px; right: -20px;
  width: 116px; height: auto;
  transform: rotate(10deg);
  pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(18, 17, 16, .25));
}
.is-opening .holly { visibility: hidden; }
.is-open .holly { animation: holly-in .6s .05s var(--spring) both; }
@keyframes holly-in { from { transform: rotate(-14deg) scale(.55); opacity: 0; } to { transform: rotate(10deg) scale(1); opacity: 1; } }
.fold-clone .holly { display: none; }

.note-date {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  font: 600 12px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
}
.note-date::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.note-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 10.6vw, 56px);
  line-height: .98;
  letter-spacing: -.03em;
}
.note-title:focus { outline: none; }
.note-title:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.note-title .mark { color: inherit; padding: 0 .06em; margin: 0 -.04em; }
.note-title .mark::before { inset: .58em 0 .06em; border-radius: 2px; transition: none; }

/* Chris & Stew, taped on */
.polaroid {
  position: relative;
  width: 88%;
  margin: 6px auto 26px;
  transform: rotate(-2.4deg);
  filter: drop-shadow(0 12px 16px rgba(18, 17, 16, .22)) drop-shadow(0 1px 1px rgba(18, 17, 16, .2));
}
.polaroid img { display: block; width: 100%; height: auto; }
.polaroid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 2.4%;
  text-align: center;
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(22px, 6.4vw, 29px);
  line-height: 1;
  color: var(--ink);
  transform: rotate(1deg);
}
.tape {
  position: absolute;
  z-index: 1;
  left: 50%; top: -12px;
  width: 34%; height: 26px;
  margin-left: -17%;
  background: rgba(242, 200, 75, .8);
  box-shadow: 0 1px 2px rgba(18, 17, 16, .15);
  transform: rotate(3deg);
  clip-path: polygon(2% 0, 98% 4%, 100% 30%, 97% 52%, 100% 76%, 98% 100%, 1% 96%, 3% 70%, 0 45%, 2% 22%);
}

@keyframes line-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* a dog-eared corner */
.note::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 30px; height: 30px;
  background: linear-gradient(315deg, var(--night) 0 50%, #2a2522 50% 100%);
  border-top-left-radius: 3px;
  box-shadow: -2px -2px 5px -2px rgba(18, 17, 16, .25);
  pointer-events: none;
}

.note p { margin: 0 0 14px; font-size: 17px; line-height: 1.6; }
.note .signoff { margin-top: 24px; margin-bottom: 0; }
.sig {
  display: block;
  margin: 2px 0 0 -2px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 42px;
  line-height: 1;
  transform: rotate(-3deg);
  transform-origin: 0 50%;
}
.is-open .sig { animation: write-in 1.1s .25s steps(14) both; }
@keyframes write-in { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }
.fold-clone .sig { visibility: hidden; }

.note .ps {
  margin: 24px 0 0;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  transform: rotate(-1.2deg);
  transform-origin: 0 50%;
}
.ps-link {
  display: inline-block;             /* on its own line, in one piece, with one stroke of the marker */
  margin-top: 6px;
  white-space: nowrap;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'><path d='M2 9.5C40 4 92 3.5 198 6.5' fill='none' stroke='%23F2C84B' stroke-width='7' stroke-linecap='round'/><path d='M8 12.5C60 9 120 8.5 186 10' fill='none' stroke='%23F2C84B' stroke-width='3.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% .55em;
  background-position: 0 100%;
  padding-bottom: .12em;
  border-radius: 3px;
  transition: background-color .25s var(--ease);
}
.ps-link:hover { background-color: rgba(242, 200, 75, .45); }
.ps-soon {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  font-weight: 700;
  color: var(--red);
  text-wrap: balance;
}
.nobr { white-space: nowrap; }
.ps-addr {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--soft);
  -webkit-user-select: all;
  user-select: all;
}
.ps-addr::before { content: "→ "; }
.ps-link:focus-visible { outline-offset: 4px; }

.note-foot { display: flex; justify-content: flex-end; margin-top: 20px; padding-right: 22px; }

.turn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  background: transparent;
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.turn:active { transform: scale(.96); }
.turn svg { width: 18px; height: 18px; display: block; transition: transform .6s var(--spring); }
.turn:hover svg { transform: rotate(180deg); }
.note .turn:hover { background: var(--ink); color: var(--sheet); border-color: var(--ink); }

/* ----- the back of the card: our mammoth flying home past the moon, over the snow ----- */
.bizcard {
  display: flex;
  overflow: hidden;
  padding: 14px;
  background-color: #1B1916;
  background-image:
    radial-gradient(80% 50% at 50% 40%, #2A2620 0%, rgba(27, 25, 22, 0) 70%),
    var(--noise-paper);
  background-size: 100% 100%, 220px 220px;
  background-blend-mode: normal, screen;
  box-shadow: inset 0 0 0 1px rgba(239, 231, 218, .12), 0 1px 0 rgba(255, 255, 255, .04), 0 40px 70px -30px rgba(0, 0, 0, .9);
  color: var(--paper);
}
.bizcard::after {   /* the same creases as the letter: it's one sheet, folded in three */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      transparent calc(33.333% - 1px), rgba(255, 255, 255, .07) calc(33.333% - 1px),
      rgba(255, 255, 255, .07) 33.333%, rgba(0, 0, 0, .3) 33.333%, rgba(0, 0, 0, .3) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(180deg,
      transparent calc(66.666% - 1px), rgba(0, 0, 0, .22) calc(66.666% - 1px),
      rgba(0, 0, 0, .22) 66.666%, rgba(255, 255, 255, .1) 66.666%, rgba(255, 255, 255, .1) calc(66.666% + 1px), transparent calc(66.666% + 1px));
}
.bc-inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 0;
  border: 1px solid rgba(239, 231, 218, .22);
  border-radius: 2px;
  overflow: hidden;
}
.bc-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 10.4vw, 52px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--paper);
}
.bc-mark img { width: 1.3em; height: auto; display: block; margin-block: -.1em; }
.bc-mark:focus { outline: none; }
.bc-mark:focus-visible { outline: 3px solid var(--butter); outline-offset: 6px; }

.bc-sky {
  position: relative;
  flex: 1;
  min-height: 300px;
  display: grid;
  place-items: center;
  margin: 0 -22px;
}
.bc-stars { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bc-stars .s { fill: var(--paper); transform-box: fill-box; transform-origin: center; animation: bc-twinkle var(--t, 3s) var(--d, 0s) ease-in-out infinite; }
.bc-stars .s.b { fill: var(--butter); }
.bc-stars .f { fill: var(--paper); animation: bc-fall var(--t, 9s) var(--d, 0s) linear infinite; }
@keyframes bc-fall {
  from { transform: translate(0, -12px); opacity: 0; }
  10% { opacity: var(--o, .7); }
  85% { opacity: var(--o, .7); }
  to { transform: translate(var(--dx, 4px), 104px); opacity: 0; }
}
@keyframes bc-twinkle { 0%, 100% { opacity: .2; transform: scale(.55); } 50% { opacity: 1; transform: scale(1); } }
.bc-moon {
  position: absolute;
  left: 50%; top: 50%;
  width: min(66%, 320px);
  aspect-ratio: 1;
  translate: -50% -58%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .38), transparent 34%),
    radial-gradient(circle at 70% 64%, rgba(18, 17, 16, .1) 0 9%, transparent 9.5%),
    radial-gradient(circle at 28% 68%, rgba(18, 17, 16, .08) 0 6%, transparent 6.5%),
    radial-gradient(circle at 62% 24%, rgba(18, 17, 16, .07) 0 5%, transparent 5.5%),
    radial-gradient(circle at 44% 50%, rgba(18, 17, 16, .05) 0 4%, transparent 4.5%),
    var(--butter);
  box-shadow: 0 0 0 12px rgba(242, 200, 75, .06), 0 0 0 30px rgba(242, 200, 75, .035), 0 0 80px 16px rgba(242, 200, 75, .2);
}
.bc-moon::before {                    /* the glow breathes: a soft halo fading in and out, cheap to draw */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 16px rgba(242, 200, 75, .05), 0 0 0 38px rgba(242, 200, 75, .025), 0 0 110px 26px rgba(242, 200, 75, .14);
  opacity: 0;
  will-change: opacity;
  animation: moon-glow 5s ease-in-out infinite;
}
@keyframes moon-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
/* the back of the card only animates while it's showing */
html:not(.is-back) .bizcard *, html:not(.is-back) .bizcard *::before { animation-play-state: paused !important; }
.bc-art {
  position: relative;
  display: block;
  width: min(100%, 470px);
  pointer-events: none;
  translate: 0 -6%;
}
.bc-art img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .55));
  animation: bc-fly 4.6s ease-in-out infinite;
  transform-origin: 50% 60%;
}
@keyframes bc-fly {
  0%, 100% { transform: translate(-8px, 6px) rotate(-3deg); }
  50% { transform: translate(8px, -12px) rotate(1.5deg); }
}

/* the snowy ground the details sit on */
.bc-foot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 0 -22px;
  padding: 8px 22px 22px;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
}
.bc-ground {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% - 1px);
  height: 56px;
}
.bc-hill { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bc-trees {
  position: absolute;
  inset: 0;
  clip-path: inset(-400px 0 0 0);     /* trees can stand tall, but never poke out below the snow */
}

/* Christmas trees, planted behind the hills (js/card.js → TREES) */
.bc-tree {
  position: absolute;
  display: block;
  overflow: visible;
  height: auto;
  translate: -50% -100%;
  transform-origin: 50% 100%;
  transition: transform .7s cubic-bezier(.3, 1.3, .55, 1) calc(var(--tree-wait, .38s) + var(--o, 0) * 60ms);
}
.js:not(.trees-up) .bc-tree {         /* tucked down behind the snow until they're turned over and in view */
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.5, 0, .75, 0) .5s;
}
.bc-tree .glow { transform-box: fill-box; transform-origin: center; animation: bc-glow 3.2s ease-in-out infinite; }
.bc-tree .light { transform-box: fill-box; transform-origin: center; animation: bc-light var(--t, 2.6s) var(--d, 0s) ease-in-out infinite; }
.js:not(.trees-up) .bc-tree .glow, .js:not(.trees-up) .bc-tree .light { animation-play-state: paused; }
@keyframes bc-glow { 0%, 100% { opacity: .75; transform: scale(.88); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes bc-light { 0%, 100% { opacity: 1; } 50% { opacity: .35; transform: scale(.7); } }
.bc-details { position: relative; }
.bc-details p { margin: 0; }
.bc-names {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 8px !important;
}
.bc-email, .bc-link {
  display: inline-block;
  padding: 6px 0;
  color: var(--ink);
  font: 500 17px/1.3 var(--sans);
  text-decoration: none;
}
.bc-email { text-decoration: underline; text-decoration-color: rgba(18, 17, 16, .35); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.bc-email:hover { text-decoration-color: var(--red); }
.bc-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--butter);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
  text-decoration-skip-ink: none;
  text-wrap: balance;
  border-radius: 3px;
  transition: background-color .25s var(--ease);
}
.bc-link:hover { background-color: rgba(242, 200, 75, .45); }
.bc-links { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 2px !important; }
.bc-arr { display: inline-block; transition: transform .35s var(--ease); }
.bc-link:hover .bc-arr { transform: translateX(4px); }
.bizcard :focus-visible { outline-color: var(--ink); }
.turn-back { color: var(--ink); border-color: rgba(18, 17, 16, .5); background: transparent; }
.turn-back:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ----- after the card: send it on, or again ----- */
.after {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  margin-top: 28px;
}
.is-opening .after { opacity: 0; }
.is-open .after { animation: line-in .6s .35s var(--ease) both; }
.after-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  background: none;
  color: rgba(239, 231, 218, .76);
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  border-radius: 999px;
  transition: color .25s, background-color .25s, border-color .25s, opacity .4s, transform .3s var(--ease);
}
.after-btn:active { transform: scale(.96); }
.after-btn svg { width: 17px; height: 17px; transition: transform .6s var(--spring); }
.after-btn:hover { color: var(--paper); background: rgba(239, 231, 218, .1); }
.share { color: var(--ink); background: var(--butter); border-color: var(--butter); }
.share:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.replay:hover svg { transform: rotate(-200deg); }
.reduce-motion .replay, html:not(.js) .after { display: none; }

/* ----- unfolding animation (built by js) ----- */
.fold-stage { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; perspective: 1600px; z-index: 5; }
.fold { position: absolute; left: 0; transform-style: preserve-3d; transform-origin: 50% 50%; will-change: transform; }
.fold-panel { position: absolute; left: 0; width: 100%; transform-style: preserve-3d; }
.fold-face { position: absolute; inset: 0; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: var(--sheet); }
.fold-face--back {
  transform: rotateX(180deg);
  background-color: #F6F0E4;
  background-image: var(--noise-paper);
  background-size: 220px 220px;
  box-shadow: inset 0 0 0 1px rgba(18, 17, 16, .12);
}
.fold-clone { position: absolute !important; left: 0; margin: 0 !important; box-shadow: none !important; }
.fold-shade { position: absolute; inset: 0; background: var(--ink); opacity: 0; pointer-events: none; }
/* the outside of the folded letter: a little Christmas card of its own */
.fold-face--back::before {           /* a red double frame, like the card in the envelope */
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid var(--red);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px #F6F0E4, inset 0 0 0 4px var(--red);
  pointer-events: none;
}
.fold-cover { container-type: size; }
.fold-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-right: 8%;
  color: var(--ink);
}
.fold-merry { font: 700 11px/1 var(--sans); font-size: clamp(10px, 3.6cqw, 15px); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.fold-for {
  margin-top: .1em;
  font-family: var(--hand); font-weight: 700; font-size: 46px; font-size: clamp(38px, 15cqw, 64px);
  line-height: 1;
  transform: rotate(-4deg);
}
.fold-holly {
  position: absolute;
  left: 4%; top: 5%;
  width: 25%; height: auto;
  transform: rotate(-10deg);
}
.fold-holly.is-low { left: auto; top: auto; right: 4%; bottom: 5%; transform: rotate(170deg); }
.fold-seal {
  position: absolute;
  z-index: 1;
  right: 7%; top: 50%;
  width: clamp(54px, 19cqw, 82px);
  translate: 0 -50%;
  rotate: -8deg;
}
.fold-star { position: absolute; width: clamp(9px, 3.2cqw, 14px); color: var(--butter); }
.fold-star svg { display: block; width: 100%; height: auto; }

/* =========================================================================
   SIZES
   ========================================================================= */

/* bigger screens: a touch more air */
@media (min-width: 720px) {
  .stage { padding-top: calc(var(--st) + 38px); padding-bottom: calc(var(--sb) + 26px); }
  .wordmark { font-size: 27px; gap: 10px; }
  .eyebrow { font-size: 14px; margin-top: 16px; }
  .headline { margin-top: 12px; }
  .note { padding: 42px 30px 30px; }
  .note .ps { margin-top: 28px; }
  .note-foot { margin-top: 44px; }     /* the extra room down here keeps the lower fold in the gap above "Cheers," */
  .note-foot { padding-right: 26px; }
  .bc-inner { padding: 36px 30px 0; }
  .bc-sky, .bc-foot { margin-inline: -30px; }
  .bc-foot { padding: 10px 30px 28px; }
}

/* tall tablets: a bigger button to match the bigger mammoth */
@media (min-width: 720px) and (min-height: 960px) {
  .btn { min-height: 62px; font-size: 18px; padding-right: 32px; }
  .btn-ico { width: 42px; height: 42px; }
  .hint { font-size: 15px; }
  .pip { width: 15px; height: 15px; }
}

/* short screens: landscape phones, small laptops */
@media (max-height: 560px) {
  .stage { padding-top: calc(var(--st) + 22px); padding-bottom: calc(var(--sb) + 10px); }
  .eyebrow { display: none; }
  .headline { margin-top: 6px; --hl: clamp(28px, 9vh, 44px); }
  .controls { gap: 6px; padding-top: 4px; }
  .btn { min-height: 48px; }
  .hint { display: none; }
  .envelope { margin-top: 30px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .stage { padding-top: calc(var(--st) + 46px); }
  .stage-top { grid-area: auto; position: absolute; top: calc(var(--st) + 50px); left: var(--gl); }
  .wordmark { font-size: 20px; }
  .head-block .headline { margin-top: 0; }
}

/* small phones */
@media (max-width: 360px) {
  .note { padding: 28px 20px 20px; }
  .note p { font-size: 16px; }
  .bc-inner { padding: 22px 16px 0; }
  .bc-sky, .bc-foot { margin-inline: -16px; }
  .btn { padding-right: 22px; }
}

/* =========================================================================
   STATIC RENDERS (used to export the email image and the link preview)
   ========================================================================= */

.render-email body, .render-og body { background: var(--night); overflow: hidden; }
.render-email .stage, .render-og .stage { position: relative; inset: auto; }
.render-email .controls, .render-og .controls,
.render-email .note-layer, .render-og .note-layer,
.render-email .skip, .render-og .skip { display: none !important; }
.render-email .grain, .render-og .grain { opacity: .04; }

.render-email .stage {
  width: 600px; height: 620px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top" "head" "scene";
  padding: 34px 20px 8px;
}
.render-email .headline { --hl: 50px; margin-top: 8px; }
.render-email .eyebrow { margin-top: 12px; }

.render-og .stage {
  width: 1200px; height: 630px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top" "head" "scene";
  padding: 40px 40px 8px;
}
.render-og .wordmark { font-size: 28px; }
.render-og .eyebrow { display: none; }
.render-og .headline { --hl: 62px; margin-top: 14px; }

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .star-dot { opacity: .5; }
}
