/* Exploration house style, extracted from The Sun Keeper
   (scenario-com-landing-page, branch feat/one-take-many-angles,
   scripts/experiments/one-take-many-angles/source/style.css).
   Copy into the exploration, then change ONLY the colour tokens in :root.
   Fonts: copy assets/fonts/ next to this file (keep the OFL notices). */

@font-face {
  font-family: 'Instrument Sans';
  src: url(fonts/instrument-sans-regular.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url(fonts/instrument-serif-regular.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Swap these per exploration. Keep the roles and the contrast. */
  --bg: #15161d; /* page */
  --panel: #1d1f29; /* raised surfaces, secondary buttons */
  --ink: #efeadf; /* primary text */
  --muted: #a9afbd; /* secondary text */
  --accent: #e9b85c; /* the one accent: primary button, eyebrow, selected, focus */
  --accent-hover: #f4c872;
  --rule: #393d4c; /* 1px hairlines and outlines */
  --glass: #15161ddf; /* overlay controls on media: --bg at ~87% */
  --glass-line: #efeadf55; /* overlay control border: --ink at ~33% */

  --experiment-footer-bg: var(--bg);
  --experiment-footer-ink: var(--muted);
  --experiment-footer-border: var(--rule);

  color-scheme: dark;
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: inherit; }
button:disabled { opacity: 0.4; cursor: default; }
a, button, input, select { outline-offset: 5px; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
}
button, a { transition: color 0.2s, background 0.2s, border-color 0.2s; }
button:hover:not(:disabled) { color: var(--accent); }
[hidden] { display: none !important; }

/* Icons: 24-unit line icons, stroke 1.6, round caps, currentColor. */
.icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }

/* ---------- Masthead: logo / explorations ........ Create yours ↗ ---------- */
.masthead {
  max-width: 1600px;
  margin: auto;
  padding: 24px 4.2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { width: 104px; height: 26px; object-fit: contain; }
.brand span { font-size: 12px; color: var(--muted); margin-left: 9px; }
.create { text-decoration: none; display: flex; gap: 28px; align-items: center; }
.create span { font-size: 20px; color: var(--accent); }

main { max-width: 1600px; margin: auto; padding: 0 4.2%; }

/* ---------- Opening: eyebrow + serif title (left), statement (right) ---------- */
.opening {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 0 30px;
}
.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow .edition { display: inline-block; margin-left: 28px; white-space: nowrap; }
h1 {
  margin: 0;
  font: 400 clamp(48px, 5.2vw, 82px) / 0.93 'Instrument Serif', serif;
  letter-spacing: -0.025em;
}
.title-dot { color: var(--accent); }
.intro { color: var(--muted); }
.intro p { margin: 0; }
.intro .statement {
  margin-bottom: 10px;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.intro .statement em { font-style: normal; color: var(--accent); }
.intro > p:last-child { font-size: 12px; line-height: 1.6; }

/* ---------- Action row: one filled primary + outlined/panel secondaries ---------- */
.action-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(var(--secondary-count, 3), 1fr);
  gap: 8px;
  margin: 0 0 18px;
}
.action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
}
.action .icon { color: var(--accent); }
.action strong { display: block; font-size: 13px; font-weight: 600; }
.action small { display: block; margin-top: 5px; font-size: 10px; line-height: 1.4; color: var(--muted); }
.action:hover { border-color: var(--accent); }
.action.outline { background: transparent; }
.action.primary {
  justify-content: flex-start;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.action.primary .icon, .action.primary small { color: var(--bg); }
.action.primary small { opacity: 0.85; }
.action.primary:hover { background: var(--accent-hover); color: var(--bg); }

/* ---------- Stage + side rail ---------- */
.stage-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
.stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0003; }
.stage-top {
  position: absolute;
  inset: 16px 18px auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'badges shortcuts tools';
  align-items: start;
  gap: 12px;
  pointer-events: none;
}
.stage-top > * { pointer-events: auto; }

/* Glass select ("Camera cut ⌄") */
.glass-select { position: relative; display: inline-block; }
.glass-select select {
  appearance: none;
  height: 36px;
  min-width: 122px;
  padding: 7px 24px 7px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 4px;
  background: var(--glass);
  color: var(--ink);
  font: 11px 'Instrument Sans', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.glass-select .icon {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--accent); pointer-events: none;
}

/* Glass shortcut pill ("[O] Hold to see the original  [C] Compare") */
.shortcut-row {
  grid-area: shortcuts;
  justify-self: center;
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--glass-line);
  border-radius: 5px;
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.shortcut-row button {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 5px 7px; border-radius: 3px;
  font-size: 10px; white-space: nowrap;
}
.shortcut-row button:hover, .shortcut-row button[aria-pressed='true'] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
kbd {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 3px;
  border: 1px solid var(--glass-line); border-radius: 3px;
  font: 10px 'Instrument Sans', sans-serif;
}

/* Glass icon tools (sound, fullscreen) */
.stage-tools { grid-area: tools; display: flex; gap: 6px; }
.tool {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 9px;
  border: 1px solid var(--glass-line); border-radius: 4px;
  background: var(--glass); color: var(--ink);
  backdrop-filter: blur(10px);
}
.tool:hover { background: var(--bg); }

/* Centre play: round glass disc + caption underneath */
.stage-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  font-size: 12px; text-shadow: 0 1px 9px #000;
}
.stage-play svg {
  width: 68px; height: 68px; padding: 21px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 53%, transparent);
  background: color-mix(in srgb, var(--bg) 44%, transparent);
  backdrop-filter: blur(8px);
}
.stage-play:hover svg { border-color: var(--accent); }

