/* Reel 0.4 — Apple TV-minimal: full-bleed artwork, one row of cards, big focus. Trip-app system tokens:: light = warm grey + black + one orange, dark = rmndo near-black + silver.
   Fonts self-hosted (Google Fonts is blocked in China). Plain CSS on purpose: TV browsers are old. */
@font-face { font-family: "Archivo"; font-weight: 100 900; font-display: swap; src: url(/static/fonts/archivo-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-weight: 100 900; font-display: swap; src: url(/static/fonts/archivo-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-weight: 100 900; font-display: swap; src: url(/static/fonts/archivo-vietnamese-wght-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "JB Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JB Mono"; font-weight: 500; font-display: swap; src: url(/static/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #e8e8e5; --surface: #f6f6f3; --ink: #121212; --muted: #5e5e5a;
  --line: #cbcbc6; --line-strong: #121212;
  --accent: #ff4f00; --accent-ink: #121212; --accent-text: #ad3600;
  --press: rgba(18, 18, 18, .06); --focus: #121212; --card: #d9d9d5;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "JB Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --tap: 44px; --r: 3px; --r-lg: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #030303; --surface: #0b0b0b; --ink: #c6c8ca; --muted: rgba(198, 200, 202, .7);
    --line: #1f2021; --line-strong: #c6c8ca;
    --accent: #ff5a1f; --accent-ink: #030303; --accent-text: #ff6a33;
    --press: rgba(198, 200, 202, .08); --focus: #f6f6f3; --card: #141516; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #030303; --surface: #0b0b0b; --ink: #c6c8ca; --muted: rgba(198, 200, 202, .7);
  --line: #1f2021; --line-strong: #c6c8ca;
  --accent: #ff5a1f; --accent-ink: #030303; --accent-text: #ff6a33;
  --press: rgba(198, 200, 202, .08); --focus: #f6f6f3; --card: #141516; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
/* TVs report 960-1920 CSS px and sit 3 m away: everything a size up */
@media (min-width: 1100px) { html, body { font-size: 20px; } }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
@media (min-width: 1100px) { .mono { font-size: 14px; } }
.muted { color: var(--muted); }
.pad { padding: 0 16px; }
@media (min-width: 1100px) { .pad { padding: 0 56px; } }

/* top bar floats over the artwork, always light-on-dark */
.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px; color: #f6f6f3; }
.bar { justify-content: space-between; }
.bar > .mono { color: rgba(246, 246, 243, .75); }
@media (min-width: 1100px) { .bar { padding: 28px 56px; } }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1; }
.brand.big { font-size: 56px; }

/* hero: the artwork is the interface */
.hero { position: relative; min-height: 64vh; display: flex; align-items: flex-end; background: #000 center 20% / cover no-repeat;
  color: #f6f6f3; }
.hero-page { min-height: 100vh; min-height: 100svh; }
.hero-shade { position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,.15) 45%, rgba(0,0,0,.8) 85%, var(--bg) 100%),
              linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%); }
:root[data-theme="light"] .hero-shade { background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,.15) 45%, rgba(0,0,0,.85) 100%),
              linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%); }
.hero-title, .hero-over, .hero-meta { text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.hero-body { position: relative; z-index: 1; width: 100%; max-width: 760px; padding: 96px 16px 28px; }
@media (min-width: 1100px) { .hero-body { padding: 0 56px 48px; max-width: 1000px; } }
.logo { display: block; max-width: min(72vw, 520px); max-height: 150px; object-fit: contain; object-position: left bottom; margin-bottom: 14px; }
.hero-title { font-size: 36px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; margin-bottom: 12px; overflow-wrap: anywhere; }
@media (min-width: 1100px) { .hero-title { font-size: 64px; } .logo { max-height: 200px; } }
.hero-meta { color: rgba(246, 246, 243, .82); }
.hero-over { margin-top: 10px; max-width: 60ch; color: rgba(246, 246, 243, .88); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.actions form { margin: 0; display: flex; }
.resume { margin-top: 12px; color: rgba(246, 246, 243, .75); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap);
  padding: 0 20px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform .15s, background-color .15s; }
.btn.primary { background: #f6f6f3; color: #030303; min-width: 120px; }
.btn.glass { background: rgba(246, 246, 243, .16); color: #f6f6f3; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn.danger { background: var(--accent); color: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
@media (min-width: 1100px) { .btn { min-height: 56px; padding: 0 28px; font-size: 20px; } .btn.small { min-height: 44px; font-size: 16px; } }

/* focus: grow + white ring, like a TV home screen. Old TV browsers ignore :focus-visible, so plain :focus too */
a:focus, button:focus, input:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }
.btn:focus { transform: scale(1.06); }
.btn.glass:focus { background: rgba(246, 246, 243, .3); }
@media (min-width: 1100px) { a:focus, button:focus, input:focus { outline-width: 4px; outline-offset: 4px; } }

/* the one row */
.row { position: relative; z-index: 2; padding: 6px 0 0; }
.row-title { padding: 0 16px 10px; color: var(--muted); }
.cards { display: flex; gap: 14px; overflow-x: auto; padding: 16px 16px 24px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) { .row-title { padding: 0 56px 12px; } .cards { padding: 10px 56px 28px; gap: 24px; } }
.card { flex: 0 0 auto; width: 62vw; max-width: 300px; text-decoration: none; scroll-snap-align: start; border-radius: var(--r-lg); outline-offset: 6px; }
@media (min-width: 1100px) { .card { width: 340px; max-width: none; } }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-lg); background: var(--card) center / cover no-repeat;
  overflow: hidden; transition: transform .2s, box-shadow .2s; }
