/* Marleya Studio — colour chapters. Every section is one flat field; every tool on the page is a demo. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

:root {
  --void: #0c0a0a;
  --deep: #34151a;
  --wine: #722f37;
  --rose: #c9577a;
  --rose-2: #bb4b6d;
  --bone: #efe6de;
  --bone-2: #e4d8cd;
  --soft-on-dark: #c8bcb3;
  --soft-on-bone: #6e3a40;

  --display: 'Red Hat Display', system-ui, sans-serif;
  --card-face: 'Zilla Slab', Georgia, serif;

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.4rem + 4.6vw, 6rem);
  --step-giant: clamp(3.5rem, 12.2vw, 13rem);

  --m: clamp(16px, 2vw, 28px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

body {
  background: var(--void); color: var(--bone);
  font-family: var(--display); font-size: var(--step-body); font-weight: 400;
  line-height: 1.5; overflow-x: clip;
}
::selection { background: var(--bone); color: var(--void); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.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: var(--m); top: var(--m); z-index: 80;
  background: var(--bone); color: var(--void); padding: 0.8rem 1.1rem; font-weight: 500; text-decoration: none;
  transform: translateY(-180%); transition: transform 200ms var(--ease-out);
}
.skip-link:focus { transform: none; }
p { text-wrap: pretty; max-width: 75ch; }

.giant {
  font-weight: 900; text-transform: uppercase;
  font-size: var(--step-giant); line-height: 0.86; letter-spacing: -0.035em;
}
.head {
  font-weight: 900; text-transform: uppercase;
  font-size: var(--step-head); line-height: 0.9; letter-spacing: -0.03em; text-wrap: balance;
}
.lead { font-size: var(--step-lead); line-height: 1.3; }

/* Buttons: square, flat */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.8rem 1.4rem; border: 0; border-radius: 0; cursor: pointer;
  background: var(--void); color: var(--bone); font-weight: 500; text-decoration: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn--bone { background: var(--bone); color: var(--void); }
.btn--rose { background: var(--rose); color: var(--void); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--wine); color: var(--bone); }
  .btn--rose:hover { background: var(--bone); color: var(--void); }
}
.link { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.22em; }

/* ── Header that takes the chapter's ink ───────────────── */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; align-items: center; gap: 1rem;
  padding: 14px var(--m);
  color: var(--header-ink, var(--void));
  background: var(--header-bg, var(--rose));
  transition: color 300ms ease, background-color 300ms ease;
  pointer-events: none;
}
.header > * { pointer-events: auto; }
.header a { text-decoration: none; }
.wordmark { font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; }
.where { font-size: var(--step-small); }
.header nav ul { display: flex; gap: 1.4rem; list-style: none; }
.header nav a { position: relative; }
.header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .header nav a:hover::after { transform: scaleX(1); } }
.header-end { justify-self: end; display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; }
.ach-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem;
  background: transparent; border: 0; cursor: pointer; font-weight: 500;
}
.ach-btn .pips { display: inline-flex; gap: 3px; }
.ach-btn .pips i { width: 8px; height: 14px; background: currentColor; opacity: 0.28; transition: opacity 300ms ease, transform 300ms var(--ease-out); }
.ach-btn .pips i.on { opacity: 1; transform: scaleY(1.15); }
.header .btn { white-space: nowrap; background: var(--header-ink, var(--void)); color: var(--header-bg, var(--rose)); min-height: 44px; transition: transform var(--t-press) var(--ease-out), background-color 300ms ease, color 300ms ease; }
.nav-toggle { display: none; background: none; border: 0; min-height: 44px; padding: 0 0.5rem; font-weight: 500; cursor: pointer; }

