/* Hermes — P07 Threadline commodity reference (CV-07). Visual system inherited from samples/07-threadline. */
:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --muted: #cdd6d4;
  --deep: #10191d;
  --deep-2: #16252a;
  --field: #111d21;
  --line: #718a8d;
  --rule: #3b5054;
  --signal: #ffd36f;
  --signal-strong: #ffdf92;
  --teal: #8cd8cc;
  --max: 88rem;
  --edge: clamp(1rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--deep);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.62;
}

a { color: inherit; text-underline-offset: 0.22em; }
button { font: inherit; }
button, a, [tabindex="-1"] { scroll-margin: 1rem; }

:focus-visible {
  outline: 3px solid var(--signal-strong);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid currentColor;
  background: var(--signal);
  color: #11191c;
  font-weight: 800;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header, .primary-nav, main > section, .site-footer { padding-inline: var(--edge); }

.site-header {
  display: grid;
  grid-template-columns: minmax(14rem, 0.6fr) minmax(0, 1.4fr);
  gap: 1.5rem 2rem;
  align-items: center;
  max-width: var(--max);
  margin-inline: auto;
  padding-block: 1.1rem;
  border-bottom: 1px solid #52676b;
}
.brand-lockup { display: flex; gap: 0.8rem; align-items: center; }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 2px solid var(--signal);
  border-radius: 50%;
  color: var(--signal);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}
.brand-name, .brand-context { display: block; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; font-weight: 700; letter-spacing: 0.02em; }
.brand-context { color: var(--muted); font-size: 0.9rem; }

.catalog-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 3px double var(--signal);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
  max-width: var(--max);
  margin-inline: auto;
  padding-block: 0.4rem;
  border-bottom: 1px solid #394e52;
}
.primary-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.primary-nav a:hover { color: var(--ink); }

h1, h2, h3, h4, p, li { overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin-block: 0; line-height: 1.12; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { max-width: 14ch; font-size: clamp(2.6rem, 6vw, 5.6rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.4rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
h4 { font-size: 1rem; }
p { margin-block: 0; }

.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--teal);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* overview */
.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.55fr);
  gap: clamp(2rem, 6vw, 6rem);
  max-width: var(--max);
  margin-inline: auto;
  padding-block: clamp(3rem, 6vw, 6rem) clamp(3rem, 5vw, 5rem);
}
.overview-copy { max-width: 53rem; }
.service-definition { max-width: 44rem; margin-top: 1.8rem; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.5; }
.dataset-line { max-width: 44rem; margin-top: 1.1rem; color: var(--muted); }
.how-to-read { max-width: 44rem; margin-top: 1.1rem; padding-left: 1rem; border-left: 3px dashed var(--teal); color: var(--ink); }
.back-link-wrap { margin-top: 1.5rem; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; }

