/* =====================================================================
   Willa Fenn · Folk v2
   Plain CSS, no build step. Sections:
   1. Settings (colors, fonts, motion)   2. Base   3. Shared pieces
   4. Menu   5. Phone layout (drawn on the 390 frame, scaled by --u)
   6. Desktop layout (1024 px and up, drawn on the 1440 frame, scaled by --u)
   7. Animations
   Pieces are placed with numbers from the design: --x and --y (top left
   corner), sizes and --r (angle), in design pixels. One design pixel = --u.
   ===================================================================== */

/* Fonts, loaded from the fonts folder (see README to load them from Google instead) */
@font-face { font-family: "Caveat"; src: url("../../fonts/caveat-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("../../fonts/special-elite-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ---------- 1. Settings. EDIT: colors, fonts and motion live here. */
:root {
  --paper: #efe4c4;      /* notebook paper */
  --card: #f8f1dc;       /* polaroids, postcards, envelope, button text */
  --ink: #2a2118;        /* handwriting and type */
  --rust: #b4532a;       /* margin line, cities, underline, postcard band */
  --rust-deep: #a84d27;  /* buttons with small text (5:1 with the card color) */
  --green: #5b6b2e;      /* tickets buttons, binder holes */
  --forest: #2f4a35;     /* footer */
  --blue: #8fb8c9;       /* notebook rules, postcard band, airmail, footer small print */
  --photo-hint: #f8f1dc; /* "replace with photo" text on the empty photo spots */
  --photo-top: #7fa4a9;  /* empty photo spots: gradient until a photo is added */
  --photo-bottom: #2f4a35;
  --shadow: drop-shadow(0 calc(10 * var(--u)) calc(9 * var(--u)) rgb(0 0 0 / .28));
  --focus: #2a2118;

  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-type: "Special Elite", "Courier New", monospace;

  /* Motion. Durations in ms, distances in design pixels. */
  --motion-dur: 900ms;          /* pieces coming in */
  --motion-step: 120ms;         /* delay between pieces that come into view together */
  --motion-rise: 22;            /* how far text rises while it fades in */
  --motion-pin: 6deg;           /* how much a photo, card or stamp turns while it is pinned down */
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
  --motion-settle: cubic-bezier(.3, 1.35, .5, 1);

  --nav-h-compact: 56px;        /* height of the slim menu bar after scrolling (phones) */

  /* --u: one design pixel. Phones: the 390 frame, up to 430 px wide. */
  --W: 390;
  --u: calc(min(100cqi, 430px) / 390);
}

/* ---------- 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--font-type); overflow-x: clip; }
/* the scale units (cqi) are measured on these boxes, not on <body>: a container on <body>
   would make Firefox scroll the fixed menu bar away with the page */
main, footer, .topbar { container-type: inline-size; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: none; }
button, input, textarea { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 6px; background: var(--ink); color: var(--card); font: 400 15px/1.2 var(--font-type); text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.footer, .btn { --focus: var(--card); }
.footer a:focus-visible { outline-color: var(--card); }
.btn:focus-visible { outline-color: var(--ink); }

/* Sections: each one is a sheet of notebook paper drawn at the design size and scaled by --u.
   The blue rules repeat every 44 design pixels; --rule0 and --hole0 set where the first rule and
   the first binder hole fall (phones keep one notebook running down the whole page). */
.sec { --H: 1000; --sec-h: calc(var(--H) * var(--u)); --stage-top: calc((var(--sec-h) - var(--H) * var(--u)) / 2); --rule0: 64; --hole0: 120;
  position: relative; overflow: hidden; height: var(--sec-h); background-color: var(--paper);
  background-image: linear-gradient(rgb(143 184 201 / .45) 0 calc(2 * var(--u)), transparent 0);
  background-size: 100% calc(44 * var(--u)); background-position: 0 calc(var(--stage-top) + var(--rule0) * var(--u)); }
.stage { position: absolute; left: 50%; top: var(--stage-top); width: calc(var(--W) * var(--u)); height: calc(var(--H) * var(--u)); translate: -50% 0; }
/* the red margin line and the binder holes */
.stage::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--mx) * var(--u)); width: calc(3 * var(--u)); background: rgb(180 83 42 / .5); --mx: 42; }
.stage::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--hx) * var(--u)); width: calc(var(--hd) * var(--u)); --hx: 5; --hd: 30;
  background: radial-gradient(circle closest-side, rgb(91 107 46 / .35) 98%, transparent) 0 calc(var(--hole0) * var(--u)) / calc(var(--hd) * var(--u)) calc(var(--hd) * var(--u)) no-repeat,
              radial-gradient(circle closest-side, rgb(91 107 46 / .35) 98%, transparent) 0 calc((var(--hole0) + 330) * var(--u)) / calc(var(--hd) * var(--u)) calc(var(--hd) * var(--u)) no-repeat,
              radial-gradient(circle closest-side, rgb(91 107 46 / .35) 98%, transparent) 0 calc((var(--hole0) + 660) * var(--u)) / calc(var(--hd) * var(--u)) calc(var(--hd) * var(--u)) no-repeat,
              radial-gradient(circle closest-side, rgb(91 107 46 / .35) 98%, transparent) 0 calc((var(--hole0) + 990) * var(--u)) / calc(var(--hd) * var(--u)) calc(var(--hd) * var(--u)) no-repeat; }
