/* mech for all: landing. Same desk as the app: ftprince.in paper, ink, coral, mustard, cutting mat. */

@font-face { font-family: "Bagel Fat One"; src: url(../fonts/bagel.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(../fonts/fredoka.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url(../fonts/caveat.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #f4ecdc;
  --paper-2: #ebe0c8;
  --cream: #fffaf0;
  --ink: #1e1b18;
  --ink-soft: #4a4239;
  --tomato: #d9573a;
  --red-ink: #b8402a;   /* tomato, darkened for small text on paper (AA) */
  --mustard: #e3a92b;
  --butter: #f8e08e;
  --pink: #f6b8c8;
  --sky: #9fd3ec;
  --lilac: #c9b8f2;
  --mint: #4fb286;
  --mint-soft: #c6e39a;
  --teal: #0f5c4d;
  --mat: #1d4a42;
  --mat-line: rgba(214, 239, 226, 0.1);

  --display: "Bagel Fat One", "Fredoka", sans-serif;
  --ui: "Fredoka", ui-rounded, system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --tech: "JetBrains Mono", ui-monospace, monospace;

  /* type scale: 1.333 on body, display sizes hand-tuned */
  --t-hero: clamp(64px, 11vw, 158px);
  --t-h2: clamp(42px, 6.4vw, 88px);
  --t-h3: 22px;
  --t-lede: clamp(18px, 1.45vw, 21px);
  --t-body: 17px;
  --t-small: 13px;
  --t-mono: 12px;

  --line: 2.5px solid var(--ink);
  --spring: cubic-bezier(0.3, 1.6, 0.5, 1);
  --out: cubic-bezier(0.2, 0.8, 0.25, 1);

  /* side gutter: tighter on phones, never under the notch in landscape */
  --gutter: max(clamp(16px, 4vw, 24px), env(safe-area-inset-left), env(safe-area-inset-right));
  --tap: 44px;
}

@property --mis-x { syntax: '<length>'; inherits: true; initial-value: 5px; }
@property --mis-y { syntax: '<length>'; inherits: true; initial-value: 4px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font: 400 var(--t-body) / 1.5 var(--ui);
  color: var(--ink);
  background:
    radial-gradient(circle, rgba(30, 27, 24, 0.08) 1px, transparent 1.6px) 0 0 / 15px 15px,
    var(--paper);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button, a, summary { touch-action: manipulation; } /* no double-tap zoom, no 300 ms wait */
:focus-visible { outline: 2.5px dashed var(--tomato); outline-offset: 3px; }
code { font-family: var(--tech); font-size: 0.9em; padding: 0 4px; border-radius: 4px; background: var(--paper-2); }

.wrap { width: min(1320px, 100% - 2 * var(--gutter)); margin-inline: auto; }
/* tilted tape and stickers poke past the edges; clip them here so phones never get a sideways scroll */
.page { overflow-x: clip; }
.mono { font-family: var(--tech); font-size: var(--t-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.hand { font-family: var(--hand); }
.fine { font-size: 11px; color: var(--ink-soft); }
.label { color: var(--red-ink); }

/* print grain over everything */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .26  0 0 0 0 .2  0 0 0 .14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- conveyor belt: moves only when you type ---------- */

.belt { height: calc(34px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); overflow: hidden; background: var(--mint); border-bottom: var(--line); }
.belt-track {
  display: flex;
  width: max-content;
  font: 400 15px/32px var(--display);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transform: translateX(var(--belt, 0px));
  transition: transform 0.4s var(--out);
}
.belt-track span { padding: 0 16px; }
.belt-track b { padding: 0 5px; border-radius: 4px; background: var(--ink); color: var(--cream); font-weight: 400; }

/* ---------- top bar ---------- */

.top { display: flex; align-items: center; gap: 28px; padding: 18px 0 0; }
.slip { padding: 5px 10px; border: 1.5px solid var(--red-ink); color: var(--red-ink); background: var(--cream); rotate: -1deg; }
.slip i { font-style: normal; opacity: 0.5; }
.nav { display: flex; gap: 22px; margin-left: auto; font-weight: 500; font-size: 15px; }
.nav a { white-space: nowrap; text-decoration: none; background: linear-gradient(var(--butter), var(--butter)) 0 85% / 0 40% no-repeat; transition: background-size 0.3s var(--out); }
@media (hover: hover) { .nav a:hover { background-size: 100% 40%; } }

.pill-dl, .btn-dl, .btn-ghost {
  display: inline-block;
  border: var(--line);
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s var(--out), box-shadow 0.15s var(--out);
}
.pill-dl { padding: 7px 16px; background: var(--butter); font-size: 15px; white-space: nowrap; }
.narrow-only { display: none; }
.btn-dl { padding: 15px 26px 16px; background: var(--red-ink); color: var(--cream); font-size: 19px; letter-spacing: 0.01em; }
.btn-ghost { padding: 10px 18px; background: var(--cream); font-size: 15px; }
@media (hover: hover) {
  .pill-dl:hover, .btn-dl:hover, .btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
}
.pill-dl:active, .btn-dl:active, .btn-ghost:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- riso type: two inks, slightly off-register ---------- */

.riso { position: relative; isolation: isolate; }
.riso .word { position: relative; display: inline-block; }
.riso .word::before, .riso .word::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.riso .word::before { /* coral halftone plate */
  translate: var(--mis-x, 5px) var(--mis-y, 4px);
  color: var(--tomato);
}
.riso .word::after { /* mustard plate */
  translate: calc(var(--mis-x, 5px) * -0.6) calc(var(--mis-y, 4px) * 0.5);
  color: var(--mustard);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ---------- section heads ---------- */

.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 44px; }
.slip-label { align-self: flex-end; padding: 5px 10px; border: 1.5px solid var(--red-ink); background: var(--cream); rotate: 2deg; }
.deck-copy .slip-label { align-self: flex-start; rotate: -2deg; }
.sec-head h2, .deck-copy h2, .sheet-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 6.4vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.025em;
}

/* scroll reveal: each child rises in as it reaches the viewport; children arriving together stagger */
.reveal > * { opacity: 0; transform: translateY(28px) rotate(var(--r, 0deg)); transition: opacity 0.6s var(--out), transform 0.75s var(--spring); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal > .in { opacity: 1; transform: rotate(var(--r, 0deg)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; scroll-behavior: auto !important; }
  .reveal > * { opacity: 1; transform: rotate(var(--r, 0deg)); }
}
@media (max-width: 1060px) {
  .top { gap: 18px; }
  .nav { gap: 16px; }
  .wide-only { display: none; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .top { justify-content: space-between; }
  .pill-dl { margin-left: auto; }
}
@media (max-width: 760px) {
  .narrow-only { display: inline; }
}
@media (max-width: 599px) {
  .top { padding-top: 14px; gap: 12px; }
  .slip { padding: 5px 8px; font-size: 11px; letter-spacing: 0.1em; }
  .sec-head { margin-bottom: 32px; }
}
@media (max-width: 359px) {
  .slip { letter-spacing: 0.04em; }
}