/* Achievements panel and toasts (they float, so they may cast a shadow) */
.ach-panel {
  position: fixed; top: 68px; right: var(--m); z-index: 60; width: min(360px, calc(100vw - 2 * var(--m)));
  background: var(--bone); color: var(--void); padding: 18px;
  box-shadow: 0 18px 50px rgba(12, 10, 10, 0.45); /* taste-skill-ignore: floating panel */
  transform-origin: top right;
}
.ach-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ach-panel { transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); @starting-style { opacity: 0; transform: translateY(-6px) scale(0.98); } }
}
.ach-panel h2 { font-weight: 900; text-transform: uppercase; font-size: 1.4rem; letter-spacing: -0.02em; }
.ach-panel p { font-size: var(--step-small); margin: 4px 0 14px; }
.ach-panel ul { list-style: none; display: grid; gap: 6px; }
.ach-panel li { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: 10px 12px; background: var(--bone-2); }
.ach-panel li b { font-weight: 700; }
.ach-panel li span { grid-column: 1; font-size: var(--step-small); }
.ach-panel li em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-size: var(--step-small); font-weight: 700; }
.ach-panel li.on { background: var(--rose); }
.toasts { position: fixed; left: var(--m); bottom: var(--m); z-index: 70; display: grid; gap: 8px; }
.toast {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; align-items: center;
  background: var(--void); color: var(--bone); padding: 14px 18px; width: min(360px, calc(100vw - 2 * var(--m)));
  box-shadow: 0 14px 40px rgba(12, 10, 10, 0.4); /* taste-skill-ignore: floating toast */
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
@media (prefers-reduced-motion: no-preference) { .toast { @starting-style { opacity: 0; transform: translateY(100%); } } }
.toast.leaving { opacity: 0; transform: translateY(30%); transition-duration: 180ms; }
.toast img { grid-row: 1 / 3; width: 38px; height: 38px; filter: invert(0); background: var(--rose); padding: 4px; }
.toast small { font-size: var(--step-small); color: var(--soft-on-dark); }
.toast b { font-weight: 700; }

/* ── Chapters ──────────────────────────────────────────── */
.chapter { position: relative; min-height: 90svh; padding: 110px var(--m) clamp(56px, 7vw, 110px); }
.f-rose { background: var(--rose); color: var(--void); }
.f-void { background: var(--void); color: var(--bone); }
.f-bone { background: var(--bone); color: var(--void); }
.f-wine { background: var(--wine); color: var(--bone); }
.f-deep { background: var(--deep); color: var(--bone); }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--m); }

/* 1 · Hero */
.hero { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-top: 90px; }
.hero h1 { align-self: center; text-align: center; }
.hero h1 .row { display: block; }
.pill {
  display: inline-block; position: relative; vertical-align: 0.04em;
  height: 0.7em; width: 1.95em; border-radius: 999px; overflow: hidden; background: var(--wine);
  margin-right: 0.12em; cursor: pointer;
}
.pill img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 700ms ease, transform 2200ms var(--ease-out); transform: scale(1.12); }
.pill img.on { opacity: 1; transform: none; }
.hero-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: var(--m); }
.hero-foot .btn { justify-self: start; }
.hero-foot p { grid-column: 3 / 5; font-size: var(--step-lead); line-height: 1.3; max-width: 30ch; }
.hero-foot .hero-hint { grid-column: 2; align-self: center; font-size: var(--step-small); }

