:root {
  color-scheme: light;
  --ink: #222;
  --muted: #555;
  --line: #ddd;
  --accent: #1658a8;
  --signal: #a52a24;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 15px; line-height: 1.65; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #103e76; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.4; font-weight: 600; }
h1 { font-size: 26px; }
h2 { margin-bottom: 14px; font-size: 18px; }
h3 { margin-bottom: 12px; font-size: 15px; }
p + p { margin-top: 12px; }
strong, th { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.page { width: min(820px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 10; padding: 8px 12px; background: #fff; }
.paper-intro { padding-top: 40px; }
.paper-intro h1, .subtitle { text-align: center; }
.subtitle { margin-top: 6px; }
.abstract { margin-top: 20px; }
.settings-note { margin-top: 12px; }
.paper-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; }
.content-section { padding-top: 36px; }
.section-intro { margin-bottom: 20px; }

.hdr-media { width: 100%; height: auto; dynamic-range-limit: no-limit; }
.sdr-view .hdr-media { dynamic-range-limit: standard; }
.hdr-view .hdr-media { dynamic-range-limit: no-limit; }
.meter-card { margin-top: 20px; }
.meter-labels { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 6px; text-align: center; }
.meter-card figcaption { margin-top: 12px; color: var(--muted); }
.hdr-setup { margin-top: 20px; }
.hdr-setup summary { width: fit-content; cursor: pointer; font-weight: 600; }
.hdr-setup[open] summary { margin-bottom: 12px; }
.hdr-setup-platforms { margin: 14px 0 0; }
.hdr-setup-platforms > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; }
.hdr-setup-platforms > div + div { margin-top: 14px; }
.hdr-setup-platforms dt { font-weight: 600; }
.hdr-setup-platforms dd { margin: 0; overflow-wrap: anywhere; }

.demo-card + .demo-card, .pair-card + .pair-card { margin-top: 32px; }
.dual-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wolf-comparison { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.view-panel { min-width: 0; }
.view-panel img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.portrait-pair .view-panel img { aspect-ratio: 3 / 4; max-height: 400px; }
.view-panel figcaption { margin-top: 8px; color: var(--muted); }
.view-panel figcaption strong { color: var(--ink); }
.view-panel figcaption strong::after { content: " · "; font-weight: 400; color: var(--muted); }
.figure-note { margin-top: 12px; }
.citation { white-space: nowrap; font-weight: 400; }
/* Keep full-resolution base/gain-map texels paired during downscaling.
   Separate smooth interpolation can reveal the SDR outlines in these pairs.
   Chromium uses pixelated; prefer crisp-edges where it is supported. */
.aligned-sampling .hdr-media {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.drag-inspect { margin-top: 32px; }
.drag-inspect summary { width: fit-content; cursor: pointer; font-weight: 600; }
.drag-inspect[open] summary { margin-bottom: 12px; }
.drag-demo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 20px; }
.drag-source, .drop-preview { min-width: 0; }
.drag-source { cursor: grab; }
.drag-source:active { cursor: grabbing; }
.drag-source.is-dragging { opacity: .55; }
.drag-source img, .drop-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.drag-source figcaption, .drop-preview figcaption { margin-top: 8px; color: var(--muted); }
.drag-arrow { align-self: center; color: var(--signal); }
.drop-placeholder { display: grid; aspect-ratio: 4 / 3; place-items: center; border: 1px dashed #888; color: var(--muted); text-align: center; }
.drop-preview.is-over .drop-placeholder { border-color: var(--accent); color: var(--accent); }
.drag-note { margin-top: 12px; color: var(--muted); }
.drag-tip { margin-top: 24px; color: var(--muted); }

.flow-diagram { max-width: 720px; margin: 20px auto 28px; }
.flow-node { min-width: 0; padding: 14px 16px; border: 1px solid #aaa; }
.flow-node strong, .flow-node span { display: block; }
.flow-inputs, .flow-outputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.flow-plus, .flow-divergence { align-self: center; text-align: center; }
.flow-divergence, .flow-arrow { color: var(--signal); }
.flow-arrow { padding-block: 6px; text-align: center; }
.flow-compute, .flow-package { text-align: center; }
.flow-compute code { display: block; margin-top: 4px; font: inherit; }
.flow-target { border-color: var(--signal); }

.table-scroll { overflow-x: auto; }
.moderation-table { width: 100%; min-width: 640px; border-collapse: collapse; font: inherit; }
.moderation-table th, .moderation-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.moderation-table thead th { border-top: 1px solid #555; border-bottom-color: #888; }
.moderation-table tbody th { font-weight: 400; }
.danger { color: var(--signal); }
.agent-case + .agent-case { margin-top: 40px; }
.source-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 16px 0 20px; }
.source-views dt { font-weight: 600; }
.source-views dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.agent-trace { margin: 0; padding: 0; list-style: none; }
.agent-trace > li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; padding-block: 12px; border-top: 1px solid var(--line); }
.trace-role { font-weight: 600; }
.trace-quote { white-space: normal; overflow-wrap: anywhere; }
.trace-code { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; }
.trace-code code { font: inherit; }
.tool-return { margin-top: 8px; color: var(--muted); }
.agent-outcome { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; margin-top: 16px; padding-left: 14px; border-left: 2px solid var(--signal); }
.agent-outcome > img { width: 100px; height: 60px; margin-top: 2px; }
.image-sources ol { margin: 0; padding-left: 28px; color: var(--muted); }
.image-sources li + li { margin-top: 12px; }
.image-sources li { scroll-margin-top: 24px; overflow-wrap: anywhere; }
.site-footer { margin-top: 48px; padding-block: 20px; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 640px) {
  .page { width: calc(100% - 32px); }
  .paper-intro { padding-top: 32px; }
  .content-section { padding-top: 36px; }
  .paper-links { gap: 6px 18px; }
  .dual-view, .drag-demo { grid-template-columns: 1fr; }
  .dual-view { gap: 18px; }
  .drag-arrow { justify-self: center; transform: rotate(90deg); }
  .flow-inputs, .flow-outputs { grid-template-columns: 1fr; }
  .flow-plus, .flow-divergence { justify-self: center; }
  .flow-node { padding: 12px; }
  .agent-trace > li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .source-views { grid-template-columns: 1fr; gap: 12px; }
  .hdr-setup-platforms > div { grid-template-columns: 1fr; gap: 4px; }
  .agent-outcome { grid-template-columns: 1fr; gap: 8px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