.pc { position: absolute; margin: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); rotate: var(--r, 0deg); transform-origin: var(--o, 0 0); }

/* ---------- 3. Shared pieces */
.btn { display: flex; align-items: center; justify-content: center; border: 0; border-radius: calc(6 * var(--u)); cursor: pointer; text-decoration: none;
  color: var(--card); font: 400 calc(19 * var(--u))/1 var(--font-type); letter-spacing: .05em; text-transform: uppercase; filter: var(--shadow); }
.btn--rust { background: var(--rust-deep); }
.btn--green { background: var(--green); }
.btn:hover { filter: var(--shadow) brightness(1.1); }
.hand-link { font: 400 calc(var(--hf, 28) * var(--u))/1.25 var(--font-hand); text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: .12em; }
a.hand-link:hover, .nav__links a:hover, .footer__links a:hover { color: var(--rust); }
.sec__title { font: 700 calc(var(--tf, 64) * var(--u))/1.26 var(--font-hand); letter-spacing: -.01em; }
/* art with a baked shadow: the image is a little larger than the piece (--it --is --ib, as in the design) */
.art { display: block; }
.art img { position: absolute; left: calc(var(--is, 0) * -1%); top: calc(var(--it, 0) * -1%); width: calc(100% + var(--is, 0) * 2%); height: calc(100% + (var(--it, 0) + var(--ib, 0)) * 1%); }

/* Photo spots. EDIT: the gradient shows until a photo is added. */
.photo-slot { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--photo-top), var(--photo-bottom)); }
.photo-slot > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot__hint { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: calc(10 * var(--u));
  width: 84%; color: var(--photo-hint); font: 400 calc(12 * var(--u))/1.3 var(--font-type); text-align: center; }
.photo-slot__hint svg { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.photo-slot > img ~ .photo-slot__hint { display: none; }
.polaroid { background: var(--card); filter: var(--shadow); }

/* Sideways rails (phones) */
.rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: none; scroll-snap-align: start; }

/* ---------- 4. Menu */
.topbar { position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 0; --H: 1373; }
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--nav-h-compact); background: rgb(239 228 196 / .97);
  box-shadow: 0 calc(2 * var(--u)) 0 rgb(180 83 42 / .5); opacity: 0; translate: 0 -100%; transition: opacity .3s, translate .3s; }
.topbar__stage { position: absolute; left: 50%; top: 0; width: calc(var(--W) * var(--u)); translate: -50% 0; }
.logo { position: absolute; left: calc(var(--lx, 56) * var(--u)); top: calc(var(--ly, 20) * var(--u)); font: 700 calc(var(--lf, 32) * var(--u))/1.25 var(--font-hand); text-decoration: none; white-space: nowrap;
  transition: top .3s var(--motion-ease); }
.nav__toggle { position: absolute; left: calc(317 * var(--u)); top: calc(var(--ty, 22.5) * var(--u)); padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 calc(28 * var(--u))/1.25 var(--font-hand); text-decoration: underline; text-underline-offset: .12em; transition: top .3s var(--motion-ease); }
.nav__toggle::after { content: ""; position: absolute; inset: calc(-5 * var(--u)) calc(-10 * var(--u)); }
.nav__links { position: absolute; left: calc(40 * var(--u)); top: calc(70 * var(--u)); width: calc(330 * var(--u)); padding: calc(14 * var(--u)) calc(24 * var(--u)) calc(18 * var(--u));
  background: var(--card); filter: var(--shadow); rotate: -1deg; opacity: 0; visibility: hidden; translate: 0 calc(-10 * var(--u)); transition: opacity .25s, visibility .25s, translate .25s; }
