:root {
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --ink-4: #86868b;
  --line: #e8e8ed;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --blue: #0071e3;
  --postmark: #b3261e;
  --row: 76px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2 { font-weight: 600; letter-spacing: -0.02em; margin: 0; }

.button {
  display: inline-block; padding: 12px 24px; border-radius: 980px;
  background: var(--blue); color: #fff; text-decoration: none; font-size: 17px;
  transition: background 0.2s;
}
.button:hover { background: #0077ed; }

/* Hero: mustard, with flag stamps flying around the edges */
.hero {
  position: relative; overflow: hidden; background: #f2c94c;
  min-height: min(76vh, 760px); min-height: min(76svh, 760px);
  display: flex; align-items: center; justify-content: center;
  padding: 120px 22px; text-align: center;
}
.hero-content { position: relative; z-index: 2; max-width: 680px; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); line-height: 0.98; letter-spacing: -0.035em; }
.lede {
  max-width: 560px; margin: 22px auto 30px;
  font-size: clamp(17px, 2.1vw, 21px); line-height: 1.45; color: #3a3214;
  text-wrap: pretty; /* avoid a lonely last word */
}
.lede .cheeky { font-weight: 700; color: #e8336d; }
.stamps { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.stamp {
  position: absolute; left: 0; top: 0; width: var(--w, 104px); height: calc(var(--w, 104px) * 0.8);
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.18)); will-change: transform;
}
.stamp .perf {
  height: 100%; padding: 7px; background: #fff;
  -webkit-mask: radial-gradient(circle 4px, #0000 95%, #000) -5px -5px / 10px 10px round, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle 4px, #0000 95%, #000) -5px -5px / 10px 10px round, linear-gradient(#000 0 0) content-box;
}
.stamp i { display: block; height: 100%; background: center / cover; }
/* The finger: tip on the stamp, length set in JS so it always runs off-screen */
.finger {
  --fw: calc(var(--w, 104px) * 0.36);
  position: absolute; left: 50%; top: 50%; z-index: 2; pointer-events: none;
  width: var(--fw); height: var(--len, 200px); margin-left: calc(var(--fw) / -2); transform-origin: 50% 0;
  background: #f0c3a1; border-radius: calc(var(--fw) / 2) calc(var(--fw) / 2) 0 0;
  box-shadow: inset calc(var(--fw) * -0.09) 0 0 #e2ab88;
}
.finger::before { /* nail */
  content: ""; position: absolute; left: 22%; width: 56%; top: calc(var(--fw) * 0.1); height: calc(var(--fw) * 0.42);
  background: #fbe2d2; border-radius: 50% 50% 42% 42% / 58% 58% 42% 42%;
}
.finger i { /* knuckle creases */
  position: absolute; left: 24%; width: 52%; height: calc(var(--fw) * 0.18);
  border-bottom: 2px solid #d29a76; border-radius: 0 0 50% 50%;
}
.finger i:first-child { top: calc(var(--fw) * 1.25); }
.finger i:last-child { top: calc(var(--fw) * 1.45); }

.offset-button {
  font-family: var(--font); cursor: pointer;
  display: inline-block; padding: 14px 28px; font-size: 17px; font-weight: 500; color: var(--ink); text-decoration: none;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.offset-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.offset-button:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }

/* Numbers */
.stats { max-width: 760px; margin: 0 auto; padding: 64px 22px 80px; border-top: 1px solid var(--line); text-align: center; }
.stats .strip { margin-top: 28px; }
/* Countdown: today's calendar sheet, then the words */
.days-line { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 14px; color: var(--ink-2); font-size: 22px; line-height: 1.2; }
.sheet { flex: none; width: 66px; height: 66px; filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.3)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.14)); }
.sheet svg { display: block; width: 100%; height: 100%; overflow: visible; }
.days-text { position: relative; top: 6px; text-align: left; } /* "days left" carries on the number's baseline */
.days-text small { display: block; margin-top: 2px; font-size: 17px; color: var(--ink-3); }
.dt-hand { display: inline-block; font-family: "Caveat", cursive; font-size: 36px; font-weight: 700; color: #e8336d; line-height: 1; }
.dt-hand i { display: inline-block; font-style: normal; }
/* "days left" reads on from the number, tilted at the same angle as the calendar sheet (-4deg) */
.dl-tilt { font-size: 42px; transform: rotate(-4deg); transform-origin: 0 80%; }
/* "to pull this off" in grey handwriting, tilted up along the same slope */
.days-text small.sub-hand { font-family: "Caveat", cursive; font-weight: 700; font-size: 20px; line-height: 1; color: #9a9aa0; transform: rotate(-4deg); transform-origin: left center; }

/* Flag grid: 5 rows of 10, a flag appears when its postcard arrives */
.strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; max-width: 480px; margin: 0 auto; }
.strip > * {
  aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 3px; cursor: pointer;
  background: center / cover; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s, filter 0.2s, transform 0.2s;
}
.strip > *:hover { transform: scale(1.18); opacity: 1 !important; filter: none !important; position: relative; z-index: 1; }
.strip span.extra { background: none; border: 1.5px dashed #c7c7cc; box-shadow: none; cursor: default; transform: none; }
/* Flags still waiting are faded; arrived ones get a green tick */
/* Waiting flags are washed out with a white veil (not opacity, so the promised badge stays bright) */
.strip button:not(.arrived) { position: relative; }
.strip button:not(.arrived)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 255, 255, 0.7); pointer-events: none; transition: opacity 0.2s; }
.strip button.onway::before { background: rgba(255, 255, 255, 0.35); } /* on the way: mostly in colour */
.strip button:hover::before { opacity: 0; }
.strip button.arrived { position: relative; }
.strip button.arrived::after {
  content: ""; position: absolute; pointer-events: none; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: #1b5e34 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: 0 0 0 1.5px #fff;
}

