/* === JWST Daily Preview app — self-contained reel + detail =========== *
 *
 * Flat merge of what used to be two files in the prototype tree:
 *   1) the reel top-page styles (theme tokens, chrome, timeline roller,
 *      panels, scroll progress)
 *   2) the detail lightbox styles (.lx-* classes for the full-bleed
 *      lightbox and the briefing Q&A panel)
 *
 * Both have non-overlapping class namespaces (.reel-shell / .panel /
 * .roller / .chrome on one side, .lx-* / .briefing* on the other), so
 * merging is a straight concatenation.
 * --------------------------------------------------------------------- */

:root {
  --bg: #000;
  --surface: #0a0a0a;
  --line: rgba(255,255,255,0.10);
  --line-2: rgba(255,255,255,0.22);
  --text: #f4f4f4;
  --text-2: #c8c8c8;
  --muted: #6a6a6a;
  --accent: #f9d35a;          /* JWST gold-coated beryllium mirrors */
  --accent-ink: #000;
  --accent-glow: rgba(249,211,90,0.35);
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
img { display: block; }
::selection { background: var(--accent-glow); color: black; }

.boot {
  display: grid; place-items: center; height: 100%;
  color: var(--muted);
  font: 500 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
}

/* ====================================================================
 *   REEL TOP PAGE
 * ==================================================================== */

/* ----- top chrome (floating) ------------------------------------- */

.chrome {
  position: fixed; top: 16px; left: 16px; right: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font: 800 14px/1 var(--sans); letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand b { color: var(--accent); }
.brand .mode {
  font: 500 11px/1 var(--mono); letter-spacing: .14em;
  color: var(--text-2); text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid var(--line);
}
.brand .reset {
  display: none;
  width: 18px; height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text-2);
  font: 500 12px/1 var(--mono);
  display: grid; place-items: center;
}
.brand .reset:hover { color: var(--text); background: rgba(255,255,255,0.18); }
.brand.has-filter .reset { display: grid; }

/* ----- timeline roller ------------------------------------------- */

.roller-wrap {
  position: relative;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  height: 70px;
}
.roller-wrap::before,
.roller-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 28px;
  pointer-events: none; z-index: 2;
}
.roller-wrap::before { left: 0; background: linear-gradient(90deg, rgba(0,0,0,0.6), transparent); }
.roller-wrap::after  { right: 0; background: linear-gradient(-90deg, rgba(0,0,0,0.6), transparent); }

.roller {
  height: 100%;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 0 8px;
  scroll-behavior: smooth;
}
.roller::-webkit-scrollbar { display: none; }

.year-block {
  display: grid;
  grid-template-rows: 16px 1fr;
  border-left: 1px solid var(--line);
  padding: 4px 4px 6px;
  min-width: max-content;
}
.year-block:first-child { border-left: 0; }
.year-label {
  padding-left: 4px;
  font: 600 10px/1 var(--mono); letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  align-self: center;
}
.year-block.has-active .year-label { color: var(--accent); }

.month-row {
  display: grid;
  grid-template-columns: repeat(12, 14px);
  align-items: end;
  gap: 2px;
}
.month-cell {
  position: relative;
  height: 40px;
  width: 14px;
  display: grid;
  grid-template-rows: 1fr 10px;
  align-items: end; justify-items: center;
  border-radius: 3px;
  background: transparent;
  border: 0; padding: 0;
  cursor: pointer;
  transition: background .12s ease;
}
.month-cell:hover { background: rgba(255,255,255,0.06); }
.month-cell:disabled { cursor: default; opacity: .35; }
.month-cell:disabled:hover { background: transparent; }
.month-cell .bar {
  width: 5px;
  margin: 0 auto;
  border-radius: 2px;
  background: rgba(255,255,255,0.32);
  min-height: 2px;
  transition: background .15s ease, transform .15s ease;
}
.month-cell:hover:not(:disabled) .bar { background: var(--text-2); }
.month-cell.active .bar {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scaleY(1.05);
}
.month-cell .lbl {
  font: 600 8px/1 var(--mono); letter-spacing: .04em;
  color: transparent;
}
.month-cell.first-of-year .lbl { color: var(--muted); }
.month-cell.active .lbl { color: var(--accent); }

