/* Home page, "Chapters": a story told in rounded sheets that slide over each other.
   Ink, warm paper, burgundy and a soft pink. Fredoka for everything. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14171a;
  --ink-2: #23282d;
  --paper: #f3efe6;
  --paper-2: #e8e3d7;
  --mute-d: #9aa09f;
  --mute-l: #5d605c;
  --accent: #7a1430;
  --accent-hi: #941a3c;
  --pink: #f6b8c6;
  --round: clamp(22px, 3vw, 40px);
  --gutter: clamp(16px, 3.2vw, 44px);
  --font: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html.ch-page { background: var(--ink); scroll-behavior: auto; overflow-x: clip; }
.ch-page body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 400 1.0625rem/1.55 var(--font);
  overflow-x: clip;
}
.ch-page ::selection { background: var(--pink); color: var(--ink); }
.ch-page :focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.ch-page .light :focus-visible { outline-color: var(--ink); }

/* the About page styles share some class names; keep them out of this page */
.ch-page .lead { color: inherit; max-width: none; }
.ch-page .narrow { max-width: 30ch; }
.ch-page .steps li { border-top: 0; counter-increment: none; }
.ch-page .steps li::before { content: none; }
.ch-page .step { display: flex; padding-top: 26px; gap: 12px; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 16px var(--gutter);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 600; font-size: 19px; color: var(--paper);
  padding: 5px 14px 5px 5px; border-radius: 999px; background: rgba(20, 23, 26, 0.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand img { display: block; }
.bar-line { margin: 0; text-align: center; font-size: 15px; color: var(--mute-d); pointer-events: none; transition: opacity 0.3s; }
.is-scrolled .bar-line { opacity: 0; }
.bar-links { display: flex; gap: 8px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer;
  padding: 13px 20px; border-radius: 999px; border: 0;
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s;
}
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: translateY(0) scale(0.97); }
.pill-quiet { background: rgba(20, 23, 26, 0.72); color: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pill-quiet:hover { background: var(--ink-2); }
.pill-accent { background: var(--accent); color: var(--paper); font-weight: 600; }
.pill-accent:hover { background: var(--accent-hi); }
.pill-ink { background: var(--ink); color: var(--paper); }
.pill-ink:hover { background: var(--ink-2); }

.cta-short { display: none; }
.dlg-lead { margin: -10px 0 20px; color: var(--mute-l); font-size: 15px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slots .opt { margin: 0; }
.sound {
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(20, 23, 26, 0.72); color: var(--paper); display: grid; place-items: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sound .bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.sound i { width: 3px; height: 4px; background: currentColor; border-radius: 2px; transition: height 0.2s; }
.sound[aria-pressed="true"] { color: var(--pink); }
.sound[aria-pressed="true"] i { animation: eq 0.9s ease-in-out infinite; }
.sound[aria-pressed="true"] i:nth-child(2) { animation-delay: -0.3s; }
.sound[aria-pressed="true"] i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- Type ---------- */
.mega {
  margin: 0; font-weight: 600; text-transform: uppercase;
  font-size: clamp(52px, 10.4vw, 196px); line-height: 0.86; letter-spacing: -0.035em;
  text-wrap: balance;
}
.mid { margin: 0; font-weight: 600; text-transform: uppercase; font-size: clamp(36px, 5.4vw, 92px); line-height: 0.9; letter-spacing: -0.03em; }
.big { margin: 0; font-weight: 600; font-size: clamp(44px, 6vw, 104px); line-height: 0.9; letter-spacing: -0.03em; }
.lead { font-size: clamp(20px, 1.9vw, 30px); line-height: 1.25; font-weight: 500; margin: 0; }
.narrow { max-width: 30ch; margin-top: 28px; }
.small { font-size: 14px; color: var(--mute-d); margin: 0; }
[data-split] .w { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; vertical-align: top; padding-bottom: 0.04em; }
[data-split] .w > span { display: inline-block; will-change: transform; }

/* ---------- Chapters ---------- */
.ch { position: relative; }
.dark { background: var(--ink); color: var(--paper); }
.light { background: var(--paper); color: var(--ink); }
.sheet {
  border-radius: var(--round) var(--round) 0 0;
  margin-top: calc(var(--round) * -1);
  padding: 110px var(--gutter) 140px;
  transform-origin: 50% 0;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.18);
}
.ch-head { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; margin-bottom: 44px; opacity: 0.86; }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 6vw; margin-top: 56px; max-width: 1200px; }
.two p:not(.lead) { margin: 0; color: var(--mute-l); font-size: 18px; }

/* hero */
.hero { height: 260svh; }
.hero-pin { position: sticky; top: 0; height: 100svh; overflow: clip; display: grid; place-items: center; }
.hero-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-veil { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 62% 48% at 50% 50%, rgba(20, 23, 26, 0.82), rgba(20, 23, 26, 0.45) 55%, transparent 80%), linear-gradient(to top, rgba(20, 23, 26, 0.95) 0, rgba(20, 23, 26, 0.7) 18%, transparent 34%); }
.hero .mega { text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55); }
.hero .mega { position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter); font-size: clamp(54px, 11.4vw, 220px); pointer-events: none; mix-blend-mode: normal; }
.hero-sub {
  position: absolute; z-index: 2; bottom: 9svh; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 2 * var(--gutter))); text-align: center; margin: 0;
  font-size: clamp(17px, 1.4vw, 20px); color: var(--paper); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}