/* Rail: numbered list with hairlines ("Three ways to imagine") */
.rail-label { margin: 0 0 12px; font-size: 10px; letter-spacing: 0.05em; color: var(--muted); }
.rail-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 17px 0; border-top: 1px solid var(--rule); text-align: left;
}
.rail-item:last-of-type { border-bottom: 1px solid var(--rule); }
.rail-item .num { font-size: 10px; color: var(--muted); }
.rail-item strong { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 400; }
.rail-item small { font-size: 10px; color: var(--muted); }
.rail-item.selected .num, .rail-item.selected strong { color: var(--accent); }
.rail-item .swatch { margin-left: auto; width: 23px; height: 30px; border: 1px solid #fff2; }

/* Card ("The camera study 01 / 13") */
.card {
  margin-top: 14px; padding: 18px;
  border: 1px solid color-mix(in srgb, var(--rule) 70%, var(--ink));
  background: linear-gradient(150deg, color-mix(in srgb, var(--panel) 70%, var(--rule)), var(--panel) 70%);
}
.card h2, .card h3 { margin: 0; font: 400 32px / 1 'Instrument Serif', serif; letter-spacing: -0.02em; }
.card .count { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--muted); }
.card p { font-size: 12px; color: var(--muted); }

/* ---------- Drawers (How it was made, Learn it) ---------- */
dialog.drawer {
  width: min(1080px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
}
dialog.drawer::backdrop { background: #000a; backdrop-filter: blur(4px); }
.drawer-top {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--rule); background: var(--bg);
}
.drawer-top .eyebrow { margin: 0; font-size: 10px; }
.drawer-body { padding: 32px 24px 48px; overflow-y: auto; }
.drawer-body h2 { margin: 0 0 14px; font: 400 52px / 0.95 'Instrument Serif', serif; letter-spacing: -0.025em; }
.drawer-body h3 { margin: 32px 0 10px; font: 400 30px / 1 'Instrument Serif', serif; }
.drawer-body p { font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 68ch; }

/* ---------- Lesson layer ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); gap: 20px;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-size: 10px; color: var(--accent); font-variant-numeric: tabular-nums;
}
.step h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.step img, .step video { width: 100%; border: 1px solid var(--rule); display: block; }
.step dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 11px; }
.step dt { color: var(--muted); }
.step dd { margin: 0; }
.prompt-excerpt {
  margin: 10px 0 0; padding: 12px 14px;
  border-left: 2px solid var(--accent); background: var(--panel);
  font: 12px / 1.6 ui-monospace, 'SF Mono', Menlo, monospace; white-space: pre-wrap;
}
.check { display: flex; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--ink); }
.check::before { content: '✓'; color: var(--accent); }

.mistakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mistake { padding: 16px; border: 1px solid var(--rule); background: var(--panel); font-size: 12px; }
.mistake .label { display: block; margin: 12px 0 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.mistake .label:first-child { margin-top: 0; }
.mistake p { margin: 0; line-height: 1.55; }
.mistake img { width: 100%; margin-bottom: 10px; border: 1px solid var(--rule); }

.make-yours { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.make-yours .action { justify-content: flex-start; }

/* Glossary chip: term + tiny marker, one-line definition on hover/focus/tap */
.term {
  position: relative; display: inline;
  padding: 0; border: 0; border-bottom: 1px dotted var(--accent);
  color: inherit; font: inherit; cursor: help;
}
.term::after {
  content: 'i'; display: inline-grid; place-items: center;
  width: 12px; height: 12px; margin-left: 3px; vertical-align: 1px;
  border: 1px solid var(--rule); border-radius: 50%;
  font-size: 8px; color: var(--accent);
}
.term-tip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 5;
  width: max-content; max-width: 260px; padding: 8px 10px;
  border: 1px solid var(--glass-line); border-radius: 4px;
  background: var(--glass); backdrop-filter: blur(10px);
  font-size: 11px; line-height: 1.5; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.term:hover .term-tip, .term:focus-visible .term-tip, .term[aria-expanded='true'] .term-tip { opacity: 1; }

/* ---------- Responsive (keep these breakpoints) ---------- */
@media (max-width: 1100px) {
  .stage-layout { grid-template-columns: 1fr; }
  .action-row { grid-template-columns: 1.35fr repeat(var(--secondary-count, 3), 1fr); }
  .action .icon { display: none; }
}
@media (max-width: 800px) {
  .opening { flex-direction: column; align-items: start; }
  .opening h1 { font-size: 52px; }
  .intro .statement { font-size: 26px; }
  .action-row { grid-template-columns: 1fr 1fr; }
  .action.primary { grid-column: 1 / -1; min-height: 58px; }
  .action { min-height: 52px; }
  .action .icon { display: block; }
  .action-row > .action:last-child:nth-child(even) { grid-column: 1 / -1; }
  /* stage-top fills the stage so the shortcut pill can sit at its bottom edge */
  .stage-top { inset: 12px; grid-template-columns: 1fr auto; grid-template-areas: 'badges tools'; align-content: start; }
  .stage-top .shortcut-row { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); }
  .stage-play span { display: none; }
  .stage-play svg { width: 56px; height: 56px; padding: 17px; }
  .eyebrow .edition { display: block; margin: 4px 0 0; }
  .step { grid-template-columns: 32px minmax(0, 1fr); }
  .step > :last-child { grid-column: 2; }
  .mistakes { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .masthead { padding: 20px 5%; }
  .brand span { display: none; }
  .create { gap: 10px; font-size: 11px; }
  .tool { width: 36px; height: 36px; padding: 7px; }
  .drawer-body h2 { font-size: 40px; }
  dialog.drawer { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
