/* Sequitur: a quiet museum at night. One motif: the domino tile (two halves, a bar, one pip) is the stripe, every
   picture's frame, the button and the closing mark. One radius (14px), one accent (gold), flat surfaces. */
:root {
  --ground: #12130f;
  --tone: #1c1d18;
  --tone2: #272821;
  --ink: #eeede8;
  --muted: #b3ac9b;
  --paper: #ecebe6;
  --paper-ink: #1d1c17;
  --paper-muted: #5c574a;
  --gold: #e2ae4a;
  --on-gold: #1a1306;
  --night: #18223a;
  --green: #1f4237;
  --r: 14px;
  --m: 12px;
  --serif: 'Literata', Georgia, serif;
  --sans: 'Onest', system-ui, sans-serif;
  --ease: cubic-bezier(0.33, 0, 0.15, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--on-gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; margin: 0; }

/* ---------- the motif ---------- */
.plate { position: relative; border-radius: var(--r); overflow: hidden; background: var(--tone); }
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate::after { /* the domino's bar and pip, across every picture */
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; background: var(--ground); z-index: 2;
}
.plate::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--gold); z-index: 3;
}
.fade { opacity: 0; transition: opacity 1.6s var(--ease); }
.fade.on { opacity: 1; }

.btn { display: inline-flex; align-items: center; gap: 14px; font: 600 17px/1 var(--sans); text-decoration: none; border: 0; cursor: pointer; border-radius: var(--r); transition: transform 0.15s var(--ease), background 0.2s; }
.btn:active { transform: scale(0.97); }
.domino-btn { background: var(--paper-ink); color: var(--paper); padding: 0 0 0 22px; height: 56px; }
.domino-btn .pip { width: 56px; height: 56px; border-left: 3px solid var(--paper); display: grid; place-items: center; }
.domino-btn .pip::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.domino-btn:hover { background: #34322a; }

/* The app's domino (src/ui/domino.tsx): two pips, a bar, pivots on its front-bottom edge, falls with gravity. */
.dom { --c: var(--paper-ink); --p: var(--paper); flex: none; position: relative; width: var(--w); height: calc(var(--w) * 2.1); margin-right: calc(var(--w) * 0.4); border-radius: calc(var(--w) * 0.22); background: linear-gradient(var(--p), var(--p)) center / 64% max(1px, calc(var(--w) * 0.1)) no-repeat, var(--c); transform-origin: bottom right; transition: transform 0.26s cubic-bezier(0.33, 1, 0.68, 1), background-color 0.3s; }
.dom::before, .dom::after { content: ''; position: absolute; left: 50%; top: 18%; width: calc(var(--w) * 0.22); height: calc(var(--w) * 0.22); margin-left: calc(var(--w) * -0.11); border-radius: 50%; background: var(--p); }
.dom::after { top: auto; bottom: 18%; }
.dom.falling { transition: transform 0.32s cubic-bezier(0.55, 0, 1, 0.45), background-color 0.3s; }

/* ---------- hero: card beside the room ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--m); padding: var(--m); min-height: 100svh; }
.hero-card { background: var(--paper); color: var(--paper-ink); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 40px 28px; }
.stripe { --w: 18px; height: 96px; padding: 0 0 18px 6px; display: flex; align-items: flex-end; position: relative; }
.stripe::after { content: ''; position: absolute; left: -6px; right: -6px; bottom: 16px; height: 2px; border-radius: 1px; background: var(--paper-ink); opacity: 0.18; }
.stripe .dom.gold { --c: var(--gold); --p: var(--on-gold); }
.wordmark { width: clamp(120px, 12vw, 180px); height: auto; margin: auto 0 28px; }
.hero-card h1 { font-size: clamp(40px, 3.6vw, 56px); line-height: 1.05; max-width: 11ch; }
.lead { font-size: 17px; max-width: 36ch; margin: 24px 0 32px; color: var(--paper-ink); }
.hero-links { margin-top: auto; padding-top: 40px; display: flex; gap: 28px; font-size: 17px; }
.hero-links a { color: var(--paper-muted); text-decoration: none; }
.hero-links a:hover { color: var(--paper-ink); }
.hero-room { margin: 0; position: sticky; top: var(--m); height: calc(100svh - 2 * var(--m)); display: flex; flex-direction: column; gap: 10px; }
.hero-room .plate { flex: 1; }
.hero-room img.on { animation: drift 14s var(--ease) infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
.hero-room figcaption { position: relative; min-height: 26px; font-size: 13px; color: var(--muted); padding: 0 8px; }
.cap { position: absolute; inset: 0 8px; opacity: 0; transition: opacity 1.6s var(--ease); }
.cap.on { opacity: 1; }

/* ---------- showcase: square plate, spare text, a chain you can tip ---------- */
.showcase { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; padding: 160px 40px 120px; gap: 40px; align-items: center; }
.sec-h { grid-column: 1 / -1; font-size: 36px; line-height: 1.1; }
.mystery { font: 500 22px/1.4 var(--serif); margin: 12px 0 0; max-width: 30ch; }
.plate.square { aspect-ratio: 1; width: 100%; }
.showcase-text { display: flex; flex-direction: column; gap: 40px; justify-content: space-between; min-height: 100%; }
.tabs { display: flex; gap: 28px; }
.tabs button { font: 500 17px var(--sans); color: var(--muted); background: none; border: 0; padding: 8px 0; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--ink); text-decoration: underline 3px var(--gold); text-underline-offset: 10px; }
.story-title { font: 600 17px/1.3 var(--sans); letter-spacing: 0; margin: 0; color: var(--gold); }
.tiles { --w: 12px; display: flex; align-items: flex-end; height: 26px; margin: 28px 0 20px; }
.tiles .dom { --c: var(--tone2); --p: var(--ground); }
.tiles .dom.past { --c: #6f6a5d; }
.tiles .dom.now { --c: var(--gold); --p: var(--on-gold); }
.story-card { font: 400 22px/1.5 var(--serif); max-width: 34ch; min-height: 6.2em; margin: 0; }
.story-card.enter { animation: tipin 0.52s var(--ease); }
@keyframes tipin { from { opacity: 0; transform: translateY(24px) rotate(-1.5deg); } }
.choices { display: grid; gap: 8px; margin-top: 20px; max-width: 34ch; }
.choices button { text-align: left; font: 500 16px var(--sans); color: var(--ink); background: var(--tone); border: 0; border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: background 0.2s, transform 0.15s; }
.choices button:hover { background: var(--tone2); }
.choices button:active { transform: scale(0.98); }
.choices button.right { background: var(--gold); color: var(--on-gold); }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cell { height: 72px; border-radius: var(--r); border: 0; font: 600 17px var(--sans); display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s; }
.cell:active { transform: scale(0.98); }
.cell.ink { background: var(--ink); color: var(--ground); }
.cell.ink:hover { background: #fff; }
.cell.tone { background: var(--tone2); color: var(--ink); }
.cell.tone:hover { background: #33342c; }

/* ---------- how: one card, four fields ---------- */
.how { display: grid; grid-template-columns: repeat(4, 1fr); }
.field { min-height: 84svh; position: relative; padding: 28px; display: flex; flex-direction: column; }
.field h2 { font-size: 36px; line-height: 1.1; }
.f1 { background: var(--night); } .f2 { background: var(--green); } .f3 { background: var(--tone2); } .f4 { background: var(--gold); color: var(--on-gold); }
.phone-card { position: absolute; top: 34%; left: 50%; width: min(260px, 82%); transform: translateX(-50%); background: var(--paper); color: var(--paper-ink); border-radius: var(--r); padding: 18px; font-size: 13px; line-height: 1.45; transition: transform 0.15s var(--ease); display: flex; flex-direction: column; gap: 8px; }
.field:hover .phone-card { transform: translate(-50%, -6px); }
.phone-card p { margin: 0; font: 400 17px/1.45 var(--serif); }
.phone-card .pc-q { font-weight: 500; }
.pc-k { font-size: 13px; font-weight: 600; color: #8a5d0c; }
.pc-meta { font-size: 13px; color: var(--paper-muted); }
.pc-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pc-bar::before, .pc-bar::after { content: ''; flex: 1; height: 3px; background: #d2d0c7; border-radius: 2px; }
.pc-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.pc-opt { background: #dcdad2; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.pc-opt.pick { background: var(--gold); color: var(--on-gold); font-weight: 600; }
.clause { margin: auto 0 0; font: 500 22px/1.3 var(--serif); max-width: 14ch; }

/* ---------- features: sentences with switches ---------- */
.features { margin-top: 0; }
.feat-h { font-size: 56px; line-height: 1.05; padding: 120px 40px 40px; }
.band { min-height: 20vh; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 24px 40px; transition: background 0.45s var(--ease); }
.band .s { margin: 0; font: 500 36px/1.2 var(--serif); color: var(--muted); transition: color 0.3s; }
.band .then { margin: 0; color: var(--ink); max-width: 60ch; display: block; font: 400 17px/1.5 var(--sans); max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.45s var(--ease), opacity 0.45s, margin 0.45s; }
.band.on .s { color: var(--ink); }
.band.on .then { max-height: 4em; opacity: 1; margin-top: 10px; }
.band.on.b1 { background: var(--night); } .band.on.b2 { background: var(--green); } .band.on.b3 { background: var(--tone2); } .band.on.b4 { background: var(--night); } .band.on.b5 { background: var(--green); }
.switch { width: 2.2em; height: 1.2em; font-size: 40px; border-radius: 999px; border: 0; background: var(--tone2); position: relative; cursor: pointer; transition: background 0.3s; }
.switch i { position: absolute; top: 0.1em; left: 0.1em; width: 1em; height: 1em; border-radius: 50%; background: var(--muted); transition: transform 0.3s var(--ease), background 0.3s; }
.switch[aria-checked='true'] { background: var(--gold); }
.switch[aria-checked='true'] i { transform: translateX(1em); background: var(--on-gold); }

/* ---------- faq: filled tiles ---------- */
.faq { display: grid; grid-template-columns: 4fr 8fr; gap: 40px; padding: 160px 40px; align-items: start; }
.faq h2 { font-size: 56px; line-height: 1.05; position: sticky; top: 96px; }
.tiles-list { display: grid; gap: 8px; }
details { background: var(--tone); border-radius: var(--r); transition: background 0.3s; }
details[open] { background: var(--gold); color: var(--on-gold); }
summary { list-style: none; cursor: pointer; min-height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; font: 500 22px var(--sans); }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font: 400 30px/1 var(--sans); margin-left: 16px; flex: none; }
details[open] summary::after { content: '\2212'; }
details p { margin: 0; padding: 0 24px 24px; max-width: 52ch; font-size: 17px; }

/* ---------- cta: a sentence with a blank ---------- */
.cta { padding: 120px 40px; background: var(--paper); color: var(--paper-ink); display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; }
.blank { font: 500 32px/1.5 var(--serif); max-width: 26ch; display: block; margin: 0; }
.cta-main h2 { font-size: 56px; line-height: 1.05; margin-bottom: 32px; }
.cta-side { background: var(--paper-ink); border-radius: var(--r); width: min(100%, 440px); justify-self: end; overflow: hidden; }
.cta-side img { width: 100%; height: auto; padding: 12%; }
.blank input { font: inherit; width: 8.5em; vertical-align: baseline; border: 0; border-bottom: 2px solid var(--paper-ink); border-radius: 0; background: transparent; color: var(--paper-ink); padding: 0 0.1em; outline-offset: 6px; }
.blank input::placeholder { color: var(--paper-muted); font-style: italic; opacity: 0.8; }
.blank button { font: inherit; border: 0; border-radius: var(--r); background: var(--paper-ink); color: var(--paper); padding: 0.05em 0.45em 0.12em; margin-left: 0.1em; cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s; }
.blank button:hover { background: #34322a; }
.blank button:active { transform: scale(0.97); }
.after { font-size: 17px; color: var(--paper-ink); margin: 24px 0 0; max-width: 52ch; }

/* ---------- footer: the mark, built large ---------- */
.foot { padding: 56px 40px 40px; }
.mark { container-type: inline-size; display: flex; gap: 6px; }
.mark span { flex: 1; aspect-ratio: 1 / 1.7; background: var(--tone2); border-radius: var(--r); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0.16em; font: 500 11cqw/1 var(--serif); color: var(--ink); position: relative; }
.mark span:nth-child(3n+1) { background: var(--night); color: var(--ink); }
.mark span:nth-child(3n+2) { background: var(--green); color: var(--ink); }
.mark span.last { background: var(--gold); color: var(--on-gold); }
.mark span::before { content: ''; position: absolute; left: 50%; top: 13%; width: 10%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: currentColor; opacity: 0.5; }
.mark span::after { content: ''; position: absolute; left: 18%; right: 18%; top: 30%; height: 3px; background: currentColor; opacity: 0.35; border-radius: 2px; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 24px; margin-top: 56px; font-size: 17px; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-cols a { text-decoration: none; color: var(--muted); }
.foot-cols a:hover { color: var(--ink); }
.contact { margin: 0; color: var(--muted); }
.credits { font-size: 13px; color: var(--muted); margin: 48px 0 24px; max-width: 60ch; }
.foot-last { display: flex; justify-content: space-between; align-items: center; font-size: 17px; color: var(--muted); }
.btn.small { background: var(--tone2); color: var(--ink); padding: 12px 18px; font-size: 17px; }

/* ---------- entrances ---------- */
.js .reveal > *, .js .reveal.field > * { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal.in > *:nth-child(2) { transition-delay: 80ms; }
.js .reveal.in > *:nth-child(3) { transition-delay: 160ms; }
.js .reveal.field.in .phone-card { transform: translateX(-50%); }

/* ---------- a shared story (/s/<id>): one chain, centred ---------- */
.showcase.solo { grid-template-columns: minmax(0, 640px); justify-content: center; min-height: 100svh; padding: 40px; align-content: center; }
.solo-mark { display: inline-flex; align-items: center; gap: 10px; font: 500 22px var(--serif); color: var(--ink); text-decoration: none; }
.solo-mark img { width: 40px; height: 40px; }
.showcase.solo .story-title { font: 600 17px/1.3 var(--sans); }
.showcase.solo .mystery { font-size: 30px; }
.solo-open { margin: 0; font-size: 15px; color: var(--muted); }
.cells .cell[hidden] { display: none; }
.cells:has(#tip[hidden]) { grid-template-columns: 1fr; }
.cells:has(#tip[hidden]) #ending { background: var(--gold); color: var(--on-gold); }

/* ---------- 404 (styles live here: the CSP forbids inline <style>) ---------- */
.nf main { max-width: 40ch; margin: 0 auto; padding: 20vh 20px; }
.nf h1 { font-size: 44px; margin-bottom: 16px; }
.nf a { color: var(--gold); }

/* ---------- tablet and phone ---------- */
@media (max-width: 1000px) {
  .how { grid-template-columns: 1fr 1fr; }
  .faq { grid-template-columns: 1fr; padding: 96px 16px; }
  .faq h2 { font-size: 36px; }
  .faq h2 { position: static; }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: var(--m); }
  .hero-room { order: -1; position: relative; top: 0; height: 34svh; }
  .hero-card { margin-top: -24px; position: relative; z-index: 4; padding: 0 20px 24px; }
  .stripe { --w: 14px; height: 72px; padding-bottom: 14px; }
  .stripe::after { bottom: 12px; }
  .wordmark { width: 34%; margin: 28px 0 16px; }
  .hero-card h1 { font-size: 9vw; }
  .hero-links { flex-wrap: wrap; justify-content: center; gap: 20px; }
  .showcase { grid-template-columns: 1fr; padding: 96px 16px; min-height: 0; gap: 24px; }
  .showcase.solo { padding: 40px 16px; min-height: 100svh; }
  .showcase.solo .mystery { font-size: 24px; }
  .tabs { gap: 20px; }
  .sec-h { font-size: 36px; }
  .mystery { font-size: 22px; }
  .cells { grid-template-columns: 1fr; }
  .cell { height: 60px; }
  .how { grid-template-columns: 1fr; }
  .field { min-height: 64svh; padding: 20px; }
  .clause { margin: 0 0 32px; order: -1; }
  .field h2 { margin-bottom: 8px; order: -2; }
  .phone-card { position: static; transform: none; width: min(260px, 100%); }
  .field:hover .phone-card, .js .reveal.field.in .phone-card { transform: none; }
  .feat-h { font-size: 36px; padding: 72px 16px 24px; }
  .band { padding: 20px 16px; min-height: 132px; }
  .band .s { font-size: 22px; }
  .switch { font-size: 32px; min-height: 44px; }
  .cta { padding: 96px 16px; grid-template-columns: 1fr; }
  .cta-side { max-width: 240px; }
  .cta-main h2 { font-size: 36px; }
  .blank { font-size: 22px; }
  .blank input { display: block; width: 100%; margin: 6px 0; }
  .foot { padding: 80px 16px 32px; }
  .mark { gap: 3px; }
  .mark span { border-radius: 8px; }
  .mark span::after { height: 2px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .contact { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .cap:not(.on), .hero-room .fade:not(.on) { display: none; }
  .js .reveal > * { opacity: 1; transform: none; }
}
