:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #222126;
  --muted: #5e5960;
  --rule: #dcd7d8;
  --accent: #91324c;
  --selected: #f5e7eb;
  font: 1rem/1.65 "Leelawadee UI", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
::selection { background: #edcad6; color: var(--ink); }
a { color: var(--accent); text-underline-offset: .22em; }
button { font: inherit; cursor: pointer; }
:where(a, button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
.top, .footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.top { min-height: 62px; border-bottom: 1px solid var(--rule); }
.top a, .footer { font-size: .9rem; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
.top .brand { font-size: 1rem; }
.intro { padding-block: 38px 26px; }
.intro h1 { margin: 0; font-size: 2.45rem; line-height: 1.25; letter-spacing: -.025em; }
.intro p { max-width: 65ch; margin: 8px 0 0; color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
#chapters { display: grid; border-top: 1px solid var(--rule); }
#chapters button {
  display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px;
  min-height: 47px; padding: 8px 10px; text-align: left; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule);
}
#chapters button:hover { background: #f0edeb; }
#chapters button[aria-pressed=true] { background: var(--selected); color: var(--accent); font-weight: 700; }
.chapter-number, .count { font-size: .875rem; font-variant-numeric: tabular-nums; }
.chapter-number { color: var(--muted); }
#chapters button[aria-pressed=true] .chapter-number { color: var(--accent); }
.player { border: 1px solid #bcb6bd; border-radius: 8px; overflow: hidden; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; color: #f4f2f5; background: #29262d; border-bottom: 1px solid #48434e; }
.player-bar b { color: #c8c2cd; margin-right: 3px; }
.demo { color: #d3ccd8; font-size: .875rem; }
.scene { display: grid; min-height: 315px; align-items: center; padding: 22px 28px; overflow: hidden; background: #35323a; color: #f7f3f7; }
.frame { width: min(100%, 540px); margin-inline: auto; animation: reveal .2s ease-out; }
.mock-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: .95rem; font-weight: 700; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #edc6d4; color: #5f2036; }
.app { padding: 1px 5px; border-radius: 3px; background: #5b4f69; font-size: .75rem; }
.mock-card { background: #29262d; border: 1px solid #4f4956; border-radius: 6px; padding: 14px; }
.mock-card img { display: block; width: 100%; max-height: 126px; aspect-ratio: 3/1; object-fit: cover; border-radius: 4px; margin-bottom: 10px; }
.mock-card h3 { margin: 0 0 7px; font-size: 1.05rem; }
.mock-card p { margin: 0 0 10px; color: #e6dce6; }
.mock-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.mock-button, .mock-field { display: inline-block; border: 1px solid transparent; border-radius: 4px; padding: 6px 9px; background: #48424d; color: #faf6fa; }
.mock-field { display: block; margin-bottom: 9px; background: #1e1b22; border-color: #5c5463; }
.mock-button.hit { background: #853551; border-color: #eba2bc; }
.mock-button.hit:hover { background: #9b3e5f; }
.mock-button.hit:focus-visible { outline-color: #ffcedf; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 14px; background: #f1eeed; }
.transport { display: flex; gap: 5px; }
.transport button { display: grid; place-items: center; min-width: 40px; min-height: 40px; padding: 4px 9px; border: 1px solid #cbc4c7; border-radius: 5px; background: #fff; color: var(--ink); }
.transport svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.transport #play { min-width: 72px; color: #fff; background: var(--accent); border-color: var(--accent); }
.transport button:not(:disabled):hover { border-color: var(--accent); }
.transport button:disabled { opacity: .42; cursor: default; }
#frames { display: flex; flex: 1; min-width: 72px; gap: 5px; }
#frames button { flex: 1; min-width: 16px; border: 0; background: transparent; padding: 12px 0; }
#frames button::after { content: ""; display: block; height: 3px; background: #bdb3ba; }
#frames button[aria-current=step]::after, #frames button:hover::after { background: var(--accent); }
.count { min-width: 3em; color: var(--muted); text-align: right; }
.notes { padding: 18px 0 0; }
.notes h2, .faq h2 { margin: 0; font-size: 1.25rem; }
.notes ol { max-width: 70ch; margin: 8px 0 0; padding-inline-start: 24px; }
.notes li { padding: 3px 6px; color: var(--muted); }
.notes li[aria-current=step] { color: var(--ink); background: var(--selected); }
.notes li[aria-current=step]::marker { color: var(--accent); font-weight: 700; }
.faq { max-width: 838px; margin: 34px 0 0 auto; scroll-margin-top: 16px; }
details { border-bottom: 1px solid var(--rule); padding: 10px 0; }
details:first-of-type { margin-top: 8px; border-top: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 700; }
details p { max-width: 70ch; margin: 7px 0 0; color: var(--muted); }
.footer { margin-top: 28px; padding-block: 18px; border-top: 1px solid var(--rule); color: var(--muted); }
@keyframes reveal { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 740px) {
  .shell { width: calc(100% - 32px); }
  .intro { padding-block: 24px 18px; }
  .intro h1 { font-size: 1.85rem; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #chapters button { padding-inline: 4px; grid-template-columns: 18px 1fr; gap: 4px; font-size: .9rem; }
  .scene { min-height: 270px; padding: 17px 14px; }
  .controls { padding-inline: 8px; gap: 6px; }
  .faq { margin-top: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