.nav.is-open .nav__links, .nav__links:target { opacity: 1; visibility: visible; translate: 0 0; }
/* Menu without JavaScript: the button needs main.js, so a plain link takes its place
   (same look) and the menu opens with :target. A link inside the menu closes it. */
html:not(.js) button.nav__toggle, .js .nav__toggle--link { display: none; }

.nav__links a { display: block; padding: calc(6 * var(--u)) 0; font: 400 calc(32 * var(--u))/1.25 var(--font-hand); text-decoration: underline; text-underline-offset: .12em; }
.topbar.is-scrolled::before { opacity: 1; translate: 0 0; }
.topbar.is-scrolled .logo { --ly: 8; }
.topbar.is-scrolled .nav__toggle { --ty: 10.5; }
.topbar.is-scrolled .nav__links { top: calc(58 * var(--u)); }
.static-nav .topbar { position: absolute; }

/* ---------- 5. Phone layout (390 frame) */
/* HERO */
.hero { --H: 1373.2; }
.hero__title { --x: 56; --y: 76; font: 700 calc(104 * var(--u))/.78 var(--font-hand); letter-spacing: -.01em; padding-top: calc(1 * var(--u)); }
.underline { --x: 56; --y: 254; width: calc(301.6 * var(--u)); height: calc(23.2 * var(--u)); }
.hero__intro { --x: 56; --y: 293.2; width: calc(314 * var(--u)); font-size: calc(18 * var(--u)); line-height: 1.6; }
.hero__btn { --x: 56; --y: 454.2; width: calc(314 * var(--u)); height: calc(66 * var(--u)); }
.hero__listen { --x: 56; --y: 536.2; --hf: 28; }
.polaroid--hero { --x: 70; --y: 607.2; --r: -3deg; width: calc(279 * var(--u)); height: calc(334.8 * var(--u)); }
.polaroid--hero .polaroid__photo { inset: auto; left: calc(11.1 * var(--u)); top: calc(11.2 * var(--u)); width: calc(256.7 * var(--u)); height: calc(279 * var(--u)); }
.caption--hero { display: none; }
.hero__map { --x: 45.5; --y: 1023.6; --r: 4deg; --o: 50% 50%; width: calc(313.6 * var(--u)); height: calc(291.2 * var(--u)); }
.hero__map img { position: absolute; left: -3.21%; top: -1.54%; width: 106.42%; height: 106.92%; }
.stamp--hero { --x: 270; --y: 587.2; --r: -8deg; width: calc(93 * var(--u)); height: calc(111.6 * var(--u)); --it: 4.17; --is: 11.67; --ib: 15.28; }
.ticket { --x: 200.2; --y: 1263.5; --r: 8deg; --o: 50% 50%; width: calc(156 * var(--u)); height: calc(72 * var(--u)); --it: 6.67; --is: 6.92; --ib: 23.33; }
.button { width: calc(30 * var(--u)); height: calc(30 * var(--u)); --it: 2.27; --is: 6.82; --ib: 11.36; pointer-events: none; }
.button--hero { --x: 192.5; --y: 594.4; }

/* ROAD LOG */
.roadlog { --H: 1336; --rule0: 10.8; --hole0: 66.8; }
.roadlog__title { --x: 56; --y: 1405.2; --y: 32; }
.roadlog__intro { --x: 56; --y: 131; width: calc(314 * var(--u)); font-size: calc(17 * var(--u)); line-height: 1.5; }
.shows { --x: 56; --y: 201; width: calc(314 * var(--u)); display: grid; row-gap: calc(18 * var(--u)); }
.show { position: relative; height: calc(203 * var(--u)); }
.show > * { position: absolute; }
.show__stamp { left: 0; top: calc(34.2 * var(--u)); width: calc(66 * var(--u)); height: calc(60.5 * var(--u)); --it: 6.82; --is: 14.58; --ib: 25.45; rotate: var(--sr, 0deg); }
.show:nth-child(1) .show__stamp { --sr: 4deg; } .show:nth-child(2) .show__stamp { --sr: -3deg; } .show:nth-child(3) .show__stamp { --sr: 2deg; }
.show:nth-child(4) .show__stamp { --sr: -4deg; } .show:nth-child(5) .show__stamp { --sr: 3deg; }
.show__date { left: calc(80 * var(--u)); top: calc(10 * var(--u)); font: 700 calc(34 * var(--u))/1.26 var(--font-hand); }
.show__city { left: calc(80 * var(--u)); top: calc(53 * var(--u)); color: var(--rust); font: 700 calc(40 * var(--u))/1.25 var(--font-hand); }
.show__venue { left: calc(80 * var(--u)); top: calc(103 * var(--u)); font-size: calc(16 * var(--u)); line-height: 1; }
.show__btn { left: 0; top: calc(129 * var(--u)); width: calc(314 * var(--u)); height: calc(64 * var(--u)); }

