/* Hermes — P10 Passage Frame — commodity reference view (CV-10).
   Same visual system as samples/10-passage-frame: deep dark-to-light chapter progression,
   amber signal, Georgia display lines, Inter/system body, thick chapter rules, cinema frames with
   opaque caption plates. No transitions, no animation, no gradients, no external assets. */

:root {
  color-scheme: light;
  --ink: #102628;
  --ink-soft: #3d5252;
  --deep: #071719;
  --deep-2: #102a2d;
  --deep-3: #193a3d;
  --deep-4: #34524f;
  --mid: #bbc3b6;
  --paper: #f5eddd;
  --paper-2: #e7d8bb;
  --paper-3: #d3c19f;
  --signal: #f0a45f;
  --signal-light: #ffd3a6;
  --signal-ink: #7f3214;
  --rule: #82958e;
  --focus: #ffd085;
  --measure: 72rem;
  --gutter: clamp(1rem, 4vw, 4.5rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.55;
  scroll-behavior: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: #071719;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
}

svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 0.2em;
}

a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #071719;
}

.chapter-i a:focus-visible,
.chapter-close a:focus-visible,
.chapter-agri a:focus-visible,
.chapter-softs a:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid #071719;
  box-shadow: 0 0 0 6px #ffd085;
}

main :target,
[id]:target {
  scroll-margin-block-start: 1rem;
}

h1,
h2,
h3,
p,
figure,
ol,
ul,
dl {
  margin-block-start: 0;
}

h1,
h2,
h3 {
  max-width: 26ch;
  line-height: 1.06;
  text-wrap: balance;
}

h1 {
  margin-block-end: 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6.5vw, 6.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h2 {
  margin-block-end: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

h3 {
  margin-block-end: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

p,
li,
dt,
dd,
a {
  overflow-wrap: anywhere;
}

/* ---------- skip link, masthead, notice ---------- */

.skip-link {
  position: fixed;
  z-index: 100;
  inset: 0 auto auto 0;
  min-height: 44px;
  padding: 0.75rem 1rem;
  color: var(--deep);
  background: var(--focus);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: 4.5rem;
  padding: 0.75rem var(--gutter);
  color: var(--paper);
  background: var(--deep-2);
}

.masthead p {
  margin: 0;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-context,
.reel-mark,
.scene-kicker,
.frame-number,
.filmstrip-title,
.reel-title,
.lbl,
.record dt {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.45;
  text-transform: uppercase;
}

.brand-context {
  color: #f0dfbf;
}

.reel-mark {
  color: var(--signal-light);
  text-align: end;
}

.catalog-notice {
  margin: 0;
  padding: 0.8rem var(--gutter);
  color: var(--paper);
  background: var(--deep);
  border-block: 1px solid #8fa09a;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

/* ---------- filmstrip navigator (primary interaction) + reel order (static equivalent) ---------- */

.filmstrip-nav {
  color: var(--paper);
  background: #0d2427;
  border-block-end: 0.65rem solid var(--deep);
}

.filmstrip {
  padding: 0.75rem var(--gutter) 0;
}

.filmstrip-title,
.reel-title {
  margin: 0 0 0.5rem;
  color: var(--signal-light);
}

.filmstrip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  width: min(100%, 100rem);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--rule);
}

.filmstrip-list li {
  min-width: 0;
}

.filmstrip-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 4.15rem;
  padding: 0.65rem;
  border-inline-start: 1px solid var(--rule);
  border-block-end: 1px solid var(--rule);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
}

.filmstrip-list .num {
  color: var(--signal-light);
  font-family: Georgia, "Times New Roman", serif;
  flex: 0 0 auto;
  min-width: 3ch;
  font-size: 1.35rem;
  white-space: nowrap;
}

.filmstrip-list a:hover,
.filmstrip-list a:focus-visible,
.filmstrip-list a[aria-current="true"] {
  color: var(--deep);
  background: var(--signal-light);
}

.filmstrip-list a:hover .num,
.filmstrip-list a:focus-visible .num,
.filmstrip-list a[aria-current="true"] .num {
  color: var(--deep);
}

.reel-order {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 1rem var(--gutter) 1.5rem;
  color: var(--paper);
}

.reel-order ol {
  margin: 0;
  padding-inline-start: 1.25rem;
  font-size: 1rem;
}

.reel-order li {
  margin-block-end: 0.35rem;
}

.reel-name {
  font-weight: 650;
}

/* ---------- chapters (dark -> light) ---------- */

.chapter {
  min-width: 0;
  border-block-end: 0.65rem solid var(--deep);
}

.chapter-i {
  color: var(--paper);
  background: var(--deep-2);
}

.scene-copy {
  width: min(100%, var(--measure));
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 7rem) var(--gutter);
}

.scene-kicker {
  margin-block-end: 1.25rem;
  color: var(--signal-light);
}

.chapter-i h1 {
  color: var(--paper);
}

.opening-truth {
  max-width: 48rem;
  margin-block-end: 1.75rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 0.35rem solid var(--signal);
  font-size: clamp(1.06rem, 1.6vw, 1.3rem);
}

.opening-truth p:last-child {
  margin-block-end: 0;
}

.dataset-line {
  font-size: 1rem;
  font-weight: 700;
}

.how-to-read {
  max-width: 48rem;
  margin-block-end: 1.75rem;
  padding: 1.25rem;
  color: var(--paper);
  background: var(--deep);
  border-inline-start: 0.4rem solid var(--signal);
  font-weight: 700;
}

.back-link {
  margin: 0;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 2px solid currentColor;
  font-weight: 800;
  text-decoration: none;
}

.back-link a:hover {
  color: var(--deep);
  background: var(--signal-light);
}

.reel {
  min-width: 0;
}

.reel-heading {
  margin: 0;
  padding: 1.25rem var(--gutter);
  color: var(--paper);
  background: var(--deep);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  border-block-end: 1px solid var(--rule);
}

.chapter-lead {
  width: min(100%, var(--measure));
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(2rem, 4vw, 3.5rem);
}

.chapter-lead .proposition {
  max-width: 46rem;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 700;
}

.chapter-lead .explanation {
  max-width: 46rem;
  margin-block-end: 0;
  font-size: 1.05rem;
}

/* progression: energy deepest, softs lightest */
.chapter-energy { color: var(--paper); background: var(--deep); }
.chapter-base-metals { color: var(--paper); background: var(--deep-2); }
.chapter-bulk { color: var(--paper); background: var(--deep-3); }
.chapter-critical-minerals { color: var(--paper); background: var(--deep-4); }
.chapter-agri { color: var(--ink); background: var(--mid); }
.chapter-softs { color: var(--ink); background: var(--paper-2); }
.chapter-close { color: var(--ink); background: var(--paper); }

.chapter-agri .scene-kicker,
.chapter-softs .scene-kicker,
.chapter-close .scene-kicker,
.chapter-agri .frame-number,
.chapter-softs .frame-number {
  color: var(--signal-ink);
}

/* ---------- scenes (one commodity each) ---------- */

.scene {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas:
    "panel frame"
    "record record";
  gap: 0 clamp(1rem, 3vw, 3rem);
  width: min(100%, 100rem);
  margin-inline: auto;
  padding: clamp(2rem, 4vw, 4rem) var(--gutter) clamp(1.5rem, 3vw, 3rem);
  border-block-start: 2px solid var(--rule);
}

.chapter-agri .scene,
.chapter-softs .scene {
  border-block-start-color: var(--ink);
}

.scene-panel {
  grid-area: panel;
  min-width: 0;
  padding-block-end: 1.5rem;
}

.frame-number {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-block-end: 1rem;
  color: var(--signal-light);
}

.category-label {
  color: inherit;
}

.summary {
  max-width: 44rem;
  font-size: 1.05rem;
}

.benchmark {
  max-width: 44rem;
  margin: 0;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid currentColor;
}

.lbl {
  display: block;
  margin-block-end: 0.25rem;
}

.cinema-frame {
  grid-area: frame;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  margin: 0 0 1.5rem;
  color: var(--paper);
  background: var(--deep);
  border: 2px solid var(--rule);
}

.cinema-frame svg {
  width: 100%;
  height: 100%;
  min-height: 16rem;
  max-height: 24rem;
}

.plate {
  position: static;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 1rem clamp(1rem, 2vw, 1.5rem);
  color: var(--paper);
  background: var(--deep);
  border-block-start: 3px solid var(--signal-light);
}

.plate p {
  margin: 0;
}

.plate-label {
  margin-block-end: 0.5rem;
  color: var(--signal-light);
  font-size: 1rem;
  font-weight: 700;
}

.price-line {
  font-size: 1rem;
  line-height: 1.6;
  white-space: normal;
}

.price-line strong {
  font-weight: 800;
}

/* record strip: compact caption-led detail beneath the frame */
.record {
  grid-area: record;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem clamp(1rem, 3vw, 3rem);
  margin: 0;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--rule);
}