@supports not (aspect-ratio: 1) { .thumb { height: 0; padding-top: 56.25%; } }
.thumb-name { position: absolute; left: 12px; right: 12px; bottom: 10px; font-weight: 700; color: var(--ink); }
.card:focus { outline: none; }
.card:focus .thumb, .card:hover .thumb { transform: scale(1.06); box-shadow: 0 0 0 3px var(--focus), 0 14px 30px rgba(0, 0, 0, .5); }
.card-title { display: block; margin-top: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1100px) { .card-sub { font-size: 17px; } }

.hint { margin: 8px 16px 0; font-size: 14px; max-width: 70ch; }
@media (min-width: 1100px) { .hint { margin: 8px 56px 0; font-size: 16px; } }
.empty { padding: 120px 16px 40px; max-width: 640px; }
.empty-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }

/* player: hidden until Play, then the whole window */
.frame { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 40; background: #000; }
.frame video { width: 100%; height: 100%; display: block; background: #000; }
/* close: invisible until the mouse moves or the screen is tapped, then a quiet x that fades away again.
   A TV remote never shows it (Back closes the player). */
.close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border: 0; padding: 0;
  background: transparent; color: rgba(255, 255, 255, .8); font: 300 28px/44px var(--sans); text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; }
.frame.ui .close { opacity: .7; pointer-events: auto; }
.frame.ui .close:hover, .frame .close:focus { opacity: 1; }
.toast { position: absolute; left: 50%; top: 32px; transform: translateX(-50%); padding: 12px 18px; border-radius: var(--r-lg);
  background: rgba(3, 3, 3, .82); color: #f6f6f3; font: 500 18px/1.2 var(--mono); letter-spacing: .06em; pointer-events: none; white-space: nowrap; }
@media (min-width: 1100px) { .toast { font-size: 26px; top: 48px; } }

/* PIN page */
.pin { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 32px 16px; max-width: 480px; margin: 0 auto; }
.pin-form { display: flex; flex-direction: column; gap: 10px; }
.pin-form label { color: var(--muted); }
.pin-form input { min-height: 60px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  font: 500 28px/1 var(--mono); letter-spacing: .3em; width: 100%; }
.pin-form .btn { min-height: 56px; font-size: 18px; background: var(--ink); color: var(--bg); }
.error { color: var(--accent-text); font-weight: 600; }

.update { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.update .btn { background: var(--accent-ink); color: var(--accent); }

.foot { margin: 40px 16px 0; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; color: var(--muted); }
@media (min-width: 1100px) { .foot { margin: 48px 56px 0; } }
.theme, .foot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.foot-row form { margin: 0; }
.foot .btn { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  font: 500 14px/1 var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--line-strong); background: var(--surface); font-weight: 700; }

/* TV: one screen, like a TV home — the artwork fills it and the row sits on its lower edge */
@media (min-width: 1100px) {
  .hero:not(.hero-page) { min-height: 100vh; }
  .hero:not(.hero-page) .hero-body { padding-bottom: 340px; }
  .row { margin-top: -330px; }
}

/* 0.5.2 remote mode (html.remote: set by arrow keys, cleared by mouse/pointer movement). Like Apple TV:
   every button is glass, the focused one turns solid white. No outline ring, small growth, room to grow. */
html.remote .actions { gap: 16px; }
html.remote .btn.primary { background: rgba(246, 246, 243, .16); color: #f6f6f3; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html.remote .btn:focus, html.remote .btn.primary:focus, html.remote .btn.glass:focus {
  outline: none; background: #f6f6f3; color: #030303; transform: scale(1.05); box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: none; backdrop-filter: none; transition: transform .15s; }
html.remote .btn.danger, html.remote .btn.danger:focus { background: var(--accent); color: var(--accent-ink); }
html.remote .foot .btn:focus { background: var(--ink); color: var(--bg); }
html.remote .btn { transition: transform .15s; }   /* colour flips instantly: fades look muddy on TV GPUs */