/* SONGS (records) */
.songs { --H: 650; --rule0: 38.8; --hole0: 50.8; }
.songs__title { --x: 56; --y: 32; width: calc(314 * var(--u)); }
.records { --x: 0; --y: 209.6; width: calc(390 * var(--u)); gap: calc(16 * var(--u)); padding: calc(2.4 * var(--u)) calc(20 * var(--u)) 0 calc(56 * var(--u)); scroll-padding-left: calc(56 * var(--u)); }
.record { position: relative; width: calc(240 * var(--u)); height: calc(390 * var(--u)); }
.record > * { position: absolute; }
.record__card { left: calc(4 * var(--u)); top: calc(14 * var(--u)); width: calc(222 * var(--u)); height: calc(282 * var(--u)); }
.record__card .polaroid__photo { inset: auto; left: calc(10.8 * var(--u)); top: calc(10.8 * var(--u)); width: calc(200.4 * var(--u)); height: calc(228 * var(--u)); }
.record__name { position: absolute; left: calc(-4 * var(--u)); top: calc(284 * var(--u)); width: calc(240 * var(--u)); font: 700 calc(30 * var(--u))/1.26 var(--font-hand); }
.record__button { left: calc(102 * var(--u)); top: calc(10 * var(--u)); }
.record__text { left: 0; top: calc(344 * var(--u)); width: calc(240 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.5; }

/* POSTCARDS (press quotes) */
.postcards { --H: 452; --rule0: 4.8; --hole0: 60.8; }
.postcards__title { --x: 56; --y: 32; --tf: 48; width: calc(314 * var(--u)); line-height: 1.25; }
.cards { --x: 0; --y: 170; width: calc(390 * var(--u)); gap: calc(14 * var(--u)); padding: 0 calc(20 * var(--u)) calc(24 * var(--u)) calc(56 * var(--u)); scroll-padding-left: calc(56 * var(--u)); }
.card { position: relative; width: calc(288.6 * var(--u)); height: calc(234 * var(--u)); background: var(--card); filter: var(--shadow); rotate: var(--cr, 0deg); transform-origin: 0 0;
  --k: .78; }
.card::before, .card::after { content: ""; position: absolute; left: 0; right: 0; height: calc(12 * var(--k) * var(--u)); background: var(--rust); top: 0; }
.card::after { top: auto; bottom: 0; background: var(--blue); }
.card > * { position: absolute; }
.card__quote { left: calc(24 * var(--k) * var(--u)); top: calc(40 * var(--k) * var(--u)); width: calc(230 * var(--k) * var(--u)); font: 700 calc(36 * var(--k) * var(--u))/1.05 var(--font-hand); }
.card__rule { left: calc(266 * var(--k) * var(--u)); top: calc(30 * var(--k) * var(--u)); width: calc(2 * var(--k) * var(--u)); height: calc(230 * var(--k) * var(--u)); background: rgb(42 33 24 / .4); }
.card__stamp { left: calc(282 * var(--k) * var(--u)); top: calc(26 * var(--k) * var(--u)); width: calc(70 * var(--k) * var(--u)); height: calc(86 * var(--k) * var(--u)); }
.card__src { left: calc(272 * var(--k) * var(--u)); top: calc(150 * var(--k) * var(--u)); width: calc(90 * var(--k) * var(--u)); font-size: calc(15 * var(--k) * var(--u)); line-height: 1.4; text-transform: uppercase; }
.card__mark { left: calc(250 * var(--k) * var(--u)); top: calc(200 * var(--k) * var(--u)); width: calc(90 * var(--k) * var(--u)); height: calc(90 * var(--k) * var(--u)); }

/* OUR STORY */
.story { --H: 746; --rule0: 36.8; --hole0: 268.8; }
.story__photo { --x: 56; --y: 46; width: calc(314 * var(--u)); height: calc(270 * var(--u)); filter: var(--shadow); }
.button--story { --x: 204.2; --y: 34.7; }
.story__title { --x: 56; --y: 340; width: calc(314 * var(--u)); font: 700 calc(52 * var(--u))/.9 var(--font-hand); padding-top: calc(5 * var(--u)); }
.story__text { --x: 56; --y: 452; width: calc(314 * var(--u)); font-size: calc(17 * var(--u)); line-height: 1.6; }
.story__quote { --x: 56; --y: 632; width: calc(314 * var(--u)); color: var(--rust); font: 400 calc(30 * var(--u))/1.1 var(--font-hand); }

/* WRITE TO US */
.write { --H: 800; --rule0: 38.8; --hole0: 182.8; }
.envelope { --x: 56; --y: 32; width: calc(314 * var(--u)); height: calc(720 * var(--u)); background: var(--card); filter: var(--shadow); }
.envelope > * { position: absolute; }
.envelope__edge { left: 0; right: 0; height: calc(22 * var(--u)); top: 0;
  background: repeating-linear-gradient(90deg, var(--blue) 0 calc(24 * var(--u)), transparent 0 calc(40 * var(--u)), var(--rust) 0 calc(64 * var(--u)), transparent 0 calc(80 * var(--u))) calc(-10 * var(--u)) 0; }
.envelope__edge--bottom { display: none; }
.envelope__title { left: calc(20 * var(--u)); top: calc(40 * var(--u)); font: 700 calc(56 * var(--u))/1.26 var(--font-hand); }
.envelope__text { left: calc(20 * var(--u)); top: calc(125 * var(--u)); width: calc(274 * var(--u)); font-size: calc(17 * var(--u)); line-height: 1.6; }
.envelope__text a { position: relative; text-decoration: none; }
.envelope__text a::after { content: ""; position: absolute; inset: calc(-12 * var(--u)) 0; }
.envelope__text a:hover { text-decoration: underline; }
.envelope__stamp { display: none; }
.form { left: calc(20 * var(--u)); top: calc(328 * var(--u)); width: calc(274 * var(--u)); display: grid; row-gap: calc(14 * var(--u)); }
.field label { display: block; font: 400 calc(24 * var(--u))/1.25 var(--font-hand); text-decoration: underline; text-underline-offset: .12em; }
.field input, .field textarea { display: block; width: 100%; height: calc(14 * var(--u)); padding: 0 0 calc(2 * var(--u)); border: 0; border-bottom: calc(2 * var(--u)) solid var(--ink); border-radius: 0;
  background: transparent; font: 400 16px/1 var(--font-type); }
.field--big textarea { height: calc(70 * var(--u)); margin-top: calc(14 * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u)); border: calc(2 * var(--u)) solid var(--ink); resize: none; }
/* The fields grow 14 px upward, under their label: typed text is never cut and they are easy to tap.
   The line under each field stays exactly where it was. */
