/* livetokyo.com — the only stylesheet (v3 · 2026-09-02)
   Canon: docs/DESIGN.md v3 (tokens are copied from there; if this file disagrees, the document wins).
   Contract: the curtain (.viewport::after) only COVERS the player. Never hide the video element
   with display:none / visibility:hidden / opacity:0 (LSN-0239). */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f7f6f3;            /* Paper */
  --surface-1: #ffffff;     /* White */
  --surface-2: #efede9;     /* Cloud */
  --surface-3: #e6e3de;     /* Cloud 2 */
  --line: rgba(23, 23, 23, .08);
  --line-strong: rgba(23, 23, 23, .16);
  --ink: #171717;
  --ink-2: #4a4a4a;
  --ink-3: #6b6b6b;
  --ink-4: #a3a3a3;         /* disabled only */
  --accent: #4f46b8;        /* Wisteria — pressable / selected only */
  --live: #d92b1f;          /* the word "Live" only */
  --player-bg: #000;
  --font-latin: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --r: 8px;
  --r-pill: 9999px;
  --hd-h: 56px;
  --row-h: 64px;
  --max: 1280px;
  --gutter: clamp(16px, 3vw, 24px);
  --t: 150ms ease;
  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--font-latin), var(--font-ja);
  font-size: 15px; line-height: 1.7; letter-spacing: 0;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ja"] body { font-family: var(--font-ja), var(--font-latin); letter-spacing: 0.01em; }
