/*
 * Saga prototype kit (docs/prototype-kit/README.md): the page, side-by-side
 * comparison rows, a phone, the deck card with both faces, and the pieces
 * question and title cards are built from. Colors, radii and fonts come from
 * tokens.css (a checked copy of src/global.css), so prototypes match the app.
 */
@import url("https://fonts.googleapis.com/css2?family=Familjen+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --font: "Familjen Grotesk", system-ui, sans-serif;
  --phone-w: 390px;
  --phone-h: 844px;
  /* Side-by-side rows draw phones smaller; the pieces inside stay true to 390 pt. */
  --phone-scale: 0.62;
  --ink: var(--color-bone);
  --muted: var(--color-stone);
  --page: var(--color-basalt);
  --raised: var(--color-granite);
  --accent: var(--color-ochre);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); }
body { padding: 32px 16px 96px; }
.page { max-width: 1280px; margin: 0 auto; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.02; letter-spacing: -0.02em; margin: 8px 0 12px; font-weight: 700; }
h2 { font-size: 28px; margin: 56px 0 8px; font-weight: 700; letter-spacing: -0.01em; }
p.lede { color: var(--muted); max-width: 64ch; line-height: 1.5; }
.note { background: var(--raised); border: 1px solid rgba(255,250,240,.08); border-radius: 16px; padding: 14px 16px; color: var(--muted); max-width: 72ch; line-height: 1.5; }

/* ── One decision, every option side by side, same size ───────────────── */
.compare {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(var(--phone-w) * var(--phone-scale));
  gap: 28px;
  overflow-x: auto;
  padding: 8px 2px 20px;
  scroll-snap-type: x mandatory;
}
.option { scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
.option > header { min-height: 64px; }
.option .tag { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--raised); font-size: 12px; font-weight: 700; margin-right: 8px; }
.option .name { font-weight: 600; }
.option .idea { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 4px; }
.option .face-label { color: var(--muted); font-size: 12px; text-align: center; }
.option.pick { outline: 2px solid var(--accent); outline-offset: 10px; border-radius: 28px; }

/* ── A phone at 390 × 844, scaled for comparing ───────────────────────── */
.phone-slot { width: calc(var(--phone-w) * var(--phone-scale)); height: calc(var(--phone-h) * var(--phone-scale)); }
.phone {
  width: var(--phone-w); height: var(--phone-h);
  transform: scale(var(--phone-scale)); transform-origin: top left;
  background: radial-gradient(120% 70% at 20% 0%, color-mix(in srgb, var(--glow, var(--accent)) 26%, transparent), transparent 60%), var(--page);
  border-radius: 54px; border: 10px solid #000; position: relative; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.status { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 14px 30px 0; font-size: 15px; font-weight: 600; }
.tabbar {
  position: absolute; left: 18px; right: 18px; bottom: 26px; height: 64px; border-radius: 32px;
  background: rgba(16,18,19,.74); border: 1px solid rgba(255,250,240,.14);
  display: flex; align-items: center; justify-content: space-around; color: var(--muted); font-size: 11px;
}
.tabbar .on { color: var(--accent); }

/* ── The deck card: two faces, tap to turn ────────────────────────────── */
.deck { position: absolute; left: 16px; right: 16px; top: 64px; bottom: 112px; perspective: 1200px; }
.card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 600ms cubic-bezier(.2,.7,.2,1); cursor: pointer; }
.card.turned { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-card, 28px); overflow: hidden; background: var(--color-granite);
  border: 1px solid rgba(255,250,240,.10);
  box-shadow: 0 28px 56px rgba(0,0,0,.5), 0 6px 14px rgba(0,0,0,.35);
}
.face.back { transform: rotateY(180deg); }
.face.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The question card's double-ruled frame (B3 "Intertitle"), on both faces. */
.frame {
  position: absolute; inset: 14px; border-radius: calc(var(--radius-card, 28px) - 10px);
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 55%, transparent);
  box-shadow: inset 0 0 0 4px var(--color-granite), inset 0 0 0 5px color-mix(in srgb, var(--tone, var(--accent)) 30%, transparent);
  display: flex; flex-direction: column; padding: 24px 20px 18px;
}
.frame .label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--tone, var(--accent)); }
.frame .question { font-size: 26px; line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; margin-top: 10px; }
.frame .body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; margin: 16px 0; }
/* The frame's foot: "Tap to answer" on the front, the toggle and "Swipe to continue" on the back. */
.frame .foot { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.hint { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); text-align: center; font-weight: 600; }

/* ── Tiles: the 2 × 2 grid every list answer uses ─────────────────────── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-tile, 16px); overflow: hidden;
  border: 1px solid rgba(255,250,240,.12); background: var(--color-granite); cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 30%); display: block; transition: filter 200ms; }
.tile .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 9px; font-size: 13px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.tiles.chosen .tile:not(.selected) img { filter: grayscale(.6) brightness(.45); }
.tile.selected { border: 2px solid var(--accent); }
.tile.selected::after {
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 12px;
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--color-bone);
}
.tile.empty { display: grid; place-items: center; color: var(--muted); border-style: dashed; }

/* ── Small pieces ─────────────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.toggle { width: 44px; height: 26px; border-radius: 13px; background: rgba(255,250,240,.16); position: relative; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-bone); transition: left 160ms; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 21px; }
.cameo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,250,240,.2); }
.corner-buttons { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(16,18,19,.4); border: 1px solid rgba(255,250,240,.14); color: var(--color-stone); }
.stamp {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg); opacity: 0; pointer-events: none;
  border: 3px solid var(--color-bone); border-radius: 12px; padding: 8px 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.card.stamped .stamp { opacity: 1; }
