
@font-face { font-family: "Anuphan"; src: url("/fonts/Anuphan.ttf") format("truetype"); font-weight: 100 700; font-display: swap; }
:root {
  --font: "Anuphan", system-ui, sans-serif;
  --stage: #0b0c0e; --on-stage: #f2f1ee; --muted-stage: #a6a8ad;
  --hud: rgb(24 26 30 / .86); --hud-line: rgb(255 255 255 / .14);
  --eng: #941114;               
  --eng-soft: #f9e4e4;          
  --accent: var(--eng);
  --paper: #f6f4ef; --card: #ffffff; --ink: #17191e; --muted: #50545c; --line: rgb(23 25 30 / .12);
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 56px;
  --m1: 150ms; --m2: 220ms; --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) { :root { --paper: #131519; --card: #1c1f25; --ink: #e8e6e1; --muted: #a9adb5; --line: rgb(255 255 255 / .12); } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; font-family: var(--font); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }


body.show { background: var(--stage); color: var(--on-stage); overflow: hidden; }
.deck { position: fixed; inset: 0; display: grid; place-items: center; cursor: none; user-select: none; -webkit-user-select: none; }
body.awake .deck { cursor: default; }
.slide { grid-area: 1 / 1; width: min(100vw, calc(100vh * 16 / 9)); height: auto; aspect-ratio: 16 / 9; object-fit: contain;
  opacity: 0; transition: opacity var(--m1) linear; -webkit-user-drag: none; pointer-events: none; }
.slide.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

.screen { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.screen[data-kind="black"] { background: #000; pointer-events: auto; }
.screen[data-kind="white"] { background: #fff; pointer-events: auto; }

.hud { position: fixed; left: 50%; bottom: var(--s4); z-index: 10; transform: translate(-50%, var(--s3)); display: flex; align-items: center; gap: 2px;
  padding: var(--s1); border-radius: 999px; background: var(--hud); border: 1px solid var(--hud-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity var(--m2), transform var(--m2) var(--ease); }
body.awake .hud, .hud:focus-within { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.hud button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--on-stage); cursor: pointer; }
.hud button:hover { background: var(--hud-line); }
.hud svg, .ov-head svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.count { min-width: 4.5em; text-align: center; font-size: .875rem; font-variant-numeric: tabular-nums; color: var(--muted-stage); }
.sep { width: 1px; height: 22px; margin: 0 var(--s1); background: var(--hud-line); }
@media (pointer: coarse) { .hud button { width: 44px; height: 44px; } }

.overview { position: fixed; inset: 0; z-index: 20; overflow: auto; padding: var(--s5); background: rgb(11 12 14 / .96); }
.ov-head { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto var(--s4); }
.ov-head h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.ov-head button, .keys button { min-height: 40px; padding: 0 var(--s4); border: 1px solid var(--hud-line); border-radius: 999px; background: transparent; color: var(--on-stage); cursor: pointer; }
.ov-grid { list-style: none; margin: 0 auto; padding: 0; max-width: 1200px; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ov-grid button { position: relative; display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); background: #fff; cursor: pointer; overflow: hidden; }
.ov-grid button.cur { border-color: var(--accent); }
.ov-grid img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.ov-grid span { position: absolute; right: var(--s2); bottom: var(--s2); min-width: 24px; padding: 0 6px; border-radius: var(--r-sm); background: rgb(0 0 0 / .72); color: #fff; font-size: .75rem; line-height: 22px; }

.keys { max-width: 640px; width: calc(100% - 2 * var(--s4)); padding: var(--s5); border: 1px solid var(--hud-line); border-radius: var(--r-lg); background: #17191d; color: var(--on-stage); }
.keys::backdrop { background: rgb(0 0 0 / .6); }
.keys h2 { margin: 0 0 var(--s3); font-size: 1.125rem; }
.keys table { width: 100%; border-collapse: collapse; margin-bottom: var(--s4); font-size: .875rem; }
.keys th { text-align: left; white-space: nowrap; padding: var(--s2) var(--s3) var(--s2) 0; vertical-align: top; color: var(--muted-stage); font-weight: 500; }
.keys td { padding: var(--s2) 0; border-top: 1px solid var(--hud-line); }
.keys tr:first-child td { border-top: 0; }


.gears { position: fixed; right: 0; bottom: 0; z-index: 4; pointer-events: none; }
.gear { position: absolute; fill: var(--eng); transition: transform 600ms cubic-bezier(.3, 1.4, .5, 1); }
.g1 { width: 220px; height: 220px; right: -96px; bottom: -96px; opacity: .92; transform: rotate(calc(var(--turn, 0) * 30deg)); }
.g2 { width: 120px; height: 120px; right: 86px; bottom: -52px; opacity: .55; transform: rotate(calc(var(--turn, 0) * -55deg + 15deg)); }
@media (max-width: 700px) { .g1 { width: 140px; height: 140px; right: -60px; bottom: -60px; } .g2 { width: 76px; height: 76px; right: 56px; bottom: -34px; } }
@media (prefers-reduced-motion: reduce) { .gear { transition: none; } }


body.home { background: var(--paper); color: var(--ink); }
.home-wrap { max-width: 960px; margin: 0 auto; padding: var(--s7) var(--s4); }
.home-wrap h1 { margin: 0 0 var(--s2); font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -.01em; }
.home-wrap > p { margin: 0 0 var(--s6); color: var(--muted); }
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.talk { display: grid; gap: var(--s2); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color var(--m1), transform var(--m2) var(--ease); }
.talk:hover { border-color: var(--accent); transform: translateY(-2px); }
.talk img { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border-bottom: 1px solid var(--line); background: #fff; }
.talk div { display: grid; gap: var(--s1); padding: var(--s3) var(--s4) var(--s4); }
.talk small { color: var(--muted); }
.talk strong { font-size: 1.0625rem; }
