/* Post Club website. Colours and type follow the app: BioRhyme titles, Georgia for small serif
   captions, the system font for text, the gallery's peach-to-sky wash and the orange accent. */

@font-face {
  font-family: "BioRhyme";
  src: url("assets/fonts/BioRhyme.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Special Elite";
  src: url("assets/fonts/SpecialElite.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #3b2b1f;
  --ink-soft: #6b5848;
  --paper: #f7f1e4;
  --orange: #f56e1a;
  --peach: #ffe0c4;
  --blush: #fdede3;
  --lilac: #e6dbf7;
  --sky: #c9e3ff;
  --rose: #f8cdd0;
  --lavender: #dcdaf7;
  --evergreen: #1d4a36;
  --butter: #fbe6a2;
  --mint: #cfe6cf;
  --dusk: #2b3559;
  --cream: #f6ecdc;
  --title: "BioRhyme", Georgia, serif;
  --serif: Georgia, "Times New Roman", serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--peach);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--text);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-family: var(--title); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 6.2vw, 4.9rem); line-height: 1.02; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.01em; }
p { margin: 0; max-width: 34em; }
section h2 + p, section p + p { margin-top: 1.1rem; }
section p { font-size: clamp(1.15rem, 1.45vw, 1.35rem); line-height: 1.5; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

/* Navigation */
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
}
/* The way back to the studio's site: its name on wide screens, just the chevron on narrow ones */
.nav-studio {
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem; margin-right: 0.9rem; padding-right: 0.9rem;
  border-right: 1px solid rgb(59 43 31 / 0.2); text-decoration: none; font-size: 0.9rem; color: var(--ink-soft);
}
.nav-studio::after { content: ""; position: absolute; inset: -0.9rem -0.2rem; }
.nav-studio:hover { color: var(--ink); }
.nav-mark { margin-right: auto; display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.2rem var(--title); }
.nav-mark img { border-radius: 22%; box-shadow: 0 1px 3px rgb(59 43 31 / 0.25); }
.nav-links { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.75rem); font-size: 0.95rem; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.nav-get { background: var(--ink); color: var(--paper); padding: 0.45rem 0.95rem; border-radius: 99px; }
.nav-links .nav-get:hover { text-decoration: none; background: #000; }

/* Hero: the gallery's wash, with the typewriter you can type on */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center; gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(5.5rem, 8vw, 6.5rem) var(--gutter) clamp(2.5rem, 4vw, 3.5rem);
  background:
    radial-gradient(60% 70% at 100% 0%, rgb(179 224 255 / 0.7), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, rgb(255 194 212 / 0.45), transparent 70%),
    linear-gradient(160deg, var(--peach), var(--blush) 40%, var(--lilac) 75%, var(--sky));
  overflow: clip;
}
.hero-copy { max-width: 33rem; justify-self: end; }
.hero .lead, .doc .lead { font-size: clamp(1.2rem, 1.6vw, 1.4rem); line-height: 1.45; margin-top: 1.25rem; }
.get { margin-top: 2rem; }
.badge { display: inline-block; border-radius: 10px; }
.badge img { width: 180px; height: 60px; }
.hero .get-note { margin-top: 0.9rem; font-size: 0.95rem; color: var(--ink-soft); max-width: 22em; }
/* Sized so the keys, the swatches and their caption all sit above the fold. */
.hero-machine { justify-self: start; width: min(100%, 34rem, (100svh - 15.5rem) / 1.34); }

