/* =========================================================================
   Landscape — interactive risk trajectory visualization.
   Drops in between #validation and #thesis. All tokens are inherited
   from style.css — nothing new is defined here.
   ========================================================================= */

.landscape .landscape-title em {
  font-family: var(--ff-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-0);
  letter-spacing: -0.005em;
}

.landscape-lede {
  font-family: var(--ff-italic);
  font-style: italic;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 var(--s-10);
}

.landscape-figure {
  margin: 0;
  max-width: 72rem;
  min-width: 0;
}

/* ---- Chart frame ------------------------------------------------------ */
.landscape-chart {
  position: relative;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: clamp(1rem, 2.2vw, 1.75rem) clamp(1rem, 2vw, 1.5rem)
           clamp(0.75rem, 1.6vw, 1.25rem);
  box-shadow:
    0 1px 0 0 color-mix(in oklch, var(--ink-0) 2%, transparent),
    0 20px 44px -30px color-mix(in oklch, var(--ink-0) 14%, transparent);
}

.landscape-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "kern", "liga";
}

/* ---- Grid & axes ------------------------------------------------------ */
.ls-grid line {
  stroke: var(--rule-2);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.ls-axes .ls-axis {
  stroke: var(--ink-2);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.ls-axes text {
  font-family: var(--ff-body);
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ls-axes .ls-tick-num {
  font-size: 11px;
  fill: var(--ink-2);
}

.ls-axes .ls-axis-label {
  font-family: var(--ff-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  fill: var(--ink-3);
}

/* ---- Curves ----------------------------------------------------------- */
.ls-curve {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
  transition:
    stroke 320ms var(--e-out-quart),
    stroke-width 220ms var(--e-out-quart),
    opacity 320ms var(--e-out-quart);
  cursor: pointer;
}

/* Entry draw-on animation handled via inline stroke-dasharray/offset + CSS */
.ls-curve.is-entering {
  transition: stroke-dashoffset 1200ms var(--e-out-expo);
}

/* Dim all curves when one is focused */
.landscape-chart.has-focus .ls-curve {
  stroke: var(--rule);
  stroke-width: 1.75;
  opacity: 0.6;
}

.landscape-chart .ls-curve.is-focus {
  stroke: var(--oxide);
  stroke-width: 3;
  opacity: 1;
}

/* Hit area so thin lines are easier to hover */
.ls-curve-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
  pointer-events: stroke;
}

/* ---- Endpoint labels -------------------------------------------------- */
.ls-labels {
  pointer-events: auto;
}

.ls-label {
  cursor: pointer;
}

.ls-label-text {
  font-family: var(--ff-body);
  font-size: 13px;
  fill: var(--ink-2);
  dominant-baseline: middle;
  transition: fill 260ms var(--e-out-quart), font-weight 200ms ease;
}

.ls-label-val {
  font-family: var(--ff-body);
  font-size: 11px;
  fill: var(--ink-3);
  dominant-baseline: middle;
  font-variant-numeric: tabular-nums;
}

.landscape-chart.has-focus .ls-label-text { fill: var(--ink-3); }
.landscape-chart.has-focus .ls-label-val  { fill: var(--ink-3); }

.landscape-chart .ls-label.is-focus .ls-label-text {
  fill: var(--oxide);
  font-weight: 700;
}

.landscape-chart .ls-label.is-focus .ls-label-val {
  fill: var(--oxide);
  font-weight: 700;
}

/* Hidden focusable hotspots for keyboard */
.ls-label-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}

/* Tab focus lands on the <g class="ls-label"> (tabindex=0). Paint a dashed
   oxide ring around the hit rect inside so it's visible. */
.ls-label:focus { outline: none; }
.ls-label:focus-visible .ls-label-hit {
  stroke: var(--oxide);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

/* ---- Hover readout ---------------------------------------------------- */
.ls-readout-line {
  stroke: var(--ink-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.ls-readout-dot {
  fill: var(--oxide);
  stroke: var(--paper);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.ls-readout-age {
  font-family: var(--ff-body);
  font-size: 11px;
  fill: var(--ink-2);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 180ms ease;
}

.landscape-chart.has-hover .ls-readout-line,
.landscape-chart.has-hover .ls-readout-dot,
.landscape-chart.has-hover .ls-readout-age { opacity: 1; }

/* ---- Controls --------------------------------------------------------- */
.landscape-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: var(--s-6) 0 0;
  border: 1px solid var(--ink-0);
  width: max-content;
  max-width: 100%;
}

.ls-pill {
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 0.7rem 1.1rem;
  font-family: var(--ff-body);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background-color 220ms ease, color 220ms ease;
}

.ls-pill + .ls-pill {
  border-left: 1px solid var(--ink-0);
}

.ls-pill:hover:not(.is-active) { color: var(--oxide); }

.ls-pill.is-active {
  background: var(--ink-0);
  color: var(--paper);
}

.ls-pill:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

.ls-pill.is-active:focus-visible {
  outline-color: var(--paper);
  box-shadow: inset 0 0 0 4px var(--oxide);
}

.ls-pill-muted {
  font-family: var(--ff-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.75;
  margin-left: 0.3em;
}

.ls-pill.is-active .ls-pill-muted { opacity: 0.65; }

.landscape-foot {
  margin: var(--s-6) 0 0;
  font-family: var(--ff-italic);
  font-style: italic;
  font-size: var(--fs-small);
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 56ch;
}

.landscape-foot em {
  font-family: var(--ff-italic);
  font-style: italic;
  color: var(--ink-2);
}

/* ---- Screen-reader-only summary --------------------------------------- */
.ls-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Motion & accessibility ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .ls-curve,
  .ls-curve.is-entering,
  .ls-label-text,
  .ls-label-val,
  .ls-readout-line,
  .ls-readout-dot,
  .ls-readout-age,
  .ls-pill {
    transition: none !important;
  }
}

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  .landscape-chart {
    padding: 0.9rem 0.5rem 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .landscape-svg {
    /* Keep the chart legible at mobile widths by enforcing a minimum
       intrinsic width and letting the container scroll horizontally. */
    min-width: 680px;
  }
  .landscape-controls { width: 100%; }
  .ls-pill {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.7rem 0.4rem;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-align: center;
  }
  .ls-pill-muted { display: none; }
}

@media (max-width: 480px) {
  .landscape-lede { font-size: var(--fs-body); }
  .landscape-svg { min-width: 600px; }
  .ls-pill {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    padding: 0.65rem 0.3rem;
  }
}