.rec {
  min-width: 0;
}

.rec-wide {
  grid-column: 1 / -1;
}

.record dt {
  margin-block-end: 0.35rem;
  color: inherit;
}

.record dd {
  margin: 0;
  font-size: 1rem;
}

.record ul,
.record ol {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.record li {
  margin-block-end: 0.3rem;
}

.scene-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 100rem);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(1.5rem, 3vw, 3rem);
}

.scene-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.7rem;
  border-block: 1px solid currentColor;
  font-weight: 800;
}

.scene-links a:last-child {
  justify-content: flex-end;
  text-align: end;
}

/* ---------- closing chapter ---------- */

.closing-band {
  max-width: 48rem;
  margin-block-start: 2rem;
  padding: clamp(1.15rem, 3vw, 2rem);
  background: #fff9ec;
  border: 2px solid var(--ink);
  box-shadow: 0.6rem 0.6rem 0 var(--paper-3);
}

.closing-band h3 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.closing-band p {
  margin: 0;
  font-size: 1.1rem;
}

.site-footer {
  padding: 1.5rem var(--gutter) 2.5rem;
  color: var(--paper);
  background: var(--deep);
  border-block-start: 2px solid var(--rule);
}

.site-footer p {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- responsive: static full-width scenes ---------- */

@media (max-width: 63.99rem) {
  .scene {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "panel"
      "frame"
      "record";
  }

  .record {
    grid-template-columns: minmax(0, 1fr);
  }

  .rec-wide {
    grid-column: auto;
  }
}

@media (max-width: 47.99rem) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
  }

  .reel-mark {
    grid-column: 1 / -1;
    text-align: start;
  }

  .catalog-notice {
    text-align: start;
  }

  .cinema-frame svg {
    min-height: 12rem;
    max-height: 16rem;
  }

  .scene-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-links a:last-child {
    justify-content: flex-start;
    text-align: start;
  }
}

@media (max-width: 24rem) {
  .filmstrip-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .plate,
  .cinema-frame,
  .closing-band,
  .how-to-read {
    border: 2px solid CanvasText;
  }

  .filmstrip-list a[aria-current="true"] {
    outline: 2px solid Highlight;
  }
}