.field input { position: relative; height: calc(14 * var(--u) + 14px); margin-top: -14px; padding-top: 14px; }
.form__send { width: calc(274 * var(--u)); height: calc(56 * var(--u)); margin-top: calc(0 * var(--u)); }

/* FOOTER */
.footer { --H: 264; background: var(--forest); color: var(--paper); }
.footer .stage::before, .footer .stage::after { display: none; }
.footer__pines { position: absolute; left: 0; bottom: 0; width: calc(864 * var(--u)); height: calc(120 * var(--u)); pointer-events: none; }
.footer__pines--d { display: none; }
.footer__logo { --x: 56; --y: 40; font: 700 calc(44 * var(--u))/1.25 var(--font-hand); }
.footer__links { --x: 56; --y: 109; display: grid; grid-template-columns: calc(127 * var(--u)) auto; row-gap: calc(4 * var(--u)); z-index: 1; }
.footer__links a { display: inline-block; font: 400 calc(30 * var(--u))/1.25 var(--font-hand); text-underline-offset: .12em; }
.footer__copy { --x: 56; --y: 203; color: var(--blue); font-size: calc(13 * var(--u)); line-height: 1; z-index: 1; }

/* ---------- 6. Desktop layout (1440 frame). From 1024 px wide.
   Each section scales to fit the screen: as wide as the screen allows (up to 1440)
   and never taller than the screen, but never smaller than 60 % of the width scale. */
/* TOUCH AREA
   Small text links get an invisible area at least 26 px tall around them (WCAG target size).
   It only makes the clickable area bigger: nothing on screen moves. */
.footer__links a { position: relative; }
.footer__links a::after { content: ""; position: absolute; left: 0; right: 0; top: min(0px, calc(50% - 13px)); bottom: min(0px, calc(50% - 13px)); }