/* 2 · The legendary card */
.card-chapter { min-height: 100svh; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(24px, 4vw, 64px); }
.card-chapter .side { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.card-chapter .side.r { align-items: flex-end; text-align: right; justify-content: flex-end; }
.card-chapter h2 { font-family: var(--card-face); font-weight: 600; text-transform: none; font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.025em; max-width: 10ch; }
.card-chapter .side p { max-width: 30ch; color: var(--soft-on-dark); }
.card-stage { perspective: 1400px; touch-action: pan-y; }
.card {
  position: relative; width: min(30vw, 420px); aspect-ratio: 5 / 7; cursor: pointer;
  transform-style: preserve-3d; transform: rotateY(var(--ry, -12deg)) rotateX(var(--rx, 5deg));
  transition: transform 420ms var(--ease-out);
  background: none; border: 0; padding: 0; text-align: left; display: block;
}
.card.dragging { transition: transform 80ms linear; }
.card .face {
  position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden;
  background: var(--bone); color: var(--void); padding: 14px;
  display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 10px;
}
.card .back { transform: rotateY(180deg); background: var(--wine); color: var(--bone); grid-template-rows: auto 1fr auto; }
.card.flipped { --flip: 180deg; }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--flip, 0deg)); transition: transform 700ms var(--ease-in-out); }
.c-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--card-face); font-weight: 700; font-size: 1.35rem; background: var(--wine); color: var(--bone); padding: 8px 12px; }
.c-top small { font-size: 0.85rem; font-weight: 500; }
.c-art { background: var(--rose); overflow: hidden; min-height: 0; }
.c-art img { width: 100%; height: 100%; object-fit: cover; }
.c-type { font-family: var(--card-face); font-weight: 600; font-size: 1rem; border-bottom: 2px solid var(--wine); padding-bottom: 6px; display: flex; justify-content: space-between; }
.c-rules { font-size: 0.9rem; line-height: 1.4; }
.c-rules b { color: var(--wine); }
.c-rules i { display: block; margin-top: 6px; color: #5a504b; }
.c-stats { display: flex; justify-content: space-between; align-items: center; font-family: var(--card-face); font-weight: 700; }
.c-stats span:last-child { background: var(--void); color: var(--bone); padding: 4px 10px; }
.shine { position: absolute; top: -20%; bottom: -20%; width: 28%; left: 0; background: rgba(255, 255, 255, 0.42); mix-blend-mode: soft-light; transform: translateX(var(--shine, -120%)) skewX(-18deg); pointer-events: none; }
.back .c-top { background: var(--void); }
.back-mark { display: grid; place-items: center; }
.back-mark img { width: 46%; height: auto; }
.back dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.back dl div { background: rgba(12, 10, 10, 0.28); padding: 8px 10px; }
.back dt { font-size: 0.8rem; }
.back dd { font-family: var(--card-face); font-weight: 700; font-size: 1.4rem; line-height: 1; }

/* 3 · Tools at poster scale */
.tools { padding-top: 18vh; padding-bottom: 18vh; }
.tool {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--m); align-items: first baseline;
  padding: 0.18em 0; text-decoration: none;
}
.tool .t-name { grid-column: 1 / 9; font-weight: 900; text-transform: uppercase; font-size: var(--step-head); line-height: 1; letter-spacing: -0.035em; transition: color var(--t-hover) ease, transform 300ms var(--ease-out); }
.tool .t-desc { grid-column: 9 / 13; max-width: 34ch; }
.tool--title .t-name { color: var(--soft-on-bone); }
@media (hover: hover) and (pointer: fine) {
  a.tool:hover .t-name { color: var(--wine); transform: translateX(0.12em); }
}

/* 4 · Work wall */
.work-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.work-head p { max-width: 38ch; }
.wall { margin-top: 32px; display: flex; flex-direction: column; gap: 8px; }
.wall-row { display: flex; gap: 8px; }
.wall-row:nth-child(4n+1) { height: 240px; }
.wall-row:nth-child(4n+2) { height: 360px; }
.wall-row:nth-child(4n+3) { height: 200px; }
.wall-row:nth-child(4n+4) { height: 300px; }
.tile { position: relative; flex: var(--r, 1.6) 1 0; min-width: 0; display: flex; flex-direction: column; text-decoration: none; }
.tile .shot { flex: 1; min-height: 0; overflow: hidden; background: var(--deep); }
.tile .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 600ms var(--ease-out), opacity 200ms ease; }
.tile .cap { display: flex; justify-content: space-between; gap: 1rem; padding-top: 6px; font-size: var(--step-small); }
.tile .cap b { font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .wall:hover .tile .shot img { opacity: 0.55; }
  .wall .tile:hover .shot img { opacity: 1; transform: scale(1.04); }
}