/* The typewriter. Sizes inside use cqw so the whole machine scales with its width. */
.tw {
  --legend: #3a2b1f; --pill-top: #f3e9d6; --pill-bottom: #d9cbb2; --key-art: url("assets/machines/sunset-key.webp");
  container-type: inline-size; position: relative; border-radius: 5%;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
/* Focus shows as a blinking caret at the type guide, as a text field would. */
.tw:focus-visible { outline: none; }
/* The base art is full width at its foot, but the deck's top corners round in. Draw the top a little narrower
   and tuck the deck under it, so the body reads as one piece. */
.tw-top { position: relative; z-index: 1; aspect-ratio: 1200 / 700; margin-top: 10cqw; transform: scale(0.972); transform-origin: 50% 100%; }
.tw-travel { position: absolute; inset: 0; transition: transform 90ms ease-out; will-change: transform; }
.tw-travel.returning { transition: transform 420ms cubic-bezier(0.3, 0, 0.2, 1); }
.tw-carriage, .tw-base { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tw-paper {
  position: absolute; left: 12.5%; width: 75%; bottom: 23%;
  min-height: 40cqw; padding: 9cqw 0 3.6cqw;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  background: var(--paper-art, none) center top / 100% auto no-repeat, var(--paper-tint, #f8f3e8);
  box-shadow: 0 0.4cqw 1.6cqw rgb(59 43 31 / 0.18);
  border-radius: 0.5cqw 0.5cqw 0 0;
}
.tw-paper.leaving { transition: transform 420ms cubic-bezier(0.5, 0, 0.9, 0.4), opacity 420ms; transform: translateY(-120%) rotate(-3deg); opacity: 0; }
.tw-paper.arriving { animation: feed 380ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes feed { from { transform: translateY(40%); } }
.tw-text { width: 58cqw; font-size: 4.1cqw; line-height: 1.38; color: #2a211b; }
.tw-line { display: block; white-space: pre; min-height: 1.38em; }
.tw-line.fed { animation: line 140ms ease-out; }
@keyframes line { from { min-height: 0; height: 0; } }
.tw-caret { display: inline-block; width: 0; height: 1em; vertical-align: -0.12em; }
/* The caret always blinks at the type guide, so the machine reads as live; it thickens with focus. */
.tw-caret { box-shadow: 0 0 0 0.14cqw var(--orange); animation: blink 1.1s steps(1) infinite; }
.tw:focus .tw-caret { box-shadow: 0 0 0 0.24cqw var(--orange); }
@keyframes blink { 50% { box-shadow: none; } }
.f-sunset { font-family: Courier, "Courier New", monospace; }
.f-holiday { font-family: "Special Elite", "American Typewriter", monospace; }
.f-mint { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 0.9em; }
.f-butter { font-family: "Courier New", Courier, monospace; }
.f-midnight { font-family: "American Typewriter", "Special Elite", serif; }
.f-bordeaux { font-family: "American Typewriter", "Special Elite", serif; font-weight: 600; }

.tw-deck { position: relative; margin-top: -2.2cqw; aspect-ratio: 1200 / 800; }
.tw-deck-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 2.5cqw 3cqw rgb(59 43 31 / 0.28)); }
.tw-shelf { position: absolute; left: 4.5%; right: 4.5%; top: 4.6%; height: 13.4%; display: flex; align-items: center; justify-content: space-between; }
.tw-tool {
  position: relative; appearance: none; border: 0; cursor: pointer; height: 6.6cqw; min-width: 6.6cqw; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 99px; background: rgb(0 0 0 / 0.16); color: #fff;
  box-shadow: inset 0 0.2cqw 0.4cqw rgb(0 0 0 / 0.25), 0 0.15cqw 0 rgb(255 255 255 / 0.2);
  font: 600 2.7cqw var(--text);
}
/* A 44-point touch area however small the deck is drawn. */
.tw-tool::after { content: ""; position: absolute; inset: min(0px, (6.6cqw - 2.75rem) / 2); }
.tw-tool svg { width: 4.2cqw; height: 4.2cqw; }
.tw-tool-text { padding: 0 2.6cqw; }
.tw-tool:active { transform: translateY(0.2cqw); }
#tw-sound[aria-pressed="true"] .mute, #tw-sound[aria-pressed="false"] .waves { display: none; }
.tw[data-machine="butter"] .tw-tool, .tw[data-machine="mint"] .tw-tool, .tw[data-machine="holiday"] .tw-tool { color: #2c2a26; background: rgb(255 255 255 / 0.3); box-shadow: inset 0 0.2cqw 0.4cqw rgb(0 0 0 / 0.14); }

.tw-keys { position: absolute; left: 5.4%; right: 5.4%; top: 23.6%; bottom: 17%; display: grid; grid-template-rows: repeat(4, 1fr); gap: 1.1cqw; }
.tw-row { display: flex; justify-content: center; gap: 0.9cqw; min-height: 0; }
.tw-key {
  appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  flex: 0 0 calc((100% - 9 * 0.9cqw) / 10); height: 100%;
  background: var(--key-art) center / 100% 100% no-repeat;
  color: var(--legend); font: 400 4.3cqw "American Typewriter", "Special Elite", Georgia, serif;
  display: flex; align-items: center; justify-content: center; padding-bottom: 0.9cqw;
  transition: transform 50ms; touch-action: manipulation;
}
.tw-key.wide {
  flex: 1 1 0; background: linear-gradient(var(--pill-top), var(--pill-bottom)); border-radius: 2.4cqw;
  box-shadow: inset 0 -0.9cqw 0 rgb(0 0 0 / 0.12), inset 0 0.25cqw 0 rgb(255 255 255 / 0.5), 0 0.5cqw 0.8cqw rgb(0 0 0 / 0.45);
  font-size: 3.5cqw;
}
.tw-key.mod { flex-basis: calc((100% - 9 * 0.9cqw) / 10 * 1.45); font-size: 3.6cqw; }
.tw-key.ret { flex: 1.7 1 0; white-space: nowrap; }
.tw-key.space { flex: 4 1 0; font-family: var(--title); font-weight: 600; }
.tw-key.down, .tw-key:active { transform: translateY(0.55cqw) scale(0.97); filter: brightness(0.93); }
.tw-key[aria-pressed="true"] { filter: brightness(0.82); }
.tw-key:focus-visible { outline-width: 2px; outline-offset: 1px; }
.tw-key svg { width: 4.4cqw; height: 4.4cqw; }

.picker { display: flex; justify-content: center; gap: 0.7rem; margin-top: 1.4rem; }
.picker button {
  position: relative; appearance: none; cursor: pointer; width: 2.75rem; height: 2.75rem; border-radius: 50%; padding: 0;
  border: 3px solid var(--blush); background: var(--enamel);
  box-shadow: inset 0 -5px 8px rgb(0 0 0 / 0.18), inset 0 4px 5px rgb(255 255 255 / 0.3), 0 1px 3px rgb(59 43 31 / 0.3);
}
.picker button[aria-checked="true"] { box-shadow: inset 0 -5px 8px rgb(0 0 0 / 0.18), inset 0 4px 5px rgb(255 255 255 / 0.3), 0 0 0 2.5px var(--orange); }
.picker button::after { content: ""; position: absolute; inset: min(0px, (100% - 2.75rem) / 2); }

/* Shared section layouts */
section { position: relative; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); }

.stickers { background: var(--lavender); padding-block: clamp(4rem, 9vw, 8rem); color: #25264f; }
.sheet { margin: 0; transform: rotate(2.5deg); }
.sheet img { box-shadow: 0 1px 2px rgb(37 38 79 / 0.2), 0 18px 40px rgb(37 38 79 / 0.22); }
.stamps { list-style: none; padding: 0; margin: 2.4rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 5.5rem)); gap: 1rem 1.1rem; }
.stamps img { filter: drop-shadow(0 1px 1px rgb(37 38 79 / 0.35)); }
.stamps li:nth-child(odd) { transform: rotate(-3deg); }
.stamps li:nth-child(3n) { transform: rotate(2.5deg) translateY(4px); }
.stamps li:nth-child(4n + 2) { transform: rotate(1.5deg); }

.film { background: var(--blush); padding-block: clamp(3.5rem, 7vw, 6rem); }
.film-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: clamp(12px, 2vw, 24px); background: #fbe6dc; box-shadow: 0 1px 2px rgb(59 43 31 / 0.2), 0 20px 44px rgb(59 43 31 / 0.16); }

/* Two subjects side by side, each with its words beside its picture */
.pair { display: grid; grid-template-columns: 1fr 1fr; }
.pair-half { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(1.5rem, 3vw, 3rem); padding: clamp(3.5rem, 6vw, 5.5rem) var(--gutter); }
.pair-half:first-child { padding-right: clamp(1.25rem, 3vw, 3rem); }
.pair-half:last-child { padding-left: clamp(1.25rem, 3vw, 3rem); }
.pair-copy h2 { font-size: clamp(1.7rem, 2.7vw, 2.5rem); }
.cards { background: var(--rose); color: #5a2630; }
.holidays { background: var(--evergreen); color: #f8ecd4; }
.draw { background: var(--butter); color: #4a3a12; }
.passthrough { background: var(--mint); color: #1f3b2a; }
.phone {
  width: clamp(12rem, 17vw, 15.5rem); padding: 0.5rem; border-radius: 2.7rem; background: #15120f;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.28) inset, 0 1px 2px rgb(0 0 0 / 0.4), 0 24px 44px rgb(0 0 0 / 0.26);
}
.phone img { border-radius: 2.25rem; }
.holidays .phone, .passthrough .phone { transform: rotate(2.5deg); }
.draw .phone { transform: rotate(-2.5deg); }

/* Cards: the real header art on each card's own paper colour, greeting typed in its machine's face */
.fan { list-style: none; margin: 0; padding: 0; position: relative; width: clamp(12rem, 18vw, 16.5rem); aspect-ratio: 1 / 0.92; }
.card { position: absolute; left: 25%; top: 3%; width: 50%; aspect-ratio: 8.5 / 11; container-type: inline-size; overflow: hidden; border-radius: 3px; box-shadow: 0 1px 2px rgb(90 38 48 / 0.3), 0 12px 24px rgb(90 38 48 / 0.22); }
.card span { position: absolute; left: 12%; top: 46%; font-size: 7cqw; white-space: nowrap; }
.card-thanks { background: #e3f0fc; transform: translate(-46%, 3%) rotate(-10deg); }
.card-thanks span { font-family: "Special Elite", monospace; color: #1f3566; }
.card-birthday { background: #d9f2f2; transform: translate(46%, 3%) rotate(10deg); }
.card-birthday span { font-family: Courier, "Courier New", monospace; color: #b3261e; }
.card-love { background: #fcf5e6; transform: translateY(8%); }
.card-love span { font-family: "American Typewriter", "Special Elite", serif; color: #b3261e; }

.scenes { background: var(--dusk); color: #f3e8d6; padding-block: clamp(4rem, 9vw, 7.5rem); }
.scene-row { list-style: none; margin: 2.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.6rem 1.1rem; }
.scene-row li { grid-column: span 2; }
.scene-row li:nth-child(-n + 2) { grid-column: span 3; }
/* The scenes are backdrops with an empty tabletop for the machine, so show the view, not the table. */
.scene-row img { border-radius: 14px; aspect-ratio: 2 / 1; object-fit: cover; object-position: center top; width: 100%; }
.scene-row span { display: block; margin-top: 0.6rem; font: 1.05rem var(--serif); }

.duo { background: var(--sky); padding-block: clamp(4rem, 8vw, 7rem); color: #1e3350; }
.duo-art { margin: 0; justify-self: center; max-width: 30rem; }
.duo-art img { border-radius: clamp(16px, 2.5vw, 30px); box-shadow: 0 1px 2px rgb(30 51 80 / 0.2), 0 20px 44px rgb(30 51 80 / 0.2); }

.own { background: var(--cream); padding-block: clamp(4rem, 8vw, 7rem) clamp(2.5rem, 4vw, 3.5rem); }
.own .split { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr); }
.own-art { margin: 0; justify-self: center; max-width: 24.9rem; transform: rotate(-4deg); }
.facts { list-style: none; padding: 0; margin: 1.6rem 0 2.2rem; font-size: clamp(1.15rem, 1.45vw, 1.35rem); }
.facts li { padding: 0.7rem 0; border-top: 1px solid rgb(59 43 31 / 0.16); }
.facts li:last-child { border-bottom: 1px solid rgb(59 43 31 / 0.16); }

/* Footer, with the app's embossed footer line */
.foot { background: var(--cream); padding: 0.5rem var(--gutter) 3rem; text-align: center; font-size: 0.95rem; color: var(--ink-soft); }
.foot p { max-width: none; }
.foot-emboss { font-size: 1.05rem; font-weight: 600; color: rgb(59 43 31 / 0.3); text-shadow: 0 1px 0 rgb(255 255 255 / 0.9); margin-bottom: 1.2rem; }
.foot nav { display: flex; justify-content: center; gap: 1.5rem; margin: 0.9rem 0 1.5rem; }
.foot-legal { font-size: 0.75rem; opacity: 0.7; }

/* Privacy and Support */
.doc { background: var(--cream); }
.doc .nav { position: static; }
.doc main { max-width: 42rem; margin-inline: auto; padding: clamp(2rem, 6vw, 4rem) var(--gutter) 4rem; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.doc h2 { font-size: 1.35rem; margin-top: 2.4rem; }
.doc p { margin-top: 0.9rem; max-width: 38em; }
.doc .lead { margin-top: 0.8rem; }
.doc ol { padding-left: 1.3rem; margin: 0.9rem 0 0; }
.doc li { margin-top: 0.3rem; }
.doc .updated { margin-top: 2.5rem; font-size: 0.9rem; color: var(--ink-soft); }

/* Too narrow for words beside the picture: words on top, both halves starting level, picture centred below. */
@media (max-width: 1180px) {
  .pair-half { grid-template-columns: 1fr; align-content: start; justify-items: center; gap: 2.2rem; }
  .pair-copy { justify-self: start; }
  .pair-half .phone { width: clamp(13rem, 24vw, 15.5rem); }
  .fan { width: clamp(16rem, 34vw, 21rem); align-self: center; }
}

@media (max-width: 860px) {
  .nav-links a:not(.nav-get) { display: none; }
  .nav-studio span { display: none; }
  .nav-studio { padding-right: 0.8rem; margin-right: 0.8rem; }
  .hero { grid-template-columns: 1fr; padding-top: 5rem; gap: 0.25rem; }
  .hero-copy { justify-self: center; text-align: center; display: contents; }
  .hero-copy h1 { order: 1; text-align: center; }
  .hero-copy .lead { order: 2; text-align: center; margin: 0.6rem auto 0; }
  .hero-machine { order: 4; justify-self: center; width: min(100%, 30rem); }
  /* The badge goes above the typewriter so it is on the first screen; its note follows the machine. */
  .hero-copy .get { display: contents; }
  .hero .badge { order: 3; justify-self: center; margin-top: 0.9rem; }
  .hero .tw-top { margin-top: 6cqw; }
  .hero .badge img { width: 150px; height: 50px; }
  .hero .get-note { order: 5; text-align: center; margin: 1.4rem auto 0; }
  .split, .own .split { grid-template-columns: 1fr; }
  .sheet { max-width: 26rem; margin-inline: auto; }
  .stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 24rem; }
  .pair { grid-template-columns: 1fr; }
  .pair-half:first-child, .pair-half:last-child { padding-inline: var(--gutter); }
  .pair-half .phone { width: min(15.5rem, 64vw); }
  .fan { width: min(20rem, 84vw); }
  .scene-row li, .scene-row li:nth-child(-n + 2) { grid-column: span 3; }
  .scene-row li:first-child { grid-column: span 6; }
  .own-art { max-width: 17.8rem; order: 2; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-travel, .tw-travel.returning, .tw-paper.leaving, .tw-key { transition: none; }
  .tw-paper.arriving, .tw-line.fed, .tw-caret { animation: none; }
}