h1, h2, h3 { color: var(--ink); font-weight: 600; line-height: 1.3; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: var(--bg); border-radius: var(--r); }
.skip:focus { left: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.muted { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── Type roles ─────────────────────────────────────────── */
.t-caption { font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.t-label { font-size: 13px; line-height: 1.4; font-weight: 500; }
.t-body-sm { font-size: 14px; }
.t-title-sm { font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.t-title { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.t-headline { font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.t-page { font-size: clamp(26px, 4vw, 32px); font-weight: 600; color: var(--ink); line-height: 1.2; }

/* ── Header ─────────────────────────────────────────────── */
.hd { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.hd__in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: var(--hd-h); display: flex; align-items: center; gap: 14px; }
.brand { font-family: var(--font-latin); font-weight: 600; font-size: 18px; color: var(--ink); white-space: nowrap; }
.tagline { font-size: 13px; color: var(--ink-3); line-height: 1.35; margin: 0; font-weight: 400; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border-radius: var(--r); font-size: 14px; color: var(--ink-2); transition: background var(--t), color var(--t); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.hd__tools { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 2px; }
.lang a, .lang span { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; transition: background var(--t), color var(--t); }
.lang a:hover { color: var(--ink); }
.lang [aria-current="true"] { background: var(--ink); color: var(--bg); }
.menu { display: none; width: 44px; height: 44px; border-radius: var(--r); font-size: 20px; color: var(--ink); }
.menu:hover { background: var(--surface-2); }
.drawer { display: none; background: var(--bg); border-bottom: 1px solid var(--line); }
.drawer[data-open="true"] { display: block; }
.drawer ul { padding: 8px var(--gutter) 12px; }
.drawer a { display: block; padding: 12px 8px; color: var(--ink); font-size: 16px; border-radius: var(--r); }
.drawer a:hover { background: var(--surface-2); }

/* ── Buttons / Inputs / Chips ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); font-size: 15px; font-weight: 500; white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: #000; }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface-1); }
.btn--ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-pill); }
.btn--sm[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { position: relative; }
.search input { width: 100%; height: 40px; padding: 0 16px 0 38px; border-radius: var(--r-pill); background: var(--surface-1); border: 1px solid var(--line-strong); color: var(--ink); outline: 0; transition: border-color var(--t); }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--ink-3); }
.search::after { content: ""; position: absolute; left: 24px; top: 50%; width: 6px; height: 2px; margin-top: 3px; background: var(--ink-3); transform: rotate(45deg); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background var(--t), color var(--t); }
.chip:hover { background: var(--surface-3); color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* ── Thumbnail (initial tile underneath, live frame on top) ─ */
.th { position: relative; flex: 0 0 auto; width: 96px; height: 54px; border-radius: var(--r); background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.th__i { font-family: var(--font-latin); font-weight: 600; font-size: 13px; color: var(--ink-3); line-height: 1; }
.th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th img.is-broken { display: none; }

/* ── Home: two columns ──────────────────────────────────── */
.home { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 48px; }
.home__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.stage { min-width: 0; }

.viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--player-bg); border-radius: var(--r); overflow: hidden; }
.viewport iframe, .viewport #lt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.viewport::after { content: ""; position: absolute; inset: 0; background: var(--player-bg); opacity: 0; pointer-events: none; transition: opacity var(--t); }
.viewport[data-curtain="on"]::after { opacity: 1; }
.viewport__idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; color: #cfcfcf; font-size: 14px; }
.viewport__idle .btn--primary { background: var(--surface-1); color: var(--ink); }

.now { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.now__state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.now__state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.now[data-state="live"] .now__state { color: var(--live); }
.now[data-state="live"] .dot { background: var(--live); }
.now[data-state="tap"] .now__state { color: var(--ink); }
.now[data-state="tap"] .dot { background: var(--ink); }
.now__name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.now__place { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now__actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.now__official { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.now__official:hover { color: var(--ink); text-decoration: underline; }
.now__official .short { display: none; }
.now__msg { padding: 10px 4px 0; font-size: 13px; color: var(--ink-3); }

.info { padding: 20px 4px 0; }
.info__name { font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.info__meta { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.info__desc { margin-top: 10px; font-size: 15px; color: var(--ink-2); max-width: 70ch; }
.info__time { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.info__foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-3); align-items: center; }
.info__foot a, .info__foot button { color: var(--accent); }
.info__foot a:hover, .info__foot button:hover { text-decoration: underline; }

/* ── Browser panel (right column) ───────────────────────── */
.browser { position: sticky; top: calc(var(--hd-h) + 16px); max-height: calc(100vh - var(--hd-h) - 32px); display: flex; flex-direction: column; min-width: 0; background: var(--surface-1); border-radius: var(--r); border: 1px solid var(--line); }
.browser__top { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.browser__list { overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 6px; flex: 1 1 auto; min-height: 0; }
.browser__empty { padding: 24px 12px; font-size: 14px; color: var(--ink-3); text-align: center; }
.grp { position: sticky; top: 0; z-index: 1; background: var(--surface-1); padding: 12px 10px 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; }
.grp .n { font-family: var(--font-latin); font-weight: 400; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--row-h); padding: 5px 10px; border-radius: var(--r); text-align: left; color: var(--ink); transition: background var(--t); }
.row:hover { background: var(--surface-2); }
.row[aria-current="true"] { background: var(--surface-3); }
.row[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; background: var(--accent); border-radius: 1px; }
.row__body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.row__name { font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row[aria-current="true"] .row__meta { color: var(--ink-2); }
.row__star { flex: 0 0 auto; font-size: 13px; color: var(--ink-3); }
.browser__foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.browser__foot a { color: var(--accent); }
.browser__foot a:hover { text-decoration: underline; }

/* ── Trust strip ────────────────────────────────────────── */
.trust { max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 0; }
.trust__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 24px 0 8px; border-top: 1px solid var(--line); }
.trust h2 { font-size: 18px; margin-bottom: 6px; }
.trust p { font-size: 14px; color: var(--ink-2); }

/* ── Footer ─────────────────────────────────────────────── */
.ft { border-top: 1px solid var(--line); margin-top: 40px; }
.ft__in { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 24px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; font-size: 13px; color: var(--ink-3); }
.ft__brand { font-family: var(--font-latin); font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.ft h2 { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.ft li { margin: 4px 0; }
.ft a:hover { color: var(--ink); text-decoration: underline; }
.ft__base { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 24px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Camera page ────────────────────────────────────────── */
html[data-page="cam"] .now__name, html[data-page="cam"] .now__place { display: none; }   /* the h1 above already says it */
.cam { max-width: 960px; margin: 0 auto; padding: 20px var(--gutter) 48px; }
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.cam__head { margin-bottom: 14px; }
.cam__place { font-size: 15px; color: var(--ink-3); margin-top: 2px; }
.cam__desc { margin-top: 16px; font-size: 15px; color: var(--ink-2); max-width: 70ch; }
.facts { margin-top: 20px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--ink-3); margin: 0; }
.facts dd { margin: 0; color: var(--ink); }
.facts a { color: var(--accent); }
.facts a:hover { text-decoration: underline; }
.related { margin-top: 32px; }
.related h2 { font-size: 18px; margin-bottom: 8px; }
.related .row { padding-left: 4px; }
.cam__more { margin-top: 20px; font-size: 14px; }

/* ── All cameras page ───────────────────────────────────── */
.list-page { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 48px; }
.list-page .lead { font-size: 15px; color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.list-page h2 { font-size: 22px; margin-top: 36px; }
.list-page .lede { font-size: 14px; color: var(--ink-3); margin: 4px 0 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.tbl td a { color: var(--accent); }
.tbl td a:hover { text-decoration: underline; }
.tbl td:first-child a { color: var(--ink); font-weight: 500; }
.tbl-wrap { overflow-x: auto; }

/* ── About / prose ──────────────────────────────────────── */
.prose { max-width: 720px; margin: 0 auto; padding: 28px var(--gutter) 48px; }
.prose h1 { margin-bottom: 8px; }
.prose .lead { font-size: 17px; color: var(--ink-2); margin-bottom: 8px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p { margin: 0 0 12px; color: var(--ink-2); }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose ul { list-style: disc; padding-left: 20px; margin: 0 0 12px; color: var(--ink-2); }
.prose li { margin: 4px 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .home__grid { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 959px) {
  :root { --hd-h: 52px; }
  .hd__in { gap: 10px; }
  .tagline { display: none; }
  .nav { display: none; }
  .menu { display: inline-flex; align-items: center; justify-content: center; }
  .home { padding: 0 0 40px; }
  .home__grid { display: block; }
  .stage { display: contents; }               /* so the sticky player spans the whole page (sakaota lesson 7) */
  .stage__sticky { position: sticky; top: var(--hd-h); z-index: 30; background: var(--bg); }
  .viewport { border-radius: 0; }
  .now, .info { padding-left: var(--gutter); padding-right: var(--gutter); }
  .now__official .long { display: none; }
  .now__official .short { display: inline; }
  .now__name { max-width: 60%; }
  .browser { position: static; max-height: none; border-radius: 0; border-left: 0; border-right: 0; margin-top: 20px; }
  .browser__list { overflow: visible; padding: 2px 8px 6px; }
  .grp { position: static; }
  .trust__grid { grid-template-columns: 1fr; gap: 16px; }
  .ft__in { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 110px minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .now__name { max-width: 100%; }
  .now__place { flex-basis: 100%; }
}