.roller-hint {
  position: absolute; right: 12px; bottom: 4px;
  font: 500 9px/1 var(--mono); letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
}

/* ----- right rail: scroll progress dots -------------------------- */

.right-rail {
  position: fixed; top: 50%; right: 18px;
  transform: translateY(-50%);
  z-index: 25;
  display: grid; gap: 10px; justify-items: center;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 4px 0;
}
.right-rail::-webkit-scrollbar { display: none; }
.reel-dot {
  width: 6px; height: 6px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, width .15s ease, height .15s ease;
}
.reel-dot:hover { background: white; transform: scale(1.4); }
.reel-dot.active {
  background: var(--accent);
  width: 8px; height: 8px;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ----- reel container -------------------------------------------- */

.reel {
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }

.panel {
  position: relative;
  height: 100vh;
  width: 100vw;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
}

.panel .bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.55) saturate(1.1);
  transform: scale(1.05);
}
.panel .stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 1;
}
.panel .stage img {
  max-width: 86%; max-height: 78%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  cursor: zoom-in;
}

.panel .copy {
  position: absolute; left: 6%; bottom: 8%;
  max-width: 560px;
  z-index: 2;
  display: grid; gap: 12px;
}
.panel .copy .kicker {
  font: 500 11px/1 var(--mono); letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase;
}
.panel .copy h2 {
  margin: 0;
  font: 700 44px/1.04 var(--sans);
  letter-spacing: -0.015em;
  color: white;
}
.panel .copy .sub {
  margin: 0;
  font: 500 13px/1.4 var(--mono); letter-spacing: .02em;
  color: var(--text-2);
}
.panel .copy .sub code { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.panel .copy .filters {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.panel .copy .ft {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 11px/1 var(--mono); padding: 4px 7px;
  border-radius: 4px;
  color: white;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.panel .copy .ft-icon {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--filter-color, #777);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.25);
  flex: 0 0 auto;
}
.panel .copy .ft code {
  font: inherit;
  color: inherit;
}

.panel .top-meta {
  position: absolute; right: 6%; top: 110px;
  z-index: 2;
  text-align: right;
  font: 500 11px/1.4 var(--mono);
  color: var(--text-2);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.panel .top-meta b {
  display: block;
  font-size: 13px; color: var(--accent);
  letter-spacing: .04em; text-transform: none;
}

.panel .hint {
  position: absolute; right: 6%; bottom: 8%;
  z-index: 2;
  display: flex; align-items: center; gap: 8px;
  font: 500 11px/1 var(--mono); letter-spacing: .14em;
  color: var(--text-2); text-transform: uppercase;
}
.panel .hint svg { width: 14px; height: 14px; }
.panel:last-child .hint { display: none; }

.panel .progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255,255,255,0.06);
  z-index: 3;
}
.panel .progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), white);
  transform-origin: left;
}

@media (max-width: 800px) {
  .chrome { grid-template-columns: 1fr; }
  .right-rail { right: 8px; }
  .panel .copy { left: 6%; right: 6%; max-width: none; bottom: 14%; }
  .panel .copy h2 { font-size: 30px; }
  .panel .top-meta { top: 86px; right: 6%; font-size: 10px; }
  .panel .stage img { max-height: 56%; }
}

/* ====================================================================
 *   DETAIL LIGHTBOX (full-bleed)
 * ==================================================================== */

.lx-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.97);
  display: none;
  z-index: 60;
  grid-template-rows: 1fr auto;
  transition: grid-template-rows .4s cubic-bezier(.2, .8, .1, 1);
}
.lx-bg.open { display: grid; }
.lx-bg.briefing-open {
  grid-template-rows: 30vh 1fr;
}