/* 5 · Play */
.play { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--m); align-items: end; row-gap: 32px; }
.play-text { grid-column: 1 / 5; display: grid; gap: 1.25rem; align-content: end; }
.play-text p { color: var(--soft-on-dark); max-width: 34ch; }
.play-text ul { list-style: none; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.play-frame { grid-column: 5 / 13; aspect-ratio: 16 / 10; position: relative; background: #07060a; overflow: hidden; }
.play-frame img { width: 100%; height: 100%; object-fit: cover; }
.play-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-start { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 10, 10, 0.35); border: 0; cursor: pointer; }
.play-start span { background: var(--rose); color: var(--void); font-weight: 900; text-transform: uppercase; font-size: var(--step-lead); padding: 0.7em 1.2em; transition: transform var(--t-press) var(--ease-out); }
.play-start:active span { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .play-start:hover span { background: var(--bone); } }

/* 6 · Build your quest */
.build-intro { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; }
.build-intro p { max-width: 40ch; }
.items { margin-top: 40px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.item {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  min-height: 170px; padding: 16px; text-align: left; border: 0; cursor: pointer;
  background: var(--bone-2); color: var(--void);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.item:active { transform: scale(0.97); }
.item b { font-size: var(--step-lead); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.item span { font-size: var(--step-small); }
.item[data-kind="addon"] { background: var(--rose); }
.item[data-kind="monthly"] { background: var(--wine); color: var(--bone); }
@media (hover: hover) and (pointer: fine) { .item:hover { background: #d9cabd; } .item[data-kind="addon"]:hover { background: var(--rose-2); } .item[data-kind="monthly"]:hover { background: #5f2730; } }
.item[aria-pressed="true"], .item[aria-pressed="true"]:hover { background: var(--void); color: var(--bone); }
.legend { margin-top: 14px; display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: var(--step-small); }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { width: 12px; height: 12px; display: inline-block; }
.legend .l-base i { background: var(--bone-2); box-shadow: inset 0 0 0 2px var(--soft-on-bone); } /* taste-skill-ignore: swatch edge */
.legend .l-addon i { background: var(--rose); }
.legend .l-month i { background: var(--wine); }
.legend .l-on i { background: var(--void); }
.meter { margin-top: 32px; background: var(--void); color: var(--bone); padding: clamp(18px, 2.4vw, 32px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--m); row-gap: 20px; align-items: end; }
.levels { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.level { position: relative; height: 44px; background: #241c1a; overflow: hidden; }
.level .fill { position: absolute; inset: 0; background: var(--rose); transform: scaleX(0); transform-origin: left; transition: transform 600ms var(--ease-out); }
.level.full .fill { transform: scaleX(1); }
.level > span:last-child { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--bone); transition: color 300ms ease; }
.level.full > span:last-child { color: var(--void); }
.meter-total { grid-column: 1 / 8; grid-row: 1; }
.meter-total small { display: block; margin-top: 10px; font-size: var(--step-small); color: var(--soft-on-dark); }
.meter-total strong { display: block; font-weight: 900; font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.meter-total p { margin-top: 6px; font-size: var(--step-small); color: var(--soft-on-dark); }
.meter .btn { grid-column: 9 / 13; grid-row: 1; justify-self: end; }

/* 7 · Pricing that steps up */
.levels-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.levels-up .plan { display: flex; flex-direction: column; text-decoration: none; }
.levels-up .plan:nth-child(2) { height: 400px; }
.levels-up .plan:nth-child(3) { height: 520px; }
.levels-up .plan:nth-child(4) { height: 640px; }
.levels-up { position: relative; }
.levels-up h2 { position: absolute; top: 0; left: 0; max-width: 8ch; }
.plan-body { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 0.6rem; }
.plan-name { font-weight: 900; text-transform: uppercase; font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1; }
.plan-price { font-weight: 900; font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-usd { font-size: var(--step-small); margin-bottom: 0.6rem; }
.plan ul { list-style: none; display: grid; gap: 0.3rem; }
.plan-btn { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 24px; font-weight: 700; transition: background-color var(--t-hover) ease; }
.p1 { background: var(--bone); color: var(--void); } .p1 .plan-btn { background: var(--bone-2); }
.p2 { background: var(--rose); color: var(--void); } .p2 .plan-btn { background: var(--rose-2); }
.p3 { background: var(--void); color: var(--bone); } .p3 .plan-btn { background: #241c1a; }
@media (hover: hover) and (pointer: fine) { .plan:hover .plan-btn { background: var(--wine); color: var(--bone); } }
.plan:active .plan-btn { transform: scale(0.99); }
.pricing-note { margin-top: 24px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* 8 · About: inset panel, shaped photograph */
.about-chapter { padding: 20px; min-height: 0; }
.panel { position: relative; background: var(--wine); color: var(--bone); min-height: 104svh; overflow: hidden; padding: 56px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--m); }
.panel h2 { grid-column: 1 / 7; grid-row: 1; }
.panel .shape { position: absolute; left: 56px; bottom: -8vw; width: 38vw; aspect-ratio: 4 / 5; clip-path: inset(0 round 50% 50% 0 0); overflow: hidden; }
.panel .shape img { width: 100%; height: 100%; object-fit: cover; }
.panel-text { grid-column: 8 / 13; grid-row: 1; display: grid; gap: 48px; align-content: start; }
.panel-text h3 { font-size: var(--step-lead); font-weight: 700; margin-bottom: 0.4rem; }
.panel-text .btn { justify-self: start; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.facts div { background: rgba(12, 10, 10, 0.3); padding: 12px 14px; }
.facts dt { font-size: var(--step-small); color: var(--soft-on-dark); }
.facts dd { font-weight: 700; }

/* 9 · Contact in display rows */
.contact { padding: 0; min-height: 0; }
.contact-head { padding: 110px var(--m) 40px; display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.contact-head p { max-width: 36ch; }
.row-field { display: block; background: var(--rose); }
.row-field:nth-of-type(even) { background: var(--rose-2); }
.row-field input, .row-field textarea {
  width: 100%; border: 0; background: transparent; color: var(--void); border-radius: 0;
  font-size: var(--step-head); font-weight: 400; line-height: 1; letter-spacing: -0.03em;
  padding: 48px var(--m) 22px; resize: none;
}
.row-field textarea { min-height: 2.6em; line-height: 1.05; }
.row-field ::placeholder { color: #4a1a26; }
.row-field input:focus, .row-field textarea:focus { outline: none; background: var(--bone); }
.send-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--void); color: var(--bone); padding: 22px var(--m); flex-wrap: wrap; }
.send-row p { font-size: var(--step-small); max-width: 60ch; }
.send-row .btn { font-size: var(--step-lead); min-height: 64px; padding: 0 2rem; }
.hp { position: absolute; left: -9999px; }
.form-done { padding: 48px var(--m) 72px; }
.form-done h3 { font-size: var(--step-head); font-weight: 900; text-transform: uppercase; line-height: 0.9; letter-spacing: -0.03em; }
.form-error { background: var(--void); color: var(--bone); padding: 0 var(--m) 22px; }

/* 10 · Footer of tiles */
.footer { padding: 10px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; background: var(--void); }
.ft { padding: 20px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; background: #1a1412; color: var(--bone); }
.ft-a { grid-column: 1 / 5; }
.ft-a p:first-child { font-size: var(--step-lead); line-height: 1.25; max-width: 24ch; }
.ft-a small { font-size: var(--step-small); color: var(--soft-on-dark); }
.ft-b { grid-column: 5 / 8; }
.ft-b ul { list-style: none; display: grid; gap: 0.25rem; }
.ft-b a, .ft-d a { text-decoration: none; }
.ft-b a:hover { text-decoration: underline; }
.ft-c { grid-column: 8 / 10; }
.ft-c strong { font-weight: 900; font-size: var(--step-lead); line-height: 1; font-variant-numeric: tabular-nums; }
.ft-d { grid-column: 10 / 13; justify-content: flex-end; }
.ft-d a { font-size: var(--step-lead); text-decoration: underline; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.ft-mark { grid-column: 1 / 9; min-height: 320px; background: var(--bone); color: var(--wine); display: grid; place-items: center; }
.ft-mark span { font-weight: 900; text-transform: uppercase; font-size: var(--step-giant); letter-spacing: -0.04em; line-height: 0.85; }
.ft-go { grid-column: 9 / 13; min-height: 320px; background: var(--rose); color: var(--void); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; }
.ft-go span { font-weight: 900; text-transform: uppercase; font-size: var(--step-lead); line-height: 1; max-width: 10ch; }
.ft-go svg { align-self: flex-end; width: 88px; height: 88px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ft-go:hover svg { transform: translate(6px, -6px); } }
.credits { grid-column: 1 / -1; padding: 16px 10px 8px; font-size: var(--step-small); color: var(--soft-on-dark); max-width: 75ch; }
.credits a { color: var(--bone); }

/* ── Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(26px); animation: rise 900ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .hero h1 .row { overflow: hidden; padding-bottom: 0.04em; }
  .js .hero h1 .row > span { display: inline-block; transform: translateY(105%); animation: line-up 1000ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .levels-up .plan[data-reveal] { transform: translateY(80px); }
  .js .levels-up .plan[data-reveal].is-in { transform: none; }
  .js .card-stage[data-reveal] { transform: translateY(60px) rotate(-4deg); }
  .js .card-stage[data-reveal].is-in { transform: none; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes line-up { to { transform: none; } }

/* ── Tablet ─────────────────────────────────────────── */
@media (max-width: 1320px) {
  .header { grid-template-columns: auto 1fr auto; }
  .where, .ach-btn .label { display: none; }
  .header nav { justify-self: center; }
}
@media (max-width: 1080px) {
  .header { grid-template-columns: auto 1fr auto; }
  .where { display: none; }
  .header nav { justify-self: center; }
  .card-chapter { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-top: 120px; }
  .card-chapter .side, .card-chapter .side.r { align-items: center; text-align: center; }
  .card { width: min(70vw, 400px); }
  .tool .t-name { grid-column: 1 / -1; }
  .tool .t-desc { grid-column: 1 / -1; margin: 0.3rem 0 1.4rem; }
  .play-text, .play-frame { grid-column: 1 / -1; }
  .items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel-text { grid-column: 1 / -1; grid-row: 2; margin-top: 48px; }
  .panel h2 { grid-column: 1 / -1; }
  .panel .shape { position: relative; left: auto; bottom: auto; grid-column: 1 / -1; width: 70%; margin: 48px 0 -56px auto; }
  .ft-a, .ft-b, .ft-c, .ft-d { grid-column: span 6; }
  .ft-mark, .ft-go { grid-column: 1 / -1; }
}

/* ── Phone ──────────────────────────────────────────── */
@media (max-width: 760px) {
  .chapter { padding-top: 90px; }
  .header { grid-template-columns: 1fr auto; padding: 10px var(--m); }
  .header nav { position: fixed; inset: 64px 10px auto 10px; display: none; }
  .header nav.open { display: block; }
  .header nav ul { flex-direction: column; gap: 0; background: var(--bone); color: var(--void); padding: 8px; box-shadow: 0 18px 50px rgba(12, 10, 10, 0.45); } /* taste-skill-ignore: open menu */
  .header nav a { display: block; padding: 0.9rem 0.8rem; font-size: 1.25rem; }
  .header .btn { display: none; }
  .nav-toggle { display: inline-block; }
  .ach-btn { padding: 0 0.4rem; }
  .ach-btn .label { display: none; }
  .hero h1 { font-size: 15vw; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-foot p { grid-column: 1; grid-row: 1; font-size: 1.125rem; }
  .hero-hint { display: none; }
  .card { width: min(78vw, 360px); }
  .tools { padding-top: 12vh; padding-bottom: 12vh; }
  .tool .t-name { font-size: 10.5vw; }
  .tool .t-desc { padding-left: var(--m); }
  .wall-row { flex-wrap: wrap; height: auto !important; }
  .wall-row .tile { flex: 1 1 100%; height: 250px; }
  .wall-row .tile.extra { display: none; }
  .items { grid-template-columns: 1fr 1fr; }
  .item { min-height: 140px; }
  .meter .btn, .meter-total { grid-column: 1 / -1; justify-self: stretch; }
  .meter .btn { grid-row: 3; }
  .levels-up { grid-template-columns: 1fr; row-gap: 56px; }
  .levels-up h2 { position: static; max-width: none; margin-bottom: 8px; }
  .levels-up .plan, .levels-up .plan:nth-child(n) { height: auto; grid-column: 1; grid-row: auto; margin-top: 0; }
  .plan-body { padding-bottom: 32px; }
  .about-chapter { padding: 10px; }
  .panel { padding: 32px 20px; }
  .panel .shape { width: 86vw; margin: 40px auto -32px; }
  .facts { grid-template-columns: 1fr; }
  .row-field input, .row-field textarea { padding-top: 34px; }
  .send-row .btn { width: 100%; }
  .footer { grid-template-columns: 1fr 1fr; padding: 6px; gap: 6px; }
  .ft-mark { grid-column: 1 / -1; min-height: 160px; order: -2; }
  .ft-mark span { font-size: 18vw; }
  .ft-go { grid-column: 1 / -1; min-height: 180px; order: -1; }
  .ft-a, .ft-b, .ft-c, .ft-d { grid-column: span 1; min-height: 180px; }
  .ft-a { grid-column: 1 / -1; }
}