.request-origin {
  align-self: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 50% 50% 12% 12% / 12% 12% 8% 8%;
  background: #18282d;
}
.request-origin::before {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  margin-bottom: 1.5rem;
  border: 4px double var(--signal);
  border-radius: 50%;
  content: "";
}
.origin-index { color: var(--signal); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.request-origin h2 { margin-top: 0.55rem; font-family: inherit; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.01em; }
.request-origin p + p, .request-origin h2 + p { margin-top: 1rem; color: var(--muted); }

/* sections */
main > section + section { border-top: 1px solid #354a4e; }
.constellations, .catalog, .next-step, .limits {
  max-width: var(--max);
  margin-inline: auto;
  padding-block: clamp(3rem, 6vw, 6rem);
}
.section-intro { max-width: 62rem; margin-bottom: 2.5rem; }
.section-intro > p:last-child { max-width: 50rem; margin-top: 1.25rem; color: var(--muted); font-size: 1.06rem; }

/* dependency fields (primary interaction) */
.field-set {
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  background: var(--field);
}
.interaction-instruction { max-width: 52rem; color: var(--muted); font-size: 0.95rem; }
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.field { margin: 0; padding: 1rem; border: 1px solid var(--rule); background: #0e181c; }
.field-caption { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: baseline; }
.field-index { color: var(--signal); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.field-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; }
.field-illustrative { flex-basis: 100%; padding: 0.4rem 0.7rem; border: 1px dashed var(--signal); font-size: 0.9rem; font-weight: 700; }

.field-canvas {
  position: relative;
  aspect-ratio: 1000 / 560;
  margin-top: 1rem;
  isolation: isolate;
}
.field-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.link { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.link-solid { stroke: var(--teal); }
.link-dashed { stroke: var(--line); stroke-dasharray: 10 8; }
.link-dotted { stroke: var(--signal); stroke-dasharray: 2 7; stroke-linecap: round; }
.junction { fill: #0e181c; stroke: var(--signal); stroke-width: 3; vector-effect: non-scaling-stroke; }

.link-label {
  position: absolute;
  z-index: 1;
  padding: 0.05rem 0.4rem;
  background: #0e181c;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
  transform: translate(-50%, -50%);
}
.link-label-a { left: 25%; top: 44%; }
.link-label-b { left: 76%; top: 42%; }
.link-label-c { left: 52%; top: 76%; }
.link-label-j { left: 64%; top: 60%; color: var(--signal); font-style: normal; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }

.node {
  position: absolute;
  z-index: 2;
  display: grid;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.65rem;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--deep-2);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.node-origin { border-color: var(--signal); border-style: double; border-width: 4px; }
.node-function { border-color: var(--teal); border-radius: 0.6rem; }
.node-commodity { border-style: dashed; }
.node:hover { border-color: var(--signal-strong); }
.node[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: #11191c; }

.field-readout {
  min-height: 3.2rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--teal);
  background: #13222680;
  color: var(--ink);
}
.field-legend { margin-top: 0.6rem; color: var(--muted); font-size: 0.9rem; }
.swatch { display: inline-block; width: 1.6rem; height: 0; margin-right: 0.2rem; vertical-align: middle; border-top: 2px solid var(--teal); }
.swatch-dashed { border-top-style: dashed; border-top-color: var(--line); }
.swatch-dotted { border-top-style: dotted; border-top-color: var(--signal); }

/* static equivalent: sequenced dependency path */
.static-path { margin-top: 2rem; }
.static-path h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.path-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; margin: 1.25rem 0 0; padding: 0; list-style: none; counter-reset: path; }
.path-block { position: relative; padding: 1rem 1rem 1rem 1.25rem; border-left: 3px solid var(--teal); background: #13222680; }
.path-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.path-steps { margin: 0.75rem 0 0; padding-left: 1.3rem; }
.path-steps > li { margin-top: 0.35rem; }
.path-link { color: var(--muted); font-style: italic; }
.path-items { margin: 0.35rem 0 0; padding-left: 1.3rem; list-style: lower-roman; }
.path-items a { display: inline-block; padding-block: 0.4rem; }

/* dependency chapters (records) */
.chapter { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--line); }
.chapter-title { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.6rem); }
.chapter-index { color: var(--signal); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }

.record {
  margin-top: 1.75rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 1.25rem 1.25rem 0.4rem 0.4rem;
  background: var(--field);
}
.record-head { display: flex; flex-direction: column; gap: 0.35rem; }
.record-category { display: inline-block; align-self: flex-start; padding: 0.1rem 0.6rem; border: 1px dashed var(--teal); border-radius: 999px; color: var(--teal); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.record h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.record-summary { max-width: 62rem; margin-top: 1rem; }
.record-benchmark { max-width: 62rem; margin-top: 0.85rem; color: var(--muted); }
.record-price {
  max-width: 62rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--signal);
  background: var(--deep-2);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
}
.price-value { font-size: 1.35rem; font-weight: 800; }
.record-range, .record-context, .record-converted { max-width: 62rem; margin-top: 0.75rem; color: var(--ink); }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem 2rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--rule); }
.record-key { margin-bottom: 0.35rem; color: var(--teal); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.record ul, .record ol { margin: 0; padding-left: 1.3rem; }
.record li + li { margin-top: 0.3rem; }
.record-questions, .record-caveats, .record-sources { max-width: 62rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--rule); }
.record-sources a { color: var(--teal); }

/* closing */
.next-step-copy, .limits-copy { max-width: 50rem; margin-top: 1rem; font-size: 1.1rem; }
.limits-copy { padding-left: 1rem; border-left: 3px double var(--signal); }
.site-footer { max-width: var(--max); margin-inline: auto; padding-block: 1.5rem 2.5rem; border-top: 1px solid #52676b; color: var(--muted); }
.site-footer p + p { margin-top: 0.5rem; }
.site-footer a { display: inline-block; padding-block: 0.5rem; }

/* no-JS: the button field is not shown (no dead controls); the sequenced path is the complete equivalent */
.no-js .field-canvas, .no-js .field-readout { display: none; }

/* R7: below 66rem the fields become the vertical sequenced path (no SVG) */
@media (max-width: 65.99rem) {
  .fields { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .field { padding: 0.75rem; }
  .interaction-instruction { display: none; }
  .site-header, .overview { grid-template-columns: minmax(0, 1fr); }
  .request-origin { border-radius: 0.6rem; }
}
@media (max-width: 40rem) {
  .record-grid { grid-template-columns: minmax(0, 1fr); }
  .path-list { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 66rem) and (max-width: 90rem) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .field-canvas { max-width: 60rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .node, .field, .record, .record-price { forced-color-adjust: auto; }
  .link { stroke: CanvasText; }
}