.lx-stage {
  position: relative;
  display: grid; place-items: center;
  overflow: hidden;
  min-height: 0;
}
.lx-stage img {
  max-width: 92%; max-height: 92%;
  object-fit: contain;
  transition: max-height .4s ease;
}

.lx-close, .lx-nav {
  position: absolute;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: #f4f4f4;
  font-size: 20px;
  cursor: pointer;
  transition: background .15s ease;
}
.lx-close:hover, .lx-nav:hover { background: rgba(255,255,255,0.15); }
.lx-close { top: 18px; right: 18px; }
.lx-nav.prev { top: 50%; left: 24px; transform: translateY(-50%); }
.lx-nav.next { top: 50%; right: 24px; transform: translateY(-50%); }

.lx-footer {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.92);
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  min-height: 0;
}

.briefing-handle {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 28px;
  background: rgba(10,10,10,0.96);
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  color: #b8b8b8;
  font: 500 11px/1 var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
  text-align: left;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}
.briefing-handle:hover {
  background: rgba(28,28,28,0.96);
  color: #f4f4f4;
}
.briefing-handle .arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #f4f4f4;
  font: 600 13px/1 var(--mono);
  transition: transform .35s cubic-bezier(.2, .8, .1, 1), background .15s ease;
}
.briefing-handle:hover .arrow { background: rgba(255,255,255,0.16); }
.lx-bg.briefing-open .briefing-handle .arrow { transform: rotate(180deg); }
.briefing-handle .label { flex: 1; }
.briefing-handle .label b {
  color: #f4f4f4; font-weight: 600;
  margin-left: 4px;
}

.lx-info {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  padding: 20px 28px;
  background: transparent;
  align-items: start;
  flex-shrink: 0;
}
.lx-info .col {
  display: grid; gap: 6px;
  font-size: 13px;
  color: #f4f4f4;
  font-family: var(--sans);
}
.lx-info h2 {
  margin: 0;
  font: 700 22px/1.1 var(--sans);
  letter-spacing: -0.01em;
  color: #f4f4f4;
}
.lx-info p { margin: 0; color: #b8b8b8; }
.lx-info p code { font: 500 11px/1 var(--mono); color: #6a6a6a; }
.lx-info dt {
  font: 500 11px/1.2 var(--mono);
  color: #6a6a6a;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.lx-info dd { margin: 0 0 6px; color: #f4f4f4; }
.lx-info .ftchips { display: flex; flex-wrap: wrap; gap: 4px; }
.lx-info .ft {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 10px/1 var(--mono);
  padding: 4px 7px; border-radius: 4px;
  color: white;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.lx-info .ft-icon {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--filter-color, #777);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.25);
  flex: 0 0 auto;
}
.lx-info .ft code {
  font: inherit;
  color: inherit;
}
.lx-info .ft.mapped {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.briefing {
  display: none;
  padding: 28px 28px 44px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.lx-bg.briefing-open .briefing { display: block; }

.briefing-inner { max-width: 760px; }

.briefing h3 {
  margin: 0 0 6px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: uppercase;
}
.briefing .briefing-meta {
  margin: 0 0 26px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .04em;
  color: #6a6a6a;
}

.briefing .qa {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.briefing .qa:last-child {
  margin-bottom: 0; padding-bottom: 0; border-bottom: 0;
}
.briefing .qa .q {
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .14em;
  color: #c8c8c8;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.briefing .qa .a {
  font: 400 15px/1.6 var(--sans);
  color: #f4f4f4;
  margin: 0;
  max-width: 720px;
}
.briefing .qa.is-placeholder .a {
  color: #9a9a9a;
}

@media (max-width: 720px) {
  .lx-info { grid-template-columns: 1fr; }
  .lx-bg.briefing-open { grid-template-rows: 22vh 1fr; }
  .briefing { padding: 22px 18px 36px; }
  .briefing-handle { padding: 12px 18px; }
}