.hero-land { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 var(--gutter); gap: 30vw; opacity: 0; }
.hero-land p { margin: 0; font-weight: 600; font-size: clamp(24px, 2.8vw, 46px); line-height: 1; letter-spacing: -0.02em; text-transform: uppercase; }
.hero-land p:last-child { text-align: right; color: var(--pink); }
.hero-land small { display: block; font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--mute-d); margin-top: 12px; }
.scroll-cue { position: absolute; z-index: 2; bottom: 3svh; left: 50%; transform: translateX(-50%); margin: 0; font-size: 13px; color: var(--mute-d); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue span { width: 2px; height: 26px; border-radius: 2px; background: linear-gradient(var(--pink), transparent); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { from { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } to { transform: scaleY(0); transform-origin: bottom; } }

/* 01: scattered notes */
.chaos { list-style: none; margin: 70px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; max-width: 1100px; }
.chaos li {
  background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 18px; font-weight: 500; font-size: 17px;
  box-shadow: 0 10px 24px rgba(20, 23, 26, 0.08); rotate: var(--r, 0deg);
}
.chaos li:nth-child(3n) { background: var(--pink); }
.chaos li:nth-child(4n) { background: var(--ink); color: var(--paper); }

/* 02: steps that stack */
.steps { list-style: none; margin: 70px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step {
  background: var(--ink-2); border-radius: 26px; padding: 26px 24px 30px; min-height: 300px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.step .n { font-size: 15px; color: var(--pink); font-weight: 600; }
.step h3 { margin: auto 0 0; font-size: clamp(28px, 2.6vw, 40px); line-height: 1; font-weight: 600; }
.step p { margin: 0; color: var(--mute-d); font-size: 17px; }
.step:nth-child(4) { background: var(--accent); color: var(--paper); }
.step:nth-child(4) .n { color: var(--pink); }
.step:nth-child(4) p { color: rgba(243, 239, 230, 0.82); }

/* 03: products */
.product {
  display: grid; grid-template-columns: 0.9fr 1.3fr; gap: 5vw; align-items: center;
  min-height: 92svh; padding: 9svh 0; border-top: 1px solid rgba(20, 23, 26, 0.12); margin-top: 9svh;
}
.product.flip .p-text { order: 2; }
.p-text { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; max-width: 520px; }
.p-text p { margin: 0; font-size: 19px; color: var(--mute-l); }
.p-icon { border-radius: 18px; box-shadow: 0 10px 26px rgba(20, 23, 26, 0.18); }
.p-shots { position: relative; display: flex; justify-content: center; align-items: center; min-height: 520px; }
.p-shots img { display: block; height: auto; border-radius: 22px; box-shadow: 0 30px 70px rgba(20, 23, 26, 0.22); }
.p-shots .desk { width: 92%; border-radius: 16px; }
.p-shots .phone { width: 28%; position: absolute; right: 0; bottom: -4%; border: 6px solid var(--ink); border-radius: 30px; }
.p-shots.trio { gap: 3%; }
.p-shots.trio .phone { position: static; width: 31%; }
.p-shots.trio .phone:nth-child(2) { transform: translateY(-36px); }

/* 04: trades */
.trades { padding-bottom: 90px; }
.trade-stage { position: relative; height: 68svh; min-height: 420px; }
.trade-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; cursor: grab; touch-action: pan-y; }
.trade-3d:active { cursor: grabbing; }
.trade-name {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 0; margin: 0;
  font-size: clamp(90px, 21vw, 400px); color: rgba(243, 239, 230, 0.07); white-space: nowrap; pointer-events: none;
}
.trade-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 5vw; align-items: end; border-top: 1px solid rgba(243, 239, 230, 0.14); padding-top: 34px; }
.trade-pick { display: flex; flex-direction: column; gap: 18px; }
.trade-line { margin: 0; font-size: clamp(18px, 1.5vw, 22px); min-height: 2.6em; color: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 16px/1 var(--font); padding: 13px 20px; border-radius: 999px; cursor: pointer;
  background: var(--ink-2); color: var(--paper); border: 1px solid rgba(243, 239, 230, 0.12);
  transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: rgba(243, 239, 230, 0.35); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--paper); border-color: var(--pink); }

/* 05: falling tiles */
.drop { position: relative; height: 62svh; min-height: 420px; margin-top: 40px; border-bottom: 3px solid var(--ink); overflow: clip; }
.tile {
  position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 150px; height: 64px; border-radius: 999px; font-size: 22px; font-weight: 600;
  background: var(--ink); color: var(--paper); will-change: transform; user-select: none;
}
.tile:nth-child(3n + 4) { background: var(--accent); color: var(--paper); }
.tile:nth-child(3n + 5) { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.tile.t-img { width: 96px; height: 96px; border-radius: 24px; background: transparent; overflow: hidden; }
.tile.t-img img { width: 100%; height: 100%; display: block; }
.drop:not(.is-live) .tile { position: static; display: inline-grid; margin: 6px; }
.drop:not(.is-live) { display: flex; flex-wrap: wrap; align-content: flex-end; height: auto; min-height: 0; padding-bottom: 12px; }

/* end */
.end { text-align: center; padding-bottom: 90px; min-height: 100svh; display: flex; flex-direction: column; align-items: center; }
.end .ch-head { align-self: stretch; }
.glow { position: relative; margin: 6svh 0 34px; }
.glow::before {
  content: ""; position: absolute; inset: -140px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(196, 44, 88, 0.45), rgba(196, 44, 88, 0.1) 60%, transparent);
  animation: breathe 5s ease-in-out infinite;
}
.glow img { position: relative; display: block; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.7; } }
.end-title { margin: 0; font-size: clamp(26px, 2.6vw, 40px); font-weight: 600; }
.end-sub { margin: 10px 0 0; color: var(--mute-d); max-width: 40ch; }
.big-email { width: 100%; max-width: 1300px; margin-top: 7svh; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.big-email input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid rgba(243, 239, 230, 0.25);
  color: var(--paper); text-align: center; padding: 0 0 14px;
  font: 600 clamp(40px, 8.6vw, 160px)/1 var(--font); letter-spacing: -0.03em; text-transform: none;
  transition: border-color 0.3s;
}
.big-email input::placeholder { color: rgba(243, 239, 230, 0.32); text-transform: uppercase; }
.big-email input:focus { outline: none; border-bottom-color: var(--pink); }
.big-email input[aria-invalid="true"] { border-bottom-color: #ff8a7a; }
.end-note { margin: 18px 0 0; font-size: 14px; color: var(--mute-d); }

.legal { padding: 26px var(--gutter) 34px; font-size: 13px; color: var(--mute-d); text-align: center; border-top: 1px solid rgba(243, 239, 230, 0.1); }
.legal p { margin: 4px 0; }
.legal a { color: var(--paper); }

/* ---------- Dialogs (same forms as before, new look) ---------- */
.ch-page .dlg {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(460px, calc(100vw - 32px)); max-height: calc(100svh - 32px);
}
.ch-page .dlg::backdrop { background: rgba(10, 12, 14, 0.6); backdrop-filter: blur(4px); }
.ch-page .dlg[open] { animation: rise 0.4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.sheet-dlg { background: var(--paper); border-radius: 28px; padding: 30px; }
.sheet-dlg h2, .done-title { font: 600 40px/1 var(--font); text-transform: uppercase; letter-spacing: -0.02em; margin: 0 0 22px; }
.field { display: block; border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.hint { color: var(--mute-l); font-weight: 400; }
.field input:not([type="radio"]), .field textarea {
  width: 100%; box-sizing: border-box; font: 400 16px/1.45 var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid #d6d0c2; border-radius: 14px; padding: 12px 14px; resize: vertical;
}
.field input:not([type="radio"]):focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: #c2412b; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 6px; border: 1.5px solid #d6d0c2; border-radius: 14px; cursor: pointer; font-size: 15px; line-height: 1.35; }
.opt:has(input:checked) { border-color: var(--ink); background: #fff; }
.opt input { accent-color: var(--ink); margin: 2px 0 0; flex: none; }
.turnstile:empty { display: none; }
.turnstile { margin: 4px 0 12px; }
.form-status { color: #a33320; font-size: 14px; margin: 0 0 12px; }
.row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.btn-quiet, .btn-send { font: 600 15px/1 var(--font); padding: 14px 22px; border-radius: 999px; cursor: pointer; }
.btn-quiet { background: transparent; color: var(--mute-l); border: 1px solid transparent; }
.btn-quiet:hover { color: var(--ink); }
.btn-send { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-send:disabled { opacity: 0.7; cursor: progress; }
.done { display: none; }
.dlg.is-sent .form { display: none; }
.dlg.is-sent .done { display: block; }
.done-title { margin-bottom: 6px; }
.done .btn-quiet { margin-top: 18px; padding-left: 0; }

/* ---------- Phone ---------- */
@media (max-width: 900px) {
  .bar { grid-template-columns: auto 1fr; }
  .bar-line { display: none; }
  .bar-links { justify-content: flex-end; }
  .bar-links .pill-quiet { display: none; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .brand span { display: none; }
  .brand { padding: 5px; }
  .pill { padding: 12px 16px; font-size: 14px; }
  .sheet { padding: 84px var(--gutter) 100px; }
  .two, .trade-foot { grid-template-columns: 1fr; gap: 26px; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }
  .step h3 { margin-top: 20px; }
  .product { grid-template-columns: 1fr; min-height: 0; gap: 40px; }
  .product.flip .p-text { order: 0; }
  .p-shots { min-height: 0; }
  .p-shots .phone { width: 34%; }
  .tile { width: 112px; height: 50px; font-size: 17px; }
  .tile.t-img { width: 72px; height: 72px; border-radius: 18px; }
  .drop { height: 54svh; min-height: 360px; }
  .trade-stage { height: 52svh; min-height: 340px; }
  .hero-sub { bottom: 12svh; }
  .hero-land { grid-template-columns: 1fr; align-content: space-between; padding: 92px var(--gutter) 9svh; gap: 0; }
  .hero-land p, .hero-land p:last-child { text-align: center; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-page .dlg[open], .glow::before, .scroll-cue span, .sound i { animation: none !important; }
  .hero { height: auto; }
  .hero-pin { position: relative; }
}