/* Promised flags: a white star on bright mustard, same size and weight as the green arrived tick */
.strip button.promised { position: relative; }
.strip button.promised::after {
  content: ""; position: absolute; pointer-events: none; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: #eda905 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3.6l1.95 4 4.4.6-3.2 3.05.78 4.35L10 13.5l-3.93 2.1.78-4.35L3.65 8.2l4.4-.6Z' fill='white'/%3E%3C/svg%3E") center / 11px no-repeat; box-shadow: 0 0 0 1.5px #fff;
}

/* On-the-way flags: a white arrow on airmail blue, like the tick and the star */
:root { --mail-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3.8 10h11.4M10.4 5.4 15.2 10l-4.8 4.6' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.strip button.onway { position: relative; }
.strip button.onway::after {
  content: ""; position: absolute; pointer-events: none; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: #1f4e9c var(--mail-ico) center / 10px no-repeat; box-shadow: 0 0 0 1.5px #fff;
}

/* Legend under the grid */
.legend { margin: 22px auto 0; max-width: 520px; color: var(--ink-3); font-size: 15px; }
.lg-item { display: inline-flex; align-items: center; gap: 0; border: 0; background: none; padding: 4px 6px; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; }
.lg-item b { color: var(--ink); font-weight: 600; margin: 0 3px 0 5px; }
.lg-ico { flex: none; display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.lg-ico.arrived { background: #1b5e34 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.lg-ico.promised { background: #eda905 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3.6l1.95 4 4.4.6-3.2 3.05.78 4.35L10 13.5l-3.93 2.1.78-4.35L3.65 8.2l4.4-.6Z' fill='white'/%3E%3C/svg%3E") center / 12px no-repeat; }
.lg-ico.onway { background: #1f4e9c var(--mail-ico) center / 11px no-repeat; }
.lg-ico.needed { background: #c7c7cc; }
/* Hovering a status picks out its flags */
.strip[data-hl] > * { transition: opacity 0.2s, transform 0.2s; }
.strip[data-hl="arrived"] > :not(.arrived), .strip[data-hl="promised"] > :not(.promised),
.strip[data-hl="onway"] > :not(.onway), .strip[data-hl="needed"] > :not(.needed) { opacity: 0.25; }
.strip[data-hl="promised"] > .promised::before, .strip[data-hl="onway"] > .onway::before, .strip[data-hl="needed"] > .needed::before { opacity: 0; }
/* Progress bar, counts underneath */
.lg-bar { display: flex; height: 10px; max-width: 480px; margin: 0 auto; border-radius: 5px; overflow: hidden; background: #f3efe6; gap: 2px; }
.lg-seg { cursor: pointer; }
.lg-seg.arrived { background: #1b5e34; }
.lg-seg.promised { background: #eda905; }
.lg-seg.onway { background: #1f4e9c; }
.lg-seg.needed { background: #e3ded2; }
.lg-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 10px; font-size: 14px; }
/* "How to send yours": a little hand taps it now and then (the button presses in); stops while you hover */
.pc-actions { position: relative; }
.cta { animation: cta-press 2.4s ease-in-out infinite; }
.cta:hover { animation: none; }
.tap-hand {
  position: absolute; left: 150px; top: 34px; width: 32px; height: 32px; fill: #fff; stroke: var(--ink); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; z-index: 2; animation: cta-tap 2.4s ease-in-out infinite;
}
.pc-actions:hover .tap-hand { animation: none; opacity: 0; }
@keyframes cta-tap { 0%, 100% { transform: translate(14px, 14px); opacity: 0; } 25% { transform: translate(0, 0); opacity: 1; } 38% { transform: translate(-2px, -4px) scale(0.92); } 50% { transform: translate(0, 0); opacity: 1; } 70% { opacity: 0; transform: translate(14px, 14px); } }
@keyframes cta-press { 0%, 34%, 46%, 100% { transform: none; box-shadow: 5px 5px 0 var(--ink); } 38% { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); } }
@media (prefers-reduced-motion: reduce) { .cta, .tap-hand { animation: none; } .tap-hand { display: none; } }

/* Airmail sticker on the popup: the local word for airmail over "By airmail", in a blue box */
.env-label {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px 5px;
  border: 2px solid #1f4e9c; border-radius: 3px; background: #fffdf7; transform: rotate(-2deg);
}
.al-native { font-size: 15px; letter-spacing: 0.06em; text-transform: none; }
.al-en { font-size: 10px; padding-top: 3px; border-top: 1px solid #1f4e9c; }
/* It takes the place of the "35" stamp, with the postmark running into it */
.env-label { position: absolute; top: 22px; right: 26px; margin: 0; transform: rotate(5deg); z-index: 1; }
.env-cancel { right: 70px; }

/* "Last updated" under the legend, handwritten */
.lg-upd { margin: 10px 0 0; font: 700 17px/1 "Caveat", cursive; color: var(--ink-4); }

/* Countries wheel */
.countries { position: relative; border-top: 1px solid var(--line); }
.countries-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 22px 20px; text-align: center; overflow: hidden;
}
.countries h2 { font-size: clamp(32px, 5vw, 48px); }
.sub { color: var(--ink-3); font-size: 17px; margin: 8px 0 0; }
/* The list reaches into the panel's side padding so the note bubble's shadow isn't cut off by the fade mask */
.wheel {
  position: relative; flex: 1; min-height: 260px; max-height: 760px; margin: 8px -22px;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--fade-top, 14%), #000 calc(100% - var(--fade-bottom, 14%)), transparent);
  mask-image: linear-gradient(transparent, #000 var(--fade-top, 14%), #000 calc(100% - var(--fade-bottom, 14%)), transparent);
}
.item {
  position: absolute; top: 50%; left: 22px; right: 22px; max-width: 520px; margin: calc(var(--row) / -2) auto 0;
  height: var(--row);
  display: flex; align-items: center; gap: 18px;
  cursor: pointer; will-change: transform, opacity;
}
.flag {
  flex: none; width: 56px; height: 42px; border-radius: 6px;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.name { font-size: clamp(26px, 4.2vw, 36px); font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.name.long { font-size: clamp(20px, 3.2vw, 28px); }
.name sup { color: var(--ink-4); font-weight: 500; }
.item.focus { z-index: 5; }
.item.paused.focus .meta, .item.promised.focus .meta { cursor: help; }
@media (hover: none) {
  .item.focus .bubble { opacity: 1; transform: none; pointer-events: auto; }
}

/* Paused- and promised-country bubble: appears on hover (desktop); on phones the note shows on the postcard instead */
/* The bubble hangs from the whole row: it starts under the name and runs to the end of the status pill */
.bubble {
  position: absolute; top: calc(100% + 2px); left: 84px; right: 0; z-index: 10;
  padding: 12px 14px; border-radius: 12px; background: #fff; color: var(--ink-2);
  font-size: 14px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-align: left; white-space: normal;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
@media (hover: hover) {
  .item.focus:hover .bubble { opacity: 1; transform: none; pointer-events: auto; }
}
.meta { flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.detail {
  font-size: 14px; color: var(--ink-3); margin-top: 4px; height: 0; opacity: 0; overflow: hidden;
  transition: opacity 0.4s, height 0.4s; white-space: nowrap;
}
.item.focus .detail { height: 18px; opacity: 1; }

/* Status colors — Airmail: sand → mustard → airmail blue → soft green */
body {
  --needed-bg: #f3efe6; --needed-fg: #7a7365;
  --promised-bg: #fbeab0; --promised-fg: #7a5a00;
  --onway-bg: #dce6f7; --onway-fg: #1f4e9c;
  --arrived-bg: #d8efdf; --arrived-fg: #1b5e34; --ink-mark: #1b5e34;
}

/* Status pills */
.pill {
  flex: none; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 980px; white-space: nowrap;
  background: var(--needed-bg); color: var(--needed-fg);
}
.pill.promised { background: var(--promised-bg); color: var(--promised-fg); }
.pill.onway { background: var(--onway-bg); color: var(--onway-fg); position: relative; overflow: hidden; padding-right: 30px; }
.pill.onway::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: currentColor; animation: travel 1.8s ease-in-out infinite;
}
@keyframes travel {
  0% { transform: translateX(-8px); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateX(8px); opacity: 0; }
}
.pill.arrived { background: var(--arrived-bg); color: var(--arrived-fg); }

/* Arrived: flag becomes a perforated stamp, a postmark lands on it */
.stamp-wrap { position: relative; flex: none; width: 66px; display: flex; justify-content: center; }
.item.arrived .flag {
  border-radius: 0; padding: 5px; background-color: #fff; background-origin: content-box; background-clip: content-box;
  width: 66px; height: 52px; box-shadow: none;
  -webkit-mask: radial-gradient(circle 3px, #0000 95%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle 3px, #0000 95%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) content-box;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}
/* "Arrived": a green check badge on the flag's corner */
.mark { position: absolute; display: none; pointer-events: none; }
.item.arrived .mark { display: block; }
.mark-check {
  right: -6px; top: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: #1b5e34; box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 0, 0, 0.2);
}
.mark-check svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.item.arrived.focus .mark { animation: stamp 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.6); } 100% { opacity: 1; } }


/* Send: the back of a postcard */
.send { background: #e8e1d3; padding: 96px 22px; }
.postcard {
  display: grid; grid-template-columns: 1.15fr 1fr; max-width: 860px; margin: 0 auto; text-align: left;
  background: #fbf8f1; border-radius: 6px; box-shadow: 0 20px 50px rgba(80, 60, 20, 0.18); transform: rotate(-0.6deg);
}
.hand { font-family: "Caveat", cursive; font-size: 27px; line-height: 1.25; color: #2b3a67; margin: 0 0 12px; }
.pc-message { padding: 44px 36px; border-right: 1.5px solid #d9cfbb; display: flex; flex-direction: column; }
.doodle {
  width: 150px; margin-top: auto; padding-top: 18px; overflow: visible; align-self: flex-end;
  fill: none; stroke: #2b3a67; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.doodle .accent { fill: #e8336d; stroke: #e8336d; }
.doodle .accent-fill { fill: #f6b8cb; }
.doodle[hidden] { display: none; }
.sign { margin-top: 18px; }
.pc-example-label { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #9a8f78; }
/* Example card notes: tip on hover (desktop) or tap (phone) */
.note { cursor: help; outline: none; }
.pc-message .hand { position: relative; } /* tips anchor to the line's start, so they never run off-screen */
.note .tip {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(300px, 100%);
  padding: 10px 13px; border-radius: 10px; background: #fff; color: var(--ink-2);
  font: 400 14px/1.45 var(--font); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.tip .heart { color: #e8336d; }
.note:hover .tip, .note:focus .tip, .note.open .tip { opacity: 1; transform: none; pointer-events: auto; }
.notes .note::before, .notes .note::after {
  content: attr(data-n); display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #e8336d; color: #fff; font: 700 11px var(--font); font-style: normal;
}
.notes .note::after { display: none; }
/* Numbers in the margin, faint dotted underline */
.notes-2 { padding-left: 52px; }
.notes-2 .note { border-bottom: 1.5px dotted rgba(232, 51, 109, 0.5); }
.notes-2 .note::before { position: absolute; left: -30px; margin-top: 9px; width: 18px; height: 18px; }
.pc-address { position: relative; padding: 44px 36px 36px; display: flex; flex-direction: column; }
.pc-stamp {
  align-self: flex-end; width: 76px; height: 90px; border: 2px dashed #b9ad94; color: #9a8f78;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.5;
}
.pc-lines { margin: 34px 0 30px; }
.pc-line { height: 48px; border-bottom: 1.5px solid #d9cfbb; display: flex; align-items: flex-end; padding-bottom: 4px; }
.pc-line .hand { margin: 0; font-size: 25px; text-decoration: none; word-break: break-all; }
.redact { display: inline-block; height: 18px; margin-bottom: 4px; background: #2b3a67; border-radius: 3px 6px 4px 7px; transform: rotate(-0.6deg); }
.pc-lines { position: relative; }
/* CONFIDENTIAL stamp: spans exactly from the line under "To: Maria" to the bottom line */
.pc-lines { --line: 48px; }
.rubber {
  position: absolute; left: 50%; top: calc(var(--line) - 0.75px); height: calc(var(--line) * 2);
  width: auto; transform: translateX(-50%); pointer-events: none; overflow: visible;
}
.pencil { color: #9a8f78 !important; font-size: 22px !important; }
.pc-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
/* Hand-drawn arrow pointing back at the button */
.point-arrow {
  width: 84px; height: 44px; margin-left: -8px; overflow: visible;
  fill: none; stroke: #e8336d; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.how-link {
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  font: 500 16px var(--font); color: #1f4e9c; border-bottom: 1.5px solid currentColor;
}
.how-link:hover { color: #c8102e; }

/* "How to mail it" popup: an airmail envelope */
.mail-dialog { border: 0; padding: 0; background: transparent; width: min(640px, 92vw); max-width: none; overflow: visible; }
.mail-dialog::backdrop { background: rgba(20, 28, 48, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mail-dialog[open] .envelope { animation: env-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes env-in { from { opacity: 0; transform: translateY(40px) rotate(-3deg) scale(0.96); } }
.envelope {
  position: relative; max-height: 88vh; max-height: 88svh; overflow: auto; scrollbar-width: none; padding: 56px 40px 40px; background: #fffdf7;
  border: 12px solid; border-image: repeating-linear-gradient(-45deg, #c8102e 0 18px, #fffdf7 18px 26px, #1f4e9c 26px 44px, #fffdf7 44px 52px) 12;
}
.envelope::-webkit-scrollbar { display: none; }
.envelope h2 { font-size: clamp(28px, 4.5vw, 40px); }
.env-label { margin: 0 0 12px; color: #1f4e9c; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.env-cancel { position: absolute; top: 34px; right: 58px; width: 130px; color: rgba(29, 29, 31, 0.35); transform: rotate(-6deg); }
.env-close {
  position: absolute; top: 12px; left: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 28px; line-height: 1; cursor: pointer;
}
.env-close:hover { background: #f1ede2; color: var(--ink); }
.env-intro { margin: 14px 0 12px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.env-subject { margin: 12px 0 0; }
.env-subject .heart { color: #e8336d; }
.env-email {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 12px 12px 18px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1.5px #1f4e9c inset;
}
.env-email-addr { font-size: 18px; font-weight: 600; color: #1f4e9c; word-break: break-all; user-select: all; }
.copy-btn {
  flex: none; border: 0; border-radius: 980px; padding: 9px 18px; cursor: pointer;
  background: #1f4e9c; color: #fff; font: 600 15px var(--font); transition: background 0.2s;
}
.copy-btn:hover { background: #173d7a; }
.copy-btn.copied { background: #1b5e34; }
.env-then { margin: 22px 0 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.env-tips { margin: 8px 0 0; padding: 0 0 0 20px; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.env-tips li { margin-bottom: 8px; }
.airmail-button {
  display: inline-block; padding: 13px 26px; font-size: 16px; font-weight: 600; color: #1f4e9c; text-decoration: none; background: #fff;
  border: 8px solid; border-image: repeating-linear-gradient(-45deg, #c8102e 0 10px, #fff 10px 16px, #1f4e9c 16px 26px, #fff 26px 32px) 8;
  transition: transform 0.2s;
}
.airmail-button:hover { transform: translateY(-2px) rotate(-1deg); }

.footer { text-align: center; color: var(--ink-4); font-size: 13px; padding: 32px 22px 48px; }

@media (max-width: 600px) {
  .lg-keys { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 2px 18px; }
  .lg-item { justify-content: flex-start; }
  .days-line { font-size: 18px; gap: 12px; }
  .dt-hand { font-size: 32px; }
  .dl-tilt { font-size: 36px; }
  .days-text small.sub-hand { font-size: 18px; }
  .days-text small { font-size: 15px; }
  :root { --row: 64px; }
  .hero { padding: 116px 16px; }
  .send { padding: 48px 12px; }
  .postcard { grid-template-columns: 1fr; transform: none; }
  .pc-message { padding: 26px 20px 14px 44px; border-right: 0; border-bottom: 1.5px solid #d9cfbb; }
  .notes-2 { padding-left: 44px; }
  .notes-2 .note::before { left: -28px; margin-top: 6px; width: 17px; height: 17px; }
  .pc-message .hand { font-size: 22px; margin-bottom: 8px; }
  .sign { margin-top: 10px; }
  .doodle { width: 104px; margin-top: -54px; padding-top: 0; } /* sits beside the signature */
  .pc-address { padding: 20px; }
  .pc-stamp { position: absolute; top: 20px; right: 20px; width: 56px; height: 66px; font-size: 9px; }
  .pc-lines { margin: 0 76px 22px 0; }
  .pc-line { height: 42px; }
  .pc-line .hand { font-size: 22px; }
  .pc-lines { --line: 42px; }
  .pc-actions { gap: 18px; }
  .envelope { padding: 72px 22px 24px; border-width: 9px; }
  .env-email { flex-wrap: nowrap; gap: 8px; padding: 10px 10px 10px 14px; }
  .env-email-addr { font-size: 15px; }
  .copy-btn { padding: 8px 14px; font-size: 14px; }
    .env-cancel { top: 26px; right: 44px; width: 100px; }
  .env-tips { font-size: 15px; }
  .bubble { left: 70px; }
  .strip { gap: 5px; }
  .stats { padding: 56px 16px 64px; }
  .item { gap: 12px; padding-left: 4px; }
  .flag { width: 44px; height: 33px; }
  .stamp-wrap { width: 54px; }
  .item.arrived .flag { width: 54px; height: 43px; }
  .pill { display: none; }
  .item.focus .pill { display: inline-block; }
  .item.focus .pill { position: absolute; right: 0; }
  .name { font-size: 24px; white-space: normal; line-height: 1.1; }
  .detail { white-space: normal; }
  .item.focus .detail { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pill.onway::after, .item.arrived.focus .mark { animation: none; }
}

@media (max-width: 600px) { .item { transform-origin: 4px 50%; } }
