/* Ticklist site. The app's own style: one warm dot-grid paper, one red tape, one
   blue-black ink, pencil grey for what is not lived yet. Colours are the app's colour
   sets (App/Assets.xcassets).

   The home page is a row of full-screen scenes: the list and the globe (paper), the
   bucket list over a photo of Kyoto (night), photos to map (paper), the paper plane
   (paper), the desk (wood), the promise (the navy cover), the form (paper).
   The other pages (privacy, support, blog, not found) are a column of text on the
   same paper, under the same header and over the same footer. */

@font-face { font-family: "Alegreya"; src: url("../fonts/Alegreya-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/Alegreya-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playpen Sans"; src: url("../fonts/PlaypenSans-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --paper: #FBF7EE;
  --paper-edge: #F1E9D8;
  --dot: #DCD2BD;
  --ink: #26303B;
  --ink-soft: #5C6470;
  --pencil: #7B808B;        /* lines, and words at heading size */
  --pencil-text: #6A6F7A;   /* the same pencil, a shade darker, so small words pass contrast */
  --tape: #D9472B;
  --stamp: #B93A20;
  --cover: #26303B;
  --photo-blank: #E7E4DD;
  --marker: #F2C94C;
  --slip: #FFFDF8;
  --night: #0E1620;
  --chalk: #F6F1E6;         /* words on a dark scene */
  --chalk-soft: rgba(246, 241, 230, 0.9);
  --ember: #FF7D5E;         /* the stamp's red, on a dark scene */

  --title: "Alegreya", Georgia, "Times New Roman", serif;
  --ui: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  --hand: "Playpen Sans", "Bradley Hand", "Segoe Print", cursive;

  --grid: 22px;             /* one square of the dot grid */
  /* the page's side margin; on a phone held sideways it also keeps clear of the notch */
  --edge: max(clamp(22px, 5.4vw, 84px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --dots: radial-gradient(circle at center, var(--dot) 1.2px, transparent 1.7px);
  --torn: polygon(0 0, 5px 12.5%, 0 25%, 5px 37.5%, 0 50%, 5px 62.5%, 0 75%, 5px 87.5%, 0 100%,
                  100% 100%, calc(100% - 5px) 87.5%, 100% 75%, calc(100% - 5px) 62.5%, 100% 50%,
                  calc(100% - 5px) 37.5%, 100% 25%, calc(100% - 5px) 12.5%, 100% 0);
  --lift: 0 1px 0 var(--paper-edge), 0 16px 20px -14px rgba(38, 48, 59, 0.55);   /* a slip of paper on the page */
}

*, *::before, *::after { box-sizing: border-box; }
/* "hidden" always wins, also over a display set further down (the form's states rely on it) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--dots);
  background-size: var(--grid) var(--grid);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.1875rem;
  line-height: 1.5;
  overflow-x: clip;
}

h1, h2, h3 { font-family: var(--title); font-weight: 700; line-height: 1.06; margin: 0; text-wrap: balance; }
p { margin: 0; }
img, svg { max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--stamp); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--marker); color: var(--ink); }

.skip { position: absolute; left: var(--edge); top: -80px; z-index: 9; padding: 10px 14px; background: var(--ink); color: var(--paper); }
.skip:focus { top: 10px; color: var(--paper); }

/* ---------- the header and the footer, the same on every page */

.top { display: flex; align-items: center; justify-content: space-between; padding: 22px var(--edge) 0; }
.home .top { position: absolute; z-index: 6; left: 0; right: 0; top: 0; }     /* it lies over the first scene */
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-family: var(--title); font-weight: 700; font-size: 1.625rem; line-height: 1; }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 10px; display: block; }
.top__nav { display: flex; gap: 12px; font-size: 1.0625rem; }
.top__nav a { padding: 3px 10px; background: var(--paper); border-radius: 3px; }

.foot { margin-top: 96px; padding: 28px var(--edge) 44px; border-top: 1.5px solid var(--ink); font-size: 1.0625rem; }
.home .foot { margin-top: 0; }
.foot__name { font-family: var(--title); font-weight: 700; font-size: 1.1875rem; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.foot__nav a { overflow-wrap: anywhere; }
.foot__fine { margin-top: 18px; font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- the one button: a piece of the red tape. White on the tape passes contrast
   only as large bold text, so the words stay bold and 20px. */

.tape-button {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px;
  font-family: var(--ui); font-weight: 700; font-size: 1.25rem; line-height: 1.1;
  color: #fff; background: none; border: 0; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tape-button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--tape); clip-path: var(--torn); transition: background-color 0.15s; }
.tape-button:hover::before { background: var(--stamp); }
.tape-button:hover { color: #fff; }
.tape-button:active { transform: translateY(1px); }
.tape-button[disabled] { cursor: progress; }
.tape-button[disabled]::before { background: var(--stamp); }

/* ---------- the waiting list form */

.notify { margin-top: 24px; max-width: 37rem; text-align: left; }
.notify__label { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.notify__row { display: grid; gap: 12px; }
.notify__input {
  width: 100%; height: 56px; padding: 0 16px;
  font: inherit; font-size: 1.1875rem; color: var(--ink);
  background: var(--slip); border: 1.5px solid var(--ink); border-radius: 3px;
  box-shadow: 0 2px 0 rgba(38, 48, 59, 0.1);
}
.notify__input::placeholder { color: var(--pencil-text); opacity: 1; }
.notify__input:focus-visible { outline-offset: 2px; }
.notify__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notify__note { margin-top: 12px; font-size: 1rem; line-height: 1.4; color: var(--ink-soft); }
.notify__error { margin-top: 12px; font-weight: 700; font-size: 1.0625rem; color: var(--stamp); }
.notify__done { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 4px 0; }
.notify__done:focus { outline: none; }
.notify__thanks { font-family: var(--title); font-weight: 700; font-size: 1.75rem; line-height: 1.1; }
.notify__next { margin-top: 6px; }
.notify__dry { margin-top: 10px; font-size: 1rem; background: rgba(242, 201, 76, 0.5); padding: 4px 8px; display: inline-block; }
.notify__tick .box-line { stroke: var(--ink); }
.notify__tick .tick-line { stroke: var(--ink); stroke-dashoffset: 0; }
.notify__done.is-fresh .tick-line { animation: draw 0.45s 0.1s ease-out backwards; }
/* after the thank-you: pass the page on (the phone's share sheet, or copy the link) */
.notify__share { margin-top: 18px; }
.notify__copied { margin-top: 10px; font-family: var(--hand); font-weight: 500; font-size: 1rem; color: var(--stamp); }
.notify__link { margin-top: 12px; font-size: 1rem; }

/* a hand-drawn box and its tick (the form's thank-you, the list beside the globe) */
.box-line, .tick-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.box-line { stroke: var(--pencil); stroke-width: 1.7; }
.tick-line { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 34; stroke-dashoffset: 34; }
@keyframes draw { from { stroke-dashoffset: 34; } to { stroke-dashoffset: 0; } }

/* ---------- App Store button (live mode). Placeholder artwork, see README. */

.get { margin-top: 28px; max-width: 37rem; }
.store-link { display: inline-block; text-decoration: none; border-radius: 12px; }
.store-badge { display: inline-flex; flex-direction: column; justify-content: center; min-width: 204px; height: 64px; padding: 0 24px; border-radius: 12px; background: var(--ink); color: #fff; line-height: 1; }
.store-link:hover .store-badge { background: #151c24; }
.store-badge-img { display: block; width: 180px; height: 60px; }
.get__row { display: flex; align-items: center; gap: 22px; }
.words--over .get, .closing .get { margin-left: auto; margin-right: auto; }
.words--over .get__row, .closing .get__row { justify-content: center; }
.qr-slip, .get__or { display: none; }
/* The QR is for a computer (a pointer, a wide screen): after the badge, "or", then a slip of paper taped to the page,
   the code on the left and two short lines on the right, its middle level with the badge's. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .get__or { display: block; font-style: italic; font-size: 1.0625rem; color: var(--ink-soft); }
  .qr-slip { display: flex; align-items: center; gap: 12px; position: relative; margin: 0; padding: 9px 16px 9px 9px; background: var(--slip); border-radius: 2px; box-shadow: var(--lift); }
  .qr-slip::before { content: ""; position: absolute; left: 50%; top: -8px; width: 44px; height: 15px; margin-left: -22px; background: var(--tape); opacity: 0.94; clip-path: var(--torn); transform: rotate(-3deg); }
  .qr-slip img { display: block; flex: none; width: 72px; height: 72px; }
  .qr-slip figcaption { text-align: left; font-size: 0.9375rem; line-height: 1.3; color: var(--ink-soft); }
  .qr-slip figcaption strong { display: block; font-weight: 600; color: var(--ink); }
}
.store-link:hover .store-badge-img { opacity: 0.86; }
.store-badge__small { font-size: 0.875rem; letter-spacing: 0.01em; }
.store-badge__big { font-weight: 700; font-size: 1.75rem; margin-top: 2px; }
.get__note { margin-top: 14px; font-size: 1rem; line-height: 1.4; color: var(--ink-soft); }

/* ---------- a scene: one full screen of the home page */

.scene {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; align-content: center;
  min-height: 100vh; min-height: 100svh; padding: 88px var(--edge);
}
.scene h2 { font-size: clamp(2.5rem, 10.4vw, 3.5rem); line-height: 1; letter-spacing: -0.015em; }
/* words beside phones (the plane, the desk) */
.scene__in { display: grid; gap: 44px; align-items: center; justify-items: center; width: 100%; max-width: 1240px; margin: 0 auto; }
.words { justify-self: start; max-width: 34rem; }
.words p, .line { margin-top: 14px; font-family: var(--title); font-style: italic; font-size: 1.3125rem; line-height: 1.3; color: var(--ink-soft); }
.words p { max-width: 21em; }
/* words centred over two phones (the bucket list, photos to map) */
.words--over { justify-self: center; max-width: 46rem; text-align: center; }
.words--over h2 { font-size: clamp(2rem, 9.6vw, 3.5rem); }       /* its halves do not break, so it is a little smaller on a narrow phone */
.words--over h2 span { white-space: nowrap; }       /* the title only breaks between its halves */
.words--over p { margin-left: auto; margin-right: auto; max-width: 30em; }

/* things come in as the page is scrolled (only when the script runs) */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.6s ease-out, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- the phone: a modern iPhone drawn here. Thin even bezel, a titanium edge,
   round corners. Everything is counted from --w, the phone's width, so it keeps its
   shape at any size. The screen has the exact shape of the screenshots (1206 x 2622). */

.stage { --w: min(70vw, 300px); position: relative; display: flex; justify-content: center; align-items: flex-start; }
.phone {
  position: relative; z-index: 2; flex: none;
  width: var(--w); padding: calc(var(--w) * 0.03);
  border-radius: calc(var(--w) * 0.17);
  background: #0c0f13;
  box-shadow:
    inset 0 0 0 calc(var(--w) * 0.0065) #9a9fa6,
    inset 0 0 0 calc(var(--w) * 0.012) #353b43,
    0 calc(var(--w) * 0.16) calc(var(--w) * 0.17) calc(var(--w) * -0.11) rgba(38, 48, 59, 0.6),
    0 calc(var(--w) * 0.02) calc(var(--w) * 0.05) rgba(38, 48, 59, 0.22);
  transform: rotate(var(--tilt, 0deg));
}
/* side buttons: volume on the left, power on the right */
.phone::before, .phone::after { content: ""; position: absolute; width: calc(var(--w) * 0.011); background: #6d737b; }
.phone::before { left: calc(var(--w) * -0.009); top: calc(var(--w) * 0.5); height: calc(var(--w) * 0.15); border-radius: 2px 0 0 2px; box-shadow: 0 calc(var(--w) * 0.19) 0 #6d737b; }
.phone::after { right: calc(var(--w) * -0.009); top: calc(var(--w) * 0.6); height: calc(var(--w) * 0.25); border-radius: 0 2px 2px 0; }
.phone__screen { position: relative; overflow: hidden; aspect-ratio: 1206 / 2622; border-radius: calc(var(--w) * 0.14); background: var(--paper); }
.phone__screen > img, .phone__clip { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* a clip lies over its still picture and shows only once it has a frame to show */
.phone__clip { opacity: 0; }
.phone__clip.is-ready { opacity: 1; }
/* the Dynamic Island, exactly over the one in the screenshots, so a clip has it too */
.phone__screen::after { content: ""; position: absolute; top: 1.55%; left: 34.2%; width: 31.6%; height: 4.26%; border-radius: 99px; background: #000; }

/* two phones in one scene: on a phone only the front one (the desk keeps both, one
   under the other); from 700px up side by side, a little over each other */
.stage .phone--back { z-index: 1; }
.stage--duo { flex-direction: column; align-items: center; gap: calc(var(--w) * 0.12); }
.stage--duo .phone--back { display: none; }
.stage--stack .phone--back { display: block; }
.stage--stack .phone:not(.phone--back) { --w: min(52vw, 232px); }

/* ---------- scene 1: the list and the globe */

.hero { display: block; align-content: start; padding: 0; min-height: max(100svh, 700px); }
.hero__words { position: relative; z-index: 3; padding: 84px var(--edge) 0; }
.hero h1 { font-size: clamp(2.625rem, 11.6vw, 4.25rem); line-height: 0.98; letter-spacing: -0.02em; text-wrap: wrap; }
.hero h1 span { display: block; text-wrap: balance; }
.in-pencil { color: var(--pencil); }
.hero .line { margin-top: 12px; max-width: 21em; font-size: 1.1875rem; line-height: 1.28; }
.hero .get { margin-top: 22px; }
/* the form on the first screen: one short row (address, button), its label kept for screen readers */
.notify--top { margin-top: 22px; max-width: 27rem; }
.notify--top .notify__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.notify--top .notify__row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.notify--top .notify__input { height: 52px; padding: 0 14px; font-size: 1.0625rem; }
.notify--top .notify__row .tape-button { min-height: 52px; padding: 0 20px; font-size: 1.125rem; white-space: nowrap; }
.notify--top .notify__note { margin-top: 9px; font-family: var(--title); font-style: italic; font-size: 0.9375rem; line-height: 1.3; }
.notify--top .notify__thanks { font-size: 1.5rem; }
.notify--top .notify__share { margin-top: 14px; min-height: 48px; padding: 0 22px; font-size: 1.0625rem; }

/* The list: a slip of the notebook, one line per print on the globe. The script ticks
   each line as its photo lands. --rows: how many lines show at once.
   Not on a phone: there the first screen is only the words, the button and the globe. */
.wishes {
  --row: 2.25rem; --rows: 2;
  display: none; position: relative; max-width: 25rem; margin-top: 24px; padding: 13px 16px 9px;
  background: var(--slip); box-shadow: var(--lift);
  transform: rotate(-0.8deg);
}
.wishes::before { content: ""; position: absolute; left: 50%; top: -11px; width: 74px; height: 22px; margin-left: -37px; background: var(--tape); opacity: 0.94; clip-path: var(--torn); transform: rotate(-3deg); }
.wishes__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; line-height: 1.1; }
.wishes__head b { font-family: var(--title); font-size: 1.375rem; }
.wishes__head span { font-family: var(--title); font-style: italic; font-size: 1.0625rem; color: var(--ink-soft); }
.wishes__window { height: calc(var(--row) * var(--rows)); margin-top: 5px; overflow: hidden; }
.wishes__lines { list-style: none; margin: 0; padding: 0; transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.wishes__lines li { display: flex; align-items: center; gap: 10px; height: var(--row); white-space: nowrap; font-family: var(--hand); font-weight: 500; font-size: clamp(0.9375rem, 4.5vw, 1.0625rem); color: var(--pencil-text); transition: color 0.35s; }
.wishes__lines svg { flex: none; width: 25px; height: 23px; overflow: visible; }
.wishes__lines span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wishes__lines .is-lived { color: var(--ink); }
.wishes__lines .is-lived .box-line { stroke: var(--ink); }
.wishes__lines .is-lived .tick-line { stroke-dashoffset: 0; transition: stroke-dashoffset 0.4s ease-out; }

/* The globe is a square; the canvas draws the ball a little smaller than it, so the
   plane has room to fly above the edge. On a phone the ball is wider than the screen
   and only its top shows (the rest hangs below the scene); on a wide screen all of it
   shows. --look-*: how far from the middle of the ball the place being visited is
   shown (the script reads them). */
.globe {
  --d: 168vw; --print: clamp(50px, 14.5vw, 64px); --look-lat: 36; --look-lon: 0;
  position: relative; z-index: 1; left: 50%; width: var(--d); height: var(--d); margin: 30px 0 calc(var(--d) * -0.62) calc(var(--d) / -2);
  touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none;
}
.globe.is-held { cursor: grabbing; }
.globe__map { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.globe__prints { position: absolute; inset: 0; pointer-events: none; }

.print { position: absolute; left: 0; top: 0; width: var(--print); margin: calc(var(--print) * -0.62) 0 0 calc(var(--print) / -2); opacity: 0; will-change: transform, opacity; }
.print__in { position: relative; padding: 6% 6% 0; background: var(--slip); border-radius: 2px; box-shadow: 0 1px 0 rgba(38, 48, 59, 0.14), 0 9px 14px -5px rgba(38, 48, 59, 0.5); opacity: 0; transition: opacity 0.5s; }
.print.is-on .print__in { opacity: 1; }
.print__in::before { content: ""; position: absolute; left: 29%; right: 29%; top: -7%; height: 14%; background: var(--tape); opacity: 0.94; transform: rotate(-4deg); }
.print img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.print figcaption { padding: 7% 0 9%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; font-family: var(--hand); font-weight: 500; font-size: calc(var(--print) * 0.1); line-height: 1; color: var(--ink-soft); }

/* the words come up once, when the page opens */
.hero h1 span, .hero .line, .hero .notify, .hero .get, .wishes { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
/* the headline is readable from the first paint: it only moves, it does not fade in */
.hero h1 span { animation-name: rise-shown; animation-duration: 0.7s; }
.hero h1 span + span { animation-delay: 0.08s; }
.hero .line { animation-delay: 0.24s; }
.hero .notify, .hero .get { animation-delay: 0.32s; }
.wishes { animation-name: rise-slip; animation-delay: 0.2s; }
.globe { animation: come 1.2s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes rise-shown { from { transform: translateY(18px); } }
@keyframes rise-slip { from { opacity: 0; transform: translateY(26px) rotate(-0.8deg); } }
@keyframes come { from { opacity: 0; transform: translateY(6%) scale(0.95); } }

/* ---------- scene 2: the bucket list. One dream twice, still in pencil and lived,
   over a photo of Kyoto. */

.dream { justify-items: center; background: var(--night); color: var(--chalk); }
.sky { position: absolute; inset: -9% 0; z-index: -2; display: block; transform: translate3d(0, calc((var(--p, 0.5) - 0.5) * 12%), 0); will-change: transform; }
.sky img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.dream::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14, 22, 32, 0.9), rgba(14, 22, 32, 0.7) 38%, rgba(14, 22, 32, 0.5) 72%, rgba(14, 22, 32, 0.78)); }
.dream .words p { color: var(--chalk-soft); }
.dream .phone { box-shadow: inset 0 0 0 calc(var(--w) * 0.0065) #9a9fa6, inset 0 0 0 calc(var(--w) * 0.012) #353b43, 0 calc(var(--w) * 0.2) calc(var(--w) * 0.24) calc(var(--w) * -0.1) rgba(0, 0, 0, 0.85); }
.dream :focus-visible { outline-color: var(--chalk); }

/* two phones side by side with an arrow between them (here, and in scene 3) */
.pair { --between: 30px; --gap: 6px; display: grid; grid-template-columns: auto auto auto; justify-content: center; align-items: start; column-gap: var(--gap); width: 100%; margin-top: 32px; }
/* each phone takes half of what the screen leaves beside the margins, the arrow and the gaps */
.pair .stage { --w: min(calc((100vw - 2 * var(--edge) - var(--between) - 2 * var(--gap)) / 2), 290px); flex-direction: column; align-items: center; width: var(--w); min-width: 0; }
.pair__between { align-self: center; width: var(--between); margin-bottom: 40px; text-align: center; font-family: var(--hand); font-weight: 500; line-height: 1.1; color: currentColor; }
.pair__between span { display: none; }
.pair__between svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pair__between path { vector-effect: non-scaling-stroke; }
.pair__under { margin-top: 14px; font-family: var(--hand); font-weight: 500; font-size: 1.0625rem; line-height: 1.2; color: var(--pencil-text); }
.dream .pair__under { color: #C3C8D2; }

/* the red date stamp */
.stamp {
  display: inline-block; margin-top: 12px; padding: 5px 9px 2px;
  border: 2.5px solid currentColor; border-radius: 5px; outline: 1px solid currentColor; outline-offset: 2px;
  color: var(--stamp); font-weight: 700; font-size: clamp(0.6875rem, 3.3vw, 0.8125rem); line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  transform: rotate(-4deg);
}
.dream .stamp { color: var(--ember); }
.js .stamp.reveal { transform: rotate(-4deg) scale(1.7); transition: opacity 0.12s 0.5s, transform 0.2s 0.5s cubic-bezier(0.3, 1.4, 0.6, 1); }
.js .stamp.reveal.is-in { transform: rotate(-4deg); }

/* ---------- scene 3: photos to map. The photo library in one phone, the app's map in
   the other; the script picks the marked photos and flies them across. */

.roll { justify-items: center; }
.roll__scene { position: relative; grid-template-areas: "photos between phone" "tally tally tally"; margin-top: 30px; }
.roll .stage--photos { grid-area: photos; }
.roll .pair__between { grid-area: between; margin-bottom: 34px; }
.roll .stage--roll { grid-area: phone; }
.roll__safe { margin-top: 18px; font-size: 1rem; line-height: 1.4; color: var(--ink-soft); text-align: center; }

/* the photo library: a plain grid of square photos, as on any phone */
.photos { background: #fff; }
.photos__bar { position: absolute; left: 0; right: 0; top: 0; height: 15.6%; padding: 0 6% 2.6%; display: flex; align-items: flex-end; justify-content: space-between; font-family: var(--ui); line-height: 1; color: #15181c; }
.photos__bar b { font-size: calc(var(--w) * 0.105); letter-spacing: -0.01em; }
.photos__bar span { font-size: calc(var(--w) * 0.05); color: #70757c; }
.camroll__card { position: absolute; left: 0; right: 0; top: 16.6%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5px; }
.camroll__tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--photo-blank); }
.camroll__tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.22s ease-out, filter 0.22s; }
/* a photo that was chosen: pressed in a little, with a tick, like a selected photo */
.camroll__tile.is-picked img { transform: scale(0.84); filter: brightness(0.88); }
.camroll__tile::after {
  content: ""; position: absolute; right: 5%; bottom: 5%; width: 34%; height: 34%; max-width: 22px; max-height: 22px; border-radius: 50%;
  background: var(--tape) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.4 3.4L15 7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  box-shadow: 0 0 0 1.5px #fff;
  transform: scale(0); transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.6, 1);
}
.camroll__tile.is-picked::after { transform: scale(1); }

/* a photo on its way: a small print with a piece of the tape, like the ones on the map */
.camroll__fly {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  background: var(--slip); border-radius: 2px;
  box-shadow: 0 0 0 3px var(--slip), 0 10px 18px -4px rgba(38, 48, 59, 0.5);
  will-change: transform, opacity;
}
.camroll__fly img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.camroll__fly::before { content: ""; position: absolute; left: 26%; right: 26%; top: -10%; height: 17%; background: var(--tape); opacity: 0.94; transform: rotate(-4deg); }

/* the count, written by hand: it climbs with the map */
.tally { grid-area: tally; display: flex; justify-content: center; gap: 22px; margin: 26px 0 0; font-family: var(--hand); font-weight: 500; font-size: 1.0625rem; line-height: 1; color: var(--pencil-text); }
.tally span { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.tally b { display: inline-block; min-width: 1.2em; text-align: right; font-weight: 500; font-size: 2.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- scene 4: the paper plane crosses its scene by itself */

/* the air the plane flies in: on a phone the top of the scene (behind the words, never
   over the phone), on a wide screen all of it; the plane passes behind the phones */
.plane__air { position: absolute; left: 0; right: 0; top: 0; height: 430px; z-index: -1; }
.plane__sky { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }
.plane__trail { fill: none; stroke: var(--pencil); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 9; vector-effect: non-scaling-stroke; }
/* What uncovers the trail behind the plane. No "non-scaling-stroke" here: with it the dash
   is measured on the screen, not along the path, and the trail runs ahead of the plane. */
.plane__flown { fill: none; stroke: #fff; stroke-width: 60; stroke-dasharray: 1; stroke-dashoffset: 1; }
.plane__craft { position: absolute; left: 0; top: 0; width: 44px; height: 38px; margin: -19px 0 0 -22px; display: none; fill: var(--ink); overflow: visible; filter: drop-shadow(0 10px 6px rgba(38, 48, 59, 0.28)); will-change: transform; }
.plane__fold { fill: none; stroke: var(--paper); stroke-width: 1.6; }
.js-flight .plane__craft { display: block; }
.plane .words p, .plane .words h2 { text-shadow: 0 0 14px var(--paper), 0 0 6px var(--paper); }

/* ---------- scene 5: the desk */

.wood {
  background-color: #C9A56E;
  background-image:
    radial-gradient(120% 90% at 22% 8%, rgba(255, 240, 205, 0.5), transparent 60%),
    repeating-linear-gradient(91deg, rgba(104, 66, 22, 0.085) 0 2px, transparent 2px 7px, rgba(104, 66, 22, 0.05) 7px 8px, transparent 8px 19px),
    linear-gradient(180deg, #D1AE78, #BE975E);
}
.wood .words p { color: #3A4048; }

/* ---------- scene 6: the promise, on the navy cover */

.vow { min-height: 78svh; background: var(--cover); color: var(--chalk); text-align: center; }
.vow__in { max-width: 62rem; margin: 0 auto; }
.vow h2 { font-size: clamp(2.75rem, 12vw, 4.25rem); line-height: 0.98; letter-spacing: -0.02em; }
.vow p { margin-top: 22px; font-size: 1.25rem; color: rgba(246, 241, 230, 0.86); }
.vow .vow__link { margin-top: 4px; font-size: 1.0625rem; }
.vow__link a { display: inline-block; padding: 8px 12px; }      /* room for a finger */
.vow a:hover { color: var(--ember); }
.vow :focus-visible { outline-color: var(--chalk); }

/* ---------- how it works (live): a real sequence, so it is numbered */

.how { min-height: 0; padding-bottom: 20px; }      /* a short scene: only as tall as its three steps */
.how__in { width: 100%; max-width: 1240px; margin: 0 auto; }
.steps { list-style: none; margin: 34px 0 0; padding: 0; counter-reset: step; display: grid; gap: 38px; }
.steps li { counter-increment: step; position: relative; padding-left: 58px; max-width: 30em; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -9px; font-family: var(--title); font-weight: 700; font-size: 3.25rem; line-height: 1; color: var(--pencil); }
.steps h3 { font-size: 1.5rem; }
.steps p { margin-top: 8px; }

/* ---------- the last scene: the form, or the App Store button */

.closing { min-height: 82svh; scroll-margin-top: 0; }
.closing__in { width: 100%; max-width: 40rem; margin: 0 auto; }

/* ---------- text pages: privacy, support, blog */

.prose { max-width: calc(44rem + 2 * var(--edge)); margin: 0 auto; padding: 60px var(--edge) 0; }
.prose h1 { font-size: clamp(2.75rem, 11vw, 4.5rem); line-height: 0.98; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.875rem; margin-top: 60px; scroll-margin-top: 20px; }
.prose h3 { font-size: 1.375rem; margin-top: 32px; scroll-margin-top: 20px; }
.prose p, .prose ul, .prose ol { margin-top: 16px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-top: 8px; padding-left: 0.2em; }
.prose li::marker { color: var(--pencil-text); }
.prose h1 + p { margin-top: 20px; font-family: var(--title); font-style: italic; font-size: 1.375rem; line-height: 1.35; color: var(--ink-soft); }
.prose .dated { color: var(--ink-soft); }
/* what matters most, on a slip of paper taped to the page */
.prose .short, .prose .mail { position: relative; margin-top: 44px; padding: 26px 24px 26px; background: var(--slip); box-shadow: var(--lift); transform: rotate(-0.4deg); }
.prose .short::before, .prose .mail::before { content: ""; position: absolute; left: 50%; top: -12px; width: 96px; height: 26px; margin-left: -48px; background: var(--tape); opacity: 0.94; clip-path: var(--torn); transform: rotate(-3deg); }
.prose .short h2 { margin-top: 0; font-size: 1.625rem; }
.prose .mail { font-family: var(--title); font-weight: 700; font-size: clamp(1.375rem, 6.2vw, 2.25rem); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.prose table { border-collapse: collapse; margin-top: 18px; width: 100%; font-size: 1.0625rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--dot); }
.prose th { font-weight: 700; }

/* a note to the owner that must be settled before the page goes public */
.tocheck { margin-top: 16px; padding: 10px 14px; background: rgba(242, 201, 76, 0.42); border-left: 5px solid var(--marker); font-size: 1.0625rem; line-height: 1.45; }
.tocheck strong { letter-spacing: 0.04em; }

.posts { list-style: none; padding: 0; }
.posts li { margin-top: 30px; padding: 0; }
.posts a { font-family: var(--title); font-weight: 700; font-size: 1.5rem; line-height: 1.15; }
.posts time { display: block; margin-top: 4px; font-family: var(--title); font-style: italic; color: var(--ink-soft); }
.posts p { margin-top: 6px; }

/* the page that is not there: one screen, like a scene */
.lost { display: grid; align-content: center; justify-items: start; min-height: calc(100svh - 240px); max-width: calc(46rem + 2 * var(--edge)); margin: 0 auto; padding: 60px var(--edge) 0; }
.lost h1 { font-size: clamp(2.75rem, 11.6vw, 5.5rem); line-height: 0.98; letter-spacing: -0.02em; color: var(--pencil); }
.lost p { margin-top: 20px; font-family: var(--title); font-style: italic; font-size: 1.375rem; color: var(--ink-soft); }
.lost .tape-button { margin-top: 30px; }

/* ---------- wider than a phone */

@media (min-width: 700px) {
  .notify__row { grid-template-columns: 1fr auto; }
  .foot { display: grid; grid-template-columns: 1fr auto; column-gap: 40px; }
  .foot__nav { margin-top: 2px; }
  .foot__fine { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 44px; }
  .prose .short, .prose .mail { padding: 34px 36px 32px; }

  .globe { --d: 124vw; --print: 70px; margin-bottom: calc(var(--d) * -0.56); }
  .hero h1 { font-size: clamp(3.5rem, 8.4vw, 5rem); }
  .hero .line { font-size: 1.4375rem; }
  .wishes { display: block; --rows: 3; }

  .pair { --between: clamp(128px, 14vw, 170px); --gap: 22px; }
  .pair__between { font-size: 1.125rem; }
  .pair__between span { display: block; margin-bottom: 8px; white-space: nowrap; }

  /* two phones side by side, a little over each other */
  .stage--duo { --w: min(27vw, 250px); flex-direction: row; align-items: flex-start; justify-content: center; gap: 0; }
  .stage--duo .phone { --tilt: 2.4deg; margin-top: calc(var(--w) * 0.3); }
  .stage--duo .phone + .phone { margin-left: calc(var(--w) * -0.14); }
  .stage--duo .phone--back { display: block; --tilt: -4deg; margin-top: 0; }
  .stage--stack .phone:not(.phone--back) { --w: inherit; }
}

@media (min-width: 960px) {
  body { font-size: 1.3125rem; }
  .top { padding-top: 34px; }
  .top__nav, .foot { font-size: 1.125rem; }
  .notify__note, .get__note { font-size: 1.0625rem; }

  .scene { padding-top: 96px; padding-bottom: 96px; }
  .scene h2 { font-size: clamp(3.5rem, 5.4vw, 5.75rem); }
  .words--over h2 { font-size: clamp(3.25rem, 4.6vw, 5rem); }
  .words--over { max-width: none; }
  .words p, .line { font-size: 1.625rem; }
  .words--over p { font-size: 1.5rem; margin-top: 16px; }
  .scene__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
  .scene__in--flip .words { order: 2; }
  .stage { --w: min(25vw, 330px, calc((100svh - 200px) / 2.2)); }
  .stage--duo { --w: min(19vw, 270px, calc((100svh - 240px) / 2.65)); }

  .hero { display: grid; align-content: center; min-height: max(100svh, 840px); }
  .hero__words { padding: 84px 0 30px var(--edge); max-width: calc(var(--edge) + min(35rem, 40vw)); }
  .hero h1 { font-size: clamp(3.5rem, 5.3vw, 6rem); }
  .hero .line { margin-top: 20px; font-size: 1.5rem; max-width: 19em; }
  .notify--top { margin-top: 26px; }
  .notify--top .notify__input { height: 56px; font-size: 1.1875rem; }
  .notify--top .notify__row .tape-button { min-height: 56px; padding: 0 26px; font-size: 1.25rem; }
  .notify--top .notify__note { margin-top: 11px; font-size: 1.0625rem; }
  .wishes { --row: 2.5rem; --rows: 4; max-width: 27rem; margin-top: 34px; padding: 16px 20px 11px; }
  .wishes__head b { font-size: 1.5rem; }
  .wishes__lines li { font-size: 1.1875rem; }
  /* the whole ball, on the right of the screen */
  .globe {
    --d: min(88svh, 52vw, 940px); --print: clamp(70px, 5.8vw, 98px); --look-lat: 9; --look-lon: 0;
    position: absolute; left: auto; right: max(2vw, calc((100vw - 1560px) / 2)); top: 50%; margin: calc(var(--d) * -0.48) 0 0;
  }

  .pair { margin-top: 44px; }
  .pair .stage { --w: min(24vw, 310px, calc((100svh - 420px) / 2.2), calc((100vw - 2 * var(--edge) - var(--between) - 2 * var(--gap)) / 2)); }
  .roll .pair .stage { --w: min(24vw, 320px, calc((100svh - 390px) / 2.2), calc((100vw - 2 * var(--edge) - var(--between) - 2 * var(--gap)) / 2)); }
  .roll__scene { margin-top: 40px; }
  .pair__under { font-size: 1.25rem; }
  .stamp { font-size: 1rem; padding: 6px 12px 3px; }
  .roll__safe { font-size: 1.0625rem; margin-top: 26px; }
  .tally { font-size: 1.25rem; gap: 28px; }
  .tally b { font-size: 2.75rem; }
  .dream::after { background: linear-gradient(180deg, rgba(14, 22, 32, 0.88), rgba(14, 22, 32, 0.66) 40%, rgba(14, 22, 32, 0.6)); }

  .plane__air { height: auto; bottom: 0; }
  .plane__craft { width: 66px; height: 57px; margin: -28px 0 0 -33px; }

  .vow h2 { font-size: clamp(4.5rem, 8.2vw, 9rem); }
  .vow p { font-size: 1.5rem; margin-top: 30px; }
  .vow .vow__link { font-size: 1.1875rem; }
  .closing h2, .closing .get { text-align: center; }

  .prose { padding-top: 84px; }
  .prose h1 + p { font-size: 1.625rem; }
  .foot { margin-top: 132px; }
}

/* a phone held sideways: the globe goes beside the words, as on a wide screen */
@media (min-width: 700px) and (max-width: 959.98px) and (max-height: 520px) {
  .hero { display: grid; align-content: start; min-height: max(100svh, 460px); }
  .hero__words { max-width: 56%; padding-top: 72px; padding-bottom: 20px; }
  .hero h1 { font-size: 2.625rem; }
  .hero .line { font-size: 1.0625rem; }
  .notify--top { margin-top: 16px; max-width: 21rem; }
  .wishes { display: none; }
  .globe {
    --d: min(120svh, 46vw); --print: 54px; --look-lat: 9; --look-lon: 0;
    position: absolute; left: auto; right: var(--edge); top: 50%; margin: calc(var(--d) * -0.44) 0 0;
  }
}

/* a wide but low window (a small laptop): the first scene is tightened so that the
   list stays on the first screen */
@media (min-width: 960px) and (max-height: 830px) {
  .hero { min-height: max(100svh, 640px); }
  .hero__words { padding-top: 78px; padding-bottom: 24px; }
  .hero h1 { font-size: clamp(3rem, 4.5vw, 4.5rem); }
  .hero .line { margin-top: 16px; font-size: 1.375rem; }
  .notify--top { margin-top: 20px; }
  .wishes { --row: 2.3rem; --rows: 3; margin-top: 26px; padding: 14px 18px 9px; }
}
/* and the two phones of a pair stay on one screen */
@media (min-width: 960px) and (max-height: 700px) {
  .pair .stage, .roll .pair .stage { --w: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
}

@media print {
  body { background: #fff; }
  .scene { min-height: 0; }
  .globe, .sky, .plane__air, .tape-button, .notify, .get { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