@media (min-width: 1024px) {
  :root { --W: 1440; --nav-h-compact: 64px; --kw: calc(min(100cqi, 1440px) / 1440); }
  .sec, .topbar { --u: max(min(var(--kw), 100svh / var(--H)), var(--kw) * .6); }
  .sec { --sec-h: max(100svh, var(--H) * var(--u)); --rule0: 64; --hole0: 120; }
  .stage::before { --mx: 130; }
  .stage::after { --hx: 44; --hd: 34; }
  .photo-slot__hint { font-size: calc(14 * var(--u)); }
  .photo-slot__hint svg { width: calc(56 * var(--u)); height: calc(56 * var(--u)); }

  /* menu */
  .topbar { --H: 1000; }
  .topbar__stage { top: calc((max(100svh, 1000 * var(--u)) - 1000 * var(--u)) / 2); transition: top .3s var(--motion-ease); }
  .topbar.is-scrolled .topbar__stage { top: 0; }
  .logo { --lx: 170; --ly: 26; --lf: 38; }
  .topbar.is-scrolled .logo { --ly: 9; }
  .nav__toggle { display: none; }
  .nav__links { left: calc(780 * var(--u)); top: calc(var(--ny, 24) * var(--u)); width: auto; padding: 0; display: flex; gap: calc(34 * var(--u)); background: none; filter: none; rotate: none; opacity: 1; visibility: visible; translate: none; transition: top .3s var(--motion-ease); }
  .nav__links a { padding: 0; font-size: calc(30 * var(--u)); }
  .topbar.is-scrolled .nav__links { --ny: 12; top: calc(var(--ny) * var(--u)); }

  /* hero */
  .hero { --H: 1000; }
  .hero__title { --x: 160; --y: 120; font-size: calc(230 * var(--u)); line-height: .871; padding-top: 0; margin-top: calc(-9.5 * var(--u)); }
  .underline { --x: 170; --y: 478; width: calc(520 * var(--u)); height: calc(40 * var(--u)); }
  .hero__intro { --x: 170; --y: 538; width: calc(540 * var(--u)); font-size: calc(24 * var(--u)); }
  .hero__btn { --x: 170; --y: 740; width: calc(290 * var(--u)); height: calc(66 * var(--u)); }
  .hero__listen { --x: 500; --y: 756; --hf: 34; }
  .hero__map { --x: 790; --y: 150; --o: 0 0; width: calc(560 * var(--u)); height: calc(520 * var(--u)); }
  .polaroid--hero { --x: 880; --y: 240; width: calc(450 * var(--u)); height: calc(540 * var(--u)); }
  .polaroid--hero .polaroid__photo { left: calc(18 * var(--u)); top: calc(18 * var(--u)); width: calc(414 * var(--u)); height: calc(450 * var(--u)); }
  .caption--hero { display: block; --x: 880; --y: 716; --r: -3deg; --hf: 30; width: calc(450 * var(--u)); text-align: center; white-space: nowrap; }
  .stamp--hero { --x: 1240; --y: 160; width: calc(150 * var(--u)); height: calc(180 * var(--u)); }
  .ticket { --x: 1150; --y: 760; --o: 0 0; width: calc(260 * var(--u)); height: calc(120 * var(--u)); }
  .button { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
  .button--hero { --x: 1061.6; --y: 227.2; }

  /* road log */
  .roadlog { --H: 980; }
  .roadlog__title { --x: 170; --y: 60; --tf: 120; }
  .roadlog__intro { --x: 800; --y: 100; width: calc(420 * var(--u)); font-size: calc(22 * var(--u)); }
  .shows { --x: 170; --y: 250; width: calc(1200 * var(--u)); row-gap: calc(18 * var(--u)); }
  .show { height: calc(110 * var(--u)); }
  .show__stamp { top: 0; width: calc(120 * var(--u)); height: calc(110 * var(--u)); }
  .show__date { left: calc(160 * var(--u)); top: calc(10 * var(--u)); font-size: calc(62 * var(--u)); }
  .show__city { left: calc(430 * var(--u)); top: calc(10 * var(--u)); font-size: calc(62 * var(--u)); line-height: 1.26; }
  .show__venue { left: calc(730 * var(--u)); top: calc(36 * var(--u)); font-size: calc(22 * var(--u)); }
  .show__btn { left: calc(1000 * var(--u)); top: calc(20 * var(--u)); width: calc(200 * var(--u)); height: calc(64 * var(--u)); }

  /* songs */
  .songs { --H: 1000; }
  .songs__title { --x: 170; --y: 60; --tf: 120; width: auto; white-space: nowrap; }
  .records { --x: 0; --y: 0; width: 100%; height: 100%; overflow: visible; padding: 0; display: block; }
  .record { position: absolute; left: calc(var(--rx) * var(--u)); top: calc(var(--ry) * var(--u)); width: calc(370 * var(--u)); height: calc(560 * var(--u)); }
  .record:nth-child(1) { --rx: 170; --ry: 220; --rr: 3deg; --cx: 2.4; --cy: 412.2; --tx: 16; --ty: 512; --bx: 160.8; --by: 8.2; }
  .record:nth-child(2) { --rx: 580; --ry: 238; --rr: -2deg; --cx: 38.3; --cy: 410.4; --tx: 16; --ty: 512; --bx: 164.1; --by: -2.2; }
  .record:nth-child(3) { --rx: 990; --ry: 256; --rr: 1.5deg; --cx: 13.2; --cy: 412; --tx: 16; --ty: 512; --bx: 162; --by: 5.1; }
  .record__card { left: 0; top: 0; width: calc(370 * var(--u)); height: calc(470 * var(--u)); rotate: var(--rr); transform-origin: 0 0; }
  .record__card .polaroid__photo { left: calc(18 * var(--u)); top: calc(18 * var(--u)); width: calc(334 * var(--u)); height: calc(380 * var(--u)); }
  .record__name { left: calc(24 * var(--u)); top: calc(411.5 * var(--u)); width: calc(322 * var(--u)); font-size: calc(36 * var(--u)); }
  .record__button { left: calc(var(--bx) * var(--u)); top: calc(var(--by) * var(--u)); }
  .record__text { left: calc(var(--tx) * var(--u)); top: calc(var(--ty) * var(--u)); width: calc(340 * var(--u)); font-size: calc(19 * var(--u)); }

  /* postcards */
  .postcards { --H: 720; }
  .postcards__title { --x: 170; --y: 60; --tf: 100; width: auto; white-space: nowrap; line-height: 1.26; }
  .cards { --x: 0; --y: 0; width: 100%; height: 100%; overflow: visible; padding: 0; display: block; }
  .card { position: absolute; left: calc(var(--px) * var(--u)); top: calc(var(--py) * var(--u)); width: calc(370 * var(--u)); height: calc(300 * var(--u)); --k: 1; }
  .card:nth-child(1) { --px: 170; --py: 230; --cr: 2deg; }
  .card:nth-child(2) { --px: 580; --py: 260; --cr: -1.5deg; }
  .card:nth-child(3) { --px: 990; --py: 230; --cr: 1deg; }

  /* our story */
  .story { --H: 900; }
  .story__photo { --x: 170; --y: 110; --r: 1.5deg; width: calc(640 * var(--u)); height: calc(560 * var(--u)); }
  .button--story { --x: 456.9; --y: 96.2; }
  .story__title { --x: 860; --y: 90; width: calc(520 * var(--u)); font-size: calc(100 * var(--u)); padding-top: calc(10 * var(--u)); }
  .story__text { --x: 860; --y: 300; width: calc(480 * var(--u)); font-size: calc(22 * var(--u)); }
  .story__quote { --x: 860; --y: 560; width: calc(480 * var(--u)); font-size: calc(42 * var(--u)); }

  /* write to us */
  /* the letter and the footer share the last screen */
  .write { --H: 1260; --sec-h: calc(max(100svh, 1260 * var(--u)) - 360 * var(--u)); --stage-top: calc((var(--sec-h) - 900 * var(--u)) / 2); }
  .write .stage { height: calc(900 * var(--u)); }
  .envelope { --x: 170; --y: 70; width: calc(1100 * var(--u)); height: calc(760 * var(--u)); border-radius: calc(6 * var(--u)); }
  .envelope__edge--bottom { display: block; top: auto; bottom: 0; }
  .envelope__title { left: calc(60 * var(--u)); top: calc(70 * var(--u)); font-size: calc(110 * var(--u)); }
  .envelope__text { left: calc(60 * var(--u)); top: calc(230 * var(--u)); width: calc(440 * var(--u)); font-size: calc(22 * var(--u)); }
  .envelope__stamp { display: block; left: calc(920 * var(--u)); top: calc(50 * var(--u)); width: calc(130 * var(--u)); height: calc(160 * var(--u)); rotate: -6deg; transform-origin: 0 0; }
  .form { left: calc(600 * var(--u)); top: calc(230 * var(--u)); width: calc(420 * var(--u)); row-gap: calc(59.5 * var(--u)); }
  .field label { font-size: calc(30 * var(--u)); }
  .field input, .field textarea { height: calc(10.5 * var(--u)); font-size: calc(17 * var(--u)); }
  .field--big textarea { height: calc(10.5 * var(--u)); margin-top: 0; padding: 0 0 calc(2 * var(--u)); border: 0; border-bottom: calc(2 * var(--u)) solid var(--ink); }
  .field input, .field textarea, .field--big textarea { position: relative; height: calc(10.5 * var(--u) + 14px); margin-top: -14px; padding-top: 14px; }
  .field--big textarea { padding-top: max(0px, calc(14px - 5.25 * var(--u))); padding-bottom: 0; line-height: 1; } /* first line sits where the text of the other fields sits */
  .form__send { width: calc(260 * var(--u)); height: calc(56 * var(--u)); margin-top: calc(8.5 * var(--u)); }

  /* footer */
  .footer { --H: 1260; --sec-h: calc(360 * var(--u)); --stage-top: 0px; }
  .footer .stage { height: calc(360 * var(--u)); }
  .footer__pines--m { display: none; }
  .footer__pines--d { display: block; top: calc(160 * var(--u)); bottom: auto; width: calc(1440 * var(--u)); height: calc(200 * var(--u)); }
  .footer__logo { --x: 60; --y: 50; font-size: calc(64 * var(--u)); }
  .footer__links { --x: 60; --y: 136; display: flex; gap: calc(34 * var(--u)); }
  .footer__copy { --x: 1000; --y: 60; font-size: calc(16 * var(--u)); }
}

/* ---------- 7. Animations (only with the "motion" class, see index.html).
   Nothing starts hidden until main.js adds "fk-reveal", so the page always
   shows up complete without JavaScript. To turn them all off: class="no-motion" on <html>. */
.motion.fk-reveal [data-reveal] { transition: opacity var(--motion-dur) var(--motion-ease), translate var(--motion-dur) var(--motion-ease), scale var(--motion-dur) var(--motion-settle), clip-path var(--motion-dur) var(--motion-ease), transform var(--motion-dur) var(--motion-settle);
  transition-delay: calc(var(--i, 0) * var(--motion-step)); }
/* text rises a little */
.motion.fk-reveal [data-reveal="rise"]:not(.is-in) { opacity: 0; translate: 0 calc(var(--motion-rise) * var(--u)); }
/* the name and its underline are written from left to right */
.motion.fk-reveal [data-reveal="write"] { transition-duration: calc(var(--motion-dur) * 1.4); }
.motion.fk-reveal [data-reveal="write"]:not(.is-in) { clip-path: inset(0 100% 0 0); }
/* photos, cards, the map, stamps and the ticket are pinned down: they drop with a small turn and settle */
.motion.fk-reveal [data-reveal="pin"]:not(.is-in) { opacity: 0; transform: translateY(calc(-18 * var(--u))) rotate(var(--motion-pin)) scale(1.04); }
/* the sewn button comes last: it presses down on the photo once the photo has landed */
.motion.fk-reveal [data-reveal="sew"], .motion.fk-reveal .record .record__button { transition: opacity calc(var(--motion-dur) * .45) var(--motion-ease), scale calc(var(--motion-dur) * .45) var(--motion-settle);
  transition-delay: calc(var(--i, 0) * var(--motion-step) + var(--motion-dur) * .75); }
.motion.fk-reveal [data-reveal="sew"]:not(.is-in), .motion.fk-reveal .record:not(.is-in) .record__button { opacity: 0; scale: 1.7; }
/* used by main.js: "fk-still" jumps without animating, "fk-measure" puts every piece in its final place */
.fk-still *, .fk-still *::before, .fk-still *::after { transition: none !important; }
.fk-measure [data-reveal], .fk-measure [data-reveal] * { opacity: 1 !important; translate: none !important; scale: none !important; clip-path: none !important; transform: none !important; }

/* DEMO ONLY: note after sending the form, template and photo credits under the footer */
.demo-note { position: absolute; left: 0; right: 0; bottom: 0; height: calc(56 * var(--u)); display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 calc(10 * var(--u)); background: var(--card); box-shadow: inset 0 0 0 2px var(--rust-deep); font: 400 calc(14 * var(--u))/1.25 var(--font-type); color: var(--rust-deep); text-align: center; }
.demo-note[hidden] { display: none; }
.demo-credit { background: var(--forest); color: var(--card); padding: 22px 20px 28px; font: 400 13px/1.5 var(--font-type); }
.demo-credit p { width: min(100%, 390px); margin: 0 auto 6px; opacity: .85; }
@media (min-width: 1024px) { .demo-note { right: auto; width: calc(260 * var(--u)); height: calc(56 * var(--u)); font-size: calc(15 * var(--u)); } .demo-credit { padding: 24px 56px 32px; font-size: 14px; } .demo-credit p { width: min(100%, 1328px); } }
