/* site.css: Encamp Product Tour site. Dark brand look from docs/storyboard.html "Site wireframe". */
:root {
  --navy: #051E3C;        /* Deep Navy: page background */
  --navy-2: #0A2744;      /* panels, cards */
  --navy-3: #0D3054;      /* hover */
  --line: #1C4068;
  --fg: #F4F7FB;
  --muted: #9FB0CD;
  --pumpkin: #FF6B35;     /* accent */
  --pumpkin-2: #FF8F66;   /* accent text on navy */
  --indep: #4A5568;       /* Independence: resolved */
  --green: #8DC63F;
  --danger: #FF8A80;
  --display: "Merriweather", Georgia, "Times New Roman", serif;
  --body: "Kumbh Sans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: 16px;
  --radius: 12px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--navy); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 900; }
p { margin: 0; }
a { color: var(--pumpkin-2); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--pumpkin); outline-offset: 2px; }
svg { fill: currentColor; }

.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 900px) { :root { --gutter: 24px; } }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pumpkin-2); }
.meta { color: var(--muted); font-size: 13px; }
.lede { color: var(--muted); font-size: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: var(--pumpkin); color: var(--navy); font-weight: 700; font-size: 14px; padding: 9px 18px; text-decoration: none; cursor: pointer; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: #ff7d4d; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--fg); }
.notice { background: rgba(255, 107, 53, .08); border: 1px solid rgba(255, 107, 53, .35); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; color: var(--fg); }
.err { color: var(--danger); font-size: 13.5px; }

/* ---- header ---- */
.bar { background: var(--navy-2); border-bottom: 1px solid var(--line); font-size: 13px; }
.bar-in { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 52px; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .18em; font-size: 14px; color: var(--fg); text-decoration: none; }
.logo-mark { height: 18px; width: auto; display: block; }
.crumb { color: var(--muted); }
.sp { flex: 1; }
.pass { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.pass svg { width: 14px; height: 14px; fill: var(--pumpkin-2); }

/* ---- posters ---- */
.poster { position: relative; display: block; aspect-ratio: 16 / 9; background: #071f3a; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; display: grid; place-items: center; }
.play > span, .bigplay > span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 107, 53, .92); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.play svg, .bigplay svg { width: 28px; height: 28px; margin-left: 4px; }
.dur { position: absolute; right: 10px; bottom: 10px; background: rgba(2, 16, 31, .85); font-size: 12px; padding: 2px 8px; border-radius: 6px; color: #fff; font-variant-numeric: tabular-nums; }
.soon { display: none; position: absolute; left: 10px; top: 10px; background: rgba(2, 16, 31, .88); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.is-soon .soon { display: block; }
.is-soon .play, .is-soon .dur { display: none; }
.is-soon img { filter: grayscale(.6) brightness(.6); }

/* ---- library ---- */
.library { padding-block: 24px 40px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 36px; }
.hero-poster { border-radius: var(--radius); border: 1px solid var(--line); }
.hero-text { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.hero h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.2; }
.hero .btn { margin-top: 6px; }
.coll { margin-top: 28px; }
.coll .ct { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.coll .ct h2 { font-family: var(--body); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.coll .ct span { color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.chap { display: flex; flex-direction: column; color: inherit; text-decoration: none; background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; transition: border-color .15s, transform .15s; }
a.chap:hover { border-color: var(--pumpkin); transform: translateY(-2px); }
.chap.is-soon { cursor: default; }
.chap .b { padding: 10px 12px 14px; display: grid; gap: 4px; }
.chap .n { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pumpkin-2); }
.chap h3 { font-family: var(--display); font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.chap p { font-size: 13px; color: var(--muted); }

/* ---- watch page ---- */
.watch {
  display: grid; gap: 20px 24px; padding-block: 20px 40px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas: "player review" "info chapters";
  align-items: start;
}
.no-review .watch { grid-template-areas: "player chapters" "info chapters"; }
.w-player { grid-area: player; min-width: 0; }
.w-review { grid-area: review; min-width: 0; }
.w-info { grid-area: info; min-width: 0; display: grid; gap: 10px; align-content: start; }
.w-chapters { grid-area: chapters; min-width: 0; }

.player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player video::cue { opacity: 0; } /* captions are burned into the master; the track only drives the transcript */
.bigplay { position: absolute; inset: 0; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; }
.playing .bigplay, .composing .bigplay { display: none; }
.composing .player { cursor: crosshair; }
.pin { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--pumpkin); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(255, 107, 53, .35); pointer-events: none; }
.soon-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 30, 60, .55); pointer-events: none; }
.soon-overlay span { background: rgba(2, 16, 31, .9); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; background: var(--navy-2); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 8px 10px; }
.ctl { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--fg); flex: none; }
.ctl:hover { background: var(--navy-3); }
.ctl svg { width: 20px; height: 20px; }
.ctl[aria-pressed="true"] { color: var(--muted); }
.i-pause { display: none; }
.playing .i-play { display: none; }
.playing .i-pause { display: inline; }
.time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrub { position: relative; flex: 1 1 160px; height: 32px; min-width: 120px; }
.scrub .track { position: absolute; left: 0; right: 0; top: 13px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.scrub .fill { height: 100%; width: 0; background: var(--pumpkin); }
.scrub input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; top: 4px; width: 8px; height: 24px; margin-left: -4px; padding: 0; border: 0; border-radius: 2px; background: var(--pumpkin); box-shadow: 0 0 0 1px var(--navy-2); pointer-events: auto; cursor: pointer; }
.marker.resolved { background: var(--indep); }
.marker.active { outline: 2px solid #fff; }
.cbtn { border: 1px solid rgba(255, 107, 53, .6); background: rgba(255, 107, 53, .12); color: var(--fg); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cbtn:hover:not(:disabled) { background: rgba(255, 107, 53, .25); }
.cbtn:disabled { opacity: .55; cursor: not-allowed; }

.w-info h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
.panel { background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 8px; display: grid; gap: 8px; min-width: 0; }
.panel h2, .rail h2, .review h2 { font-family: var(--body); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.panel p { font-size: 14.5px; }
.bullets { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14.5px; }
.bullets li::marker { color: var(--pumpkin); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.related a { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-size: 13.5px; min-width: 0; }
.related img { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; }
.related .n { display: block; color: var(--muted); font-size: 11px; }

.transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.transcript li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 8px 6px; border-radius: 8px; }
.transcript li.now { background: rgba(255, 107, 53, .12); }
.transcript .ts { background: none; border: 0; padding: 2px 0; color: var(--pumpkin-2); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; align-self: start; }
.transcript .cap { font-size: 14.5px; overflow-wrap: anywhere; }
.transcript .vo { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.rail { background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; display: grid; gap: 2px; }
.rail h2 { margin: 2px 6px 6px; }
.rail h3 { margin: 10px 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pumpkin-2); }
.rail a { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; min-width: 0; }
.rail a:hover { background: var(--navy-3); }
.rail a.on { background: rgba(255, 107, 53, .14); outline: 1px solid rgba(255, 107, 53, .5); }
.rail img { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; }
.rail .rt { display: grid; min-width: 0; }
.rail .t { color: var(--fg); overflow-wrap: anywhere; }
.rail .d { color: var(--muted); font-size: 12px; }
.rail .watched svg { width: 12px; height: 12px; vertical-align: -1px; fill: var(--green); margin-right: 2px; }

/* ---- review rail ---- */
.review { background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; align-content: start; max-height: min(80vh, 640px); overflow: auto; }
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--navy); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.tabs button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--navy-3); color: var(--fg); }
.review:not([data-state="ready"]) .tabs { display: none; }
.composer { display: grid; gap: 8px; background: var(--navy); border: 1px solid rgba(255, 107, 53, .5); border-radius: 10px; padding: 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.composer label { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.composer textarea, .reply textarea { width: 100%; resize: vertical; background: var(--navy-2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); }
.composer .btn { justify-self: start; }
.threads { display: grid; gap: 10px; }
.beat-group h3 { font-size: 12px; color: var(--muted); font-weight: 700; margin: 4px 2px 6px; }
.thread { border: 1px solid var(--line); border-radius: 8px; background: var(--navy); }
.thread.open-state { border-left: 3px solid var(--pumpkin); }
.thread.resolved-state { border-left: 3px solid var(--indep); }
.thread > button.th-head { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; cursor: pointer; }
.th-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); align-items: center; }
.th-meta .at { color: var(--pumpkin-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(159, 176, 205, .15); color: var(--muted); }
.badge.old { background: rgba(255, 107, 53, .15); color: var(--pumpkin-2); }
.th-body { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.th-detail { padding: 0 10px 10px; display: grid; gap: 8px; }
.replies { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: grid; gap: 6px; font-size: 13.5px; }
.replies .who { color: var(--muted); font-size: 12px; }
.reply { display: grid; gap: 6px; }
.th-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { color: var(--muted); font-size: 13px; }

/* ---- gate ---- */
.gate { display: grid; place-items: center; min-height: calc(100vh - 120px); padding-block: 40px; }
.gate-card { width: 100%; max-width: 420px; background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.gate-card h1 { font-size: 26px; }
.gate-card form { display: grid; gap: 10px; }
.gate-card label { font-size: 13px; color: var(--muted); }
.gate-card input { width: 100%; background: var(--navy); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
.gate-card .btn { justify-self: start; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding-block: 16px; }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 719px) {
  .watch, .no-review .watch { grid-template-columns: minmax(0, 1fr); grid-template-areas: "player" "review" "info" "chapters"; gap: 16px; }
  .no-review .watch { grid-template-areas: "player" "info" "chapters"; }
  .review { max-height: none; }
  .time { order: 1; }
  .scrub { order: 2; flex-basis: 100%; }
  .ctl, .cbtn { order: 1; }
  .cbtn { margin-left: auto; }
  /* composer becomes a bottom sheet */
  .composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: 14px 14px 0 0; border-width: 1px 0 0; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0, 0, 0, .5); background: var(--navy-2); }
  .crumb { display: none; }
  .pass .pfx { display: none; }
}
@media (min-width: 720px) {
  .w-chapters { position: sticky; top: 16px; }
}
