/* Hero: the stamp, one headline, the way in.
   Behind the stamp, a postmark pressed blind into the paper: no ink,
   just a light edge and a dark edge, the way a cancel dents an envelope. */

body.letterpress #top {
  --press-hi: rgb(255 255 255 / .95);
  --press-lo: rgb(32 33 36 / .085);
  --paper: #fffdf8;
  --paper-ink: #2a2730;
  --paper-sub: #85808c;
  --paper-edge: rgb(60 50 40 / .10);
  --paper-shadow: 0 1px 1px rgb(40 30 20 / .05), 0 10px 22px -6px rgb(40 30 60 / .16), 0 26px 50px -20px rgb(40 30 60 / .22);
  padding-top: 96px;
  max-width: 760px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.letterpress #top {
    --press-hi: rgb(255 255 255 / .05);
    --press-lo: rgb(0 0 0 / .34);
    --paper: #302f2c;
    --paper-ink: #f1eee8;
    --paper-sub: #a19c94;
    --paper-edge: rgb(255 255 255 / .08);
    --paper-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 14px 30px -8px rgb(0 0 0 / .55);
  }
}
:root[data-theme="dark"] body.letterpress #top {
  --press-hi: rgb(255 255 255 / .05); --press-lo: rgb(0 0 0 / .34);
  --paper: #302f2c; --paper-ink: #f1eee8; --paper-sub: #a19c94; --paper-edge: rgb(255 255 255 / .08);
  --paper-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 14px 30px -8px rgb(0 0 0 / .55);
}

/* ── The stamp and its postmark ── */
#top .stamp-wrap { position: relative; z-index: 3; margin-bottom: 26px; }
#top .postmark-press {
  position: absolute; z-index: 0; left: 50%; top: 50%;
  /* Never wider than the half-page to the right of the stamp, so it can't push the page sideways. */
  --pw: min(320px, calc(50vw - 24px));
  width: var(--pw); height: calc(var(--pw) * .375);
  margin: calc(var(--pw) * -.1875 - 4px) 0 0 calc(var(--pw) * -.04375);
  max-width: none; pointer-events: none; overflow: visible;
  -webkit-mask: linear-gradient(90deg, #000 55%, transparent 96%); mask: linear-gradient(90deg, #000 55%, transparent 96%);
}
/* Two strokes make the dent: the lit lower edge, then the shaded upper one. */
#top .postmark-press g { stroke: var(--press-lo); filter: drop-shadow(0 1px 0 var(--press-hi)); }
#top .postmark-press g > * { vector-effect: non-scaling-stroke; }

body.letterpress.postmark.v4.still #top .stamp-button {
  position: relative; z-index: 1; margin: 0; border-radius: 22px;
  transform: rotate(-5deg);
  transition: transform .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
body.letterpress.postmark.v4.still #top .stamp-button .hero-icon {
  width: 96px; height: 96px;
  filter: drop-shadow(0 8px 14px rgb(40 40 110 / .16));
  transition: filter .35s var(--ease);
}
@media (hover: hover) {
  body.letterpress.postmark.v4.still #top .stamp-button:hover { transform: rotate(2deg) translateY(-3px); }
  body.letterpress.postmark.v4.still #top .stamp-button:hover .hero-icon { filter: drop-shadow(0 12px 16px rgb(40 40 110 / .18)); }
}
body.letterpress.postmark.v4.still #top .stamp-button:active { transform: rotate(0) scale(.94); transition-duration: .12s; }
body.letterpress.postmark.v4.still #top .stamp-button[aria-expanded="true"] { transform: rotate(0) translateY(-2px); }
#top .stamp-button:focus-visible { outline: 2px solid var(--seal); outline-offset: 6px; }
/* The hint sits to the left, clear of the postmark. Pointer: on hover or focus.
   Touch: always there, quietly, since nothing can hover. */
body.letterpress #top .stamp-hint {
  display: block; left: auto; right: calc(100% + 14px); top: 50%; margin-top: -9px;
  font-size: 12px; line-height: 18px; color: var(--t3);
  transform: rotate(-5deg) translateX(4px);
}
body.letterpress #top .stamp-button:is(:hover, :focus-visible) .stamp-hint { transform: rotate(-5deg) translateX(0); }
@media (hover: none) { body.letterpress #top .stamp-hint { opacity: .85; transform: rotate(-5deg); } }
body.letterpress #top .stamp-button[aria-expanded="true"] .stamp-hint { opacity: 0; }

/* ── The note: a card of paper that slides out from under the stamp ── */
body.letterpress #top .little-note {
  position: absolute; z-index: 2; top: calc(100% + 14px); left: 50%;
  width: min(320px, calc(100vw - 48px)); margin-left: max(-160px, calc((100vw - 48px) / -2));
  padding: 26px 28px 24px; text-align: left;
  background: var(--paper); color: var(--paper-ink);
  border: 0; border-radius: 6px;
  box-shadow: 0 0 0 1px var(--paper-edge), var(--paper-shadow);
  transform: rotate(-2deg); transform-origin: 50% 0;
  animation: note-out .34s var(--ease) both;
}
body.letterpress #top .little-note[hidden] { display: none; }
body.letterpress #top .little-note.is-closing { animation: note-in .2s cubic-bezier(.4, 0, .6, 1) both; }
@keyframes note-out { from { opacity: 0; transform: translateY(-18px) rotate(1deg) scale(.94); } to { opacity: 1; transform: rotate(-2deg); } }
@keyframes note-in { from { opacity: 1; transform: rotate(-2deg); } to { opacity: 0; transform: translateY(-12px) rotate(0) scale(.96); } }

#top .note-seal { position: absolute; top: -12px; left: 24px; width: 28px; height: 28px; transform: rotate(-12deg); filter: drop-shadow(0 2px 3px rgb(30 30 90 / .25)); }
body.letterpress #top .note-label { display: block; font-size: 12px; letter-spacing: 0; color: var(--paper-sub); }
body.letterpress #top .little-note p {
  margin: 8px 0 0; font-size: 22px; font-weight: 400; line-height: 1.28;
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif !important;
  letter-spacing: -.012em; color: var(--paper-ink); text-wrap: pretty;
}
body.letterpress #top .note-close {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px;
  display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 999px; background: none; color: var(--paper-sub); cursor: pointer;
  transition: background-color .15s, color .15s;
}
#top .note-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
@media (hover: hover) { body.letterpress #top .note-close:hover { background: rgb(128 120 110 / .12); color: var(--paper-ink); } }
#top .note-close:focus-visible { outline: 2px solid var(--seal); outline-offset: -2px; }

/* ── Headline: the claim in ink, what it is in gray ── */
body.letterpress.postmark.v4.still #top h1 {
  max-width: 13em; margin: 0 auto;
  font-size: clamp(42px, 5.4vw, 68px); font-weight: 550; line-height: 1.06; letter-spacing: -.042em;
  text-wrap: balance;
}
#top .h1-quiet { display: block; color: var(--t3); }

/* ── The way in ── */
body.letterpress.postmark.v4.still #top .ctas { margin-top: 30px; gap: 8px; }
body.letterpress.postmark.v4.still #top .fine { margin-top: 14px; font-size: 12.5px; color: var(--t3); letter-spacing: -.005em; }

/* Arrival: the stamp settles first, the rest follows. */
@media (prefers-reduced-motion: no-preference) {
  body.letterpress.mw-ready #top .stamp-wrap { animation: stamp-settle .5s var(--ease) both; }
  @keyframes stamp-settle { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 600px) {
  body.letterpress #top { padding-top: 92px; }
  #top .stamp-wrap { margin-bottom: 20px; }
  body.letterpress.postmark.v4.still #top .stamp-button .hero-icon { width: 78px; height: 78px; }
  body.letterpress.postmark.v4.still #top h1 { font-size: 38px; line-height: 1.08; letter-spacing: -.038em; }
  body.letterpress.postmark.v4.still #top .ctas { margin-top: 26px; gap: 4px; }
  body.letterpress.postmark.v4.still #top .ctas .btn--ink { padding-inline: 17px; }
  body.letterpress.postmark.v4.still #top .quiet-buy { padding-inline: 10px; }
  body.letterpress #top .little-note p { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body.letterpress #top .little-note, body.letterpress #top .little-note.is-closing { animation: note-fade .16s linear both; transform: rotate(-2deg); }
  body.letterpress #top .little-note.is-closing { animation-direction: reverse; }
  @keyframes note-fade { from { opacity: 0; } to { opacity: 1; } }
  body.letterpress.postmark.v4.still #top .stamp-button,
  body.letterpress.postmark.v4.still #top .stamp-button .hero-icon { transition: none; }
}

#top .note-sign { display: block; margin-top: 10px; font: italic 400 19px/1.2 ui-serif, "New York", "Iowan Old Style", Georgia, serif; color: var(--paper-sub); }

/* The postcard: softer corners, and signed in Luke's hand. The name writes
   itself each time the card opens. */
body.letterpress #top .little-note { border-radius: 14px; }
#top .note-sign { margin-top: 6px; color: var(--paper-ink); opacity: .8; }
#top .note-sign svg { display: block; width: 84px; height: auto; margin-left: -5px; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  #top .little-note:not([hidden]):not(.is-closing) .note-sign path { stroke-dasharray: 1; animation: note-write 1.1s cubic-bezier(.45, .05, .25, 1) .3s both; }
}
@keyframes note-write { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ── A little paper tag for the iPhone beta, tucked under the way in ── */
body.letterpress #top .mini-tag { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; margin-top: 26px; padding: 8px 14px 8px 16px; border-radius: 999px; background: var(--paper); color: var(--paper-ink); font: 500 13.5px/1 var(--sys); letter-spacing: -.005em; text-decoration: none; box-shadow: 0 0 0 1px var(--paper-edge), 0 1px 1px rgb(40 30 20 / .05), 0 6px 14px -8px rgb(40 30 60 / .25); transform: rotate(-1.5deg); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; }
body.letterpress #top .mini-tag .ic { width: 14px; height: 14px; fill: none; stroke: var(--paper-sub); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
@media (hover: hover) {
  body.letterpress #top .mini-tag:hover { transform: rotate(0) translateY(-1px); }
  body.letterpress #top .mini-tag:hover .ic { transform: translateX(3px); }
}
body.letterpress #top .mini-tag:active { transform: scale(.97); }
body.letterpress #top .mini-tag:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { body.letterpress #top .mini-tag { transition: none; } }
