/* Perslis Defense · Timeline (defense/timeline). Linked only by that page (build_defense_sections.py).
   The hero runs full bleed over the 3D road (timeline.js); "Where it came from" is a stepped rail; "The road
   ahead" is a glowing vertical roadmap. All content is plain HTML: without JS or with reduced motion it simply
   shows, lit. Palette = the Brain's systems. */
:root {
  --tl-bg: #04060b;
  --tl-ink: #e9eef7;
  --tl-muted: #97a6bb;
  --tl-line: rgba(155, 180, 210, .16);
  --tl-eye: #63e3ff;
  --tl-peel: #a88cff;
  --tl-fail: #ffb454;
  --tl-floor: #ff5d73;
  --tl-trace: #7dffb2;
  --tl-gated: #8fa3c4;
}
body.peel-site { background: var(--tl-bg); }

/* ---------------------------------------------------------------- hero: full bleed over the road */
.peel-site .band.d3-hero { max-width: none; min-height: min(84vh, 860px); padding-left: max(28px, calc((100vw - 1064px) / 2));
  padding-right: max(28px, calc((100vw - 1064px) / 2));
  background: radial-gradient(70% 60% at 62% 42%, rgba(56, 108, 190, .16), transparent 70%),
    radial-gradient(45% 45% at 30% 75%, rgba(125, 255, 178, .06), transparent 70%), var(--tl-bg); }
.d3-hero::after { background: linear-gradient(180deg, rgba(4, 6, 11, .3) 0%, transparent 18%, transparent 78%, var(--tl-bg) 100%),
  radial-gradient(ellipse 62% 58% at 50% 50%, rgba(4, 6, 11, .62) 0%, rgba(4, 6, 11, .2) 65%, rgba(4, 6, 11, .45) 100%); }
/* peel-site.css makes every hero child position:relative (0,3,0), which drops the stage into the flow;
   pin it back behind the text for this page */
.peel-site .peel-hero.d3-hero > .d3-stage { position: absolute; inset: 0; z-index: 0; }
.d3-hero h1 { text-shadow: 0 2px 30px rgba(4, 6, 11, .85); max-width: 19ch; margin-left: auto; margin-right: auto; }
.d3-hero .lede { text-shadow: 0 1px 18px rgba(4, 6, 11, .95); color: #c7d2e2; }
.d3-hero .eyebrow { color: var(--tl-trace); }
/* wide screens: the text holds the left, the road runs away on the right */
@media (min-width: 1001px) {
  .peel-site .band.d3-hero { align-items: flex-start; text-align: left; }
  .d3-hero::after { background: linear-gradient(180deg, rgba(4, 6, 11, .3) 0%, transparent 18%, transparent 80%, var(--tl-bg) 100%),
    linear-gradient(90deg, rgba(4, 6, 11, .88) 0%, rgba(4, 6, 11, .62) 30%, rgba(4, 6, 11, 0) 58%); }
  .d3-hero h1 { max-width: 12.5ch; margin-left: 0; text-align: left; font-size: clamp(3rem, 5.2vw, 4.7rem); line-height: 1.02; }
  .peel-site .d3-hero .lede { max-width: 34rem; margin-left: 0; text-align: left; font-size: 1.12rem; }
}

/* gate labels projected from the 3D scene (decorative; inside the aria-hidden stage) */
.tl-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tl-label { position: absolute; left: 0; top: 0; margin: -11px 0 0 16px; white-space: nowrap; will-change: transform, opacity; opacity: 0;
  font: 600 10px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tl-gated); padding: 5px 8px; border-radius: 999px; border: 1px solid rgba(143, 163, 196, .35); background: rgba(4, 8, 16, .6); }
.tl-label[data-status="running"] { color: var(--tl-bg); background: var(--tl-trace); border-color: var(--tl-trace);
  box-shadow: 0 0 22px rgba(125, 255, 178, .55); margin-left: 26px; }
.tl-label[data-status="next"] { color: var(--tl-fail); border-color: rgba(255, 180, 84, .5); }

/* shared chip / section rhythm */
.peel-site main > .band { position: relative; }
.peel-site main > .band h2 { letter-spacing: -.03em; }

/* ---------------------------------------------------------------- where it came from: the stepped rail */
.band > ol.tl-lineage { list-style: none; max-width: none; margin: 46px auto 30px; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); text-align: center; }
.tl-lineage::before { content: ""; position: absolute; left: 3%; right: 3%; top: 50%; height: 2px; transform: translateY(-1px);
  background: linear-gradient(90deg, rgba(125, 255, 178, .9), var(--tl-eye) 40%, var(--tl-peel) 82%, rgba(255, 180, 84, .9) 94%, rgba(255, 180, 84, .15));
  box-shadow: 0 0 14px rgba(99, 227, 255, .45); }
.band ol.tl-lineage li.tl-stage { position: relative; height: 220px; margin: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 134px; line-height: 1.35; }
.band ol.tl-lineage li.tl-stage:nth-child(even) { justify-content: flex-start; padding: 134px 0 0; }
.tl-stage > span:not(.tl-dot) { width: 190%; margin-left: -45%; }
.tl-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--tl-eye); box-shadow: 0 0 0 4px rgba(99, 227, 255, .14), 0 0 18px var(--tl-eye); }
.tl-stage::after { content: ""; position: absolute; left: 50%; width: 1px; height: 18px; background: linear-gradient(var(--tl-line), rgba(99, 227, 255, .6));
  top: calc(50% - 28px); }
.tl-stage:nth-child(even)::after { top: calc(50% + 10px); background: linear-gradient(rgba(99, 227, 255, .6), var(--tl-line)); }
.tl-stage:first-child .tl-dot { background: var(--tl-trace); box-shadow: 0 0 0 4px rgba(125, 255, 178, .16), 0 0 18px var(--tl-trace); }
.tl-stage:nth-child(n+5) .tl-dot { background: var(--tl-peel); box-shadow: 0 0 0 4px rgba(168, 140, 255, .16), 0 0 18px var(--tl-peel); }
.tl-stage[data-state="next"] .tl-dot { background: var(--tl-bg); border: 2px solid var(--tl-fail); box-shadow: 0 0 16px rgba(255, 180, 84, .55); }
.tl-when { display: block; font: 600 10.5px/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--tl-eye); margin-bottom: 6px; }
.tl-stage[data-state="next"] .tl-when { color: var(--tl-fail); }
.tl-name { display: block; font-size: .95rem; font-weight: 600; color: var(--tl-ink); }

/* ---------------------------------------------------------------- the road ahead: meter */
.tl-meter { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px auto 44px; flex-wrap: wrap; }
.tl-meter-bar { display: inline-flex; gap: 6px; }
.tl-meter-bar i { width: 34px; height: 6px; border-radius: 3px; background: rgba(143, 163, 196, .16); border: 1px solid rgba(143, 163, 196, .22); }
.tl-meter-bar i[data-status="running"] { background: var(--tl-trace); border-color: var(--tl-trace); box-shadow: 0 0 14px rgba(125, 255, 178, .7); }
.tl-meter-bar i[data-status="next"] { background: repeating-linear-gradient(90deg, rgba(255, 180, 84, .75) 0 4px, transparent 4px 7px); border-color: rgba(255, 180, 84, .6); }
.tl-meter-txt { font: 600 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--tl-muted); }

/* ---------------------------------------------------------------- the road ahead: vertical roadmap */
.tl-road-wrap { position: relative; max-width: 1060px; margin: 0 auto; }
.band ol.tl-road { list-style: none; margin: 0; padding: 0; max-width: none; text-align: left; }
.band ol.tl-road > li.tl-step { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); margin: 0;
  padding-bottom: 34px; line-height: 1.6; }
/* the neon centre line, one segment per step, drawn by status: built = solid green; next = amber fading; gated = dashed, dim */
.tl-step::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: repeating-linear-gradient(180deg, rgba(143, 163, 196, .38) 0 7px, transparent 7px 14px); }
.tl-step[data-status="running"]::before { background: linear-gradient(180deg, var(--tl-trace), var(--tl-trace) 55%, var(--tl-fail));
  box-shadow: 0 0 12px rgba(125, 255, 178, .7), 0 0 30px rgba(125, 255, 178, .25); }
.tl-step[data-status="next"]::before { background: linear-gradient(180deg, var(--tl-fail), rgba(255, 180, 84, .1));
  box-shadow: 0 0 10px rgba(255, 180, 84, .35); }
/* stagger: each card starts beside the one before it on the other side (desktop only) */
.band ol.tl-road > li.tl-step + li.tl-step { margin-top: -120px; }
.tl-step:first-child::before { top: 30px; }
.tl-step:last-child::before { bottom: auto; height: 30px; }

.tl-node { position: absolute; left: 50%; top: 30px; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; z-index: 1;
  background: var(--tl-bg); border: 2px solid rgba(143, 163, 196, .55); }
.tl-step[data-status="running"] .tl-node { background: var(--tl-trace); border-color: #d9ffe9;
  box-shadow: 0 0 0 6px rgba(125, 255, 178, .16), 0 0 26px var(--tl-trace), 0 0 60px rgba(125, 255, 178, .4); }
.tl-step[data-status="running"] .tl-node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--tl-trace);
  animation: tl-ping 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.tl-step[data-status="next"] .tl-node { border-color: var(--tl-fail); box-shadow: 0 0 18px rgba(255, 180, 84, .5); }
.tl-step[data-status="next"] .tl-node::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgba(255, 180, 84, .55); }
@keyframes tl-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }

/* cards alternate: odd on the left of the line, even on the right */
.tl-card { grid-column: 1; grid-row: 1; position: relative; padding: 22px 24px 20px; border-radius: 16px; text-align: left;
  background: linear-gradient(160deg, rgba(22, 32, 52, .78), rgba(8, 12, 22, .9)); border: 1px solid var(--tl-line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35); transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .6s ease, border-color .4s ease, box-shadow .4s ease; }
.tl-step:nth-child(even) .tl-card { grid-column: 3; }
.tl-card::before { content: ""; position: absolute; top: 29px; width: 42px; height: 1px; right: -42px;
  background: linear-gradient(90deg, rgba(143, 163, 196, .45), rgba(143, 163, 196, .1)); }
.tl-step:nth-child(even) .tl-card::before { right: auto; left: -42px; background: linear-gradient(90deg, rgba(143, 163, 196, .1), rgba(143, 163, 196, .45)); }
.tl-card:hover { transform: translateY(-3px); border-color: rgba(155, 180, 210, .32); }

.tl-step[data-status="running"] .tl-card { border-color: rgba(125, 255, 178, .55);
  background: linear-gradient(160deg, rgba(20, 56, 48, .72), rgba(8, 14, 22, .92) 60%);
  box-shadow: 0 0 0 1px rgba(125, 255, 178, .12), 0 0 44px rgba(125, 255, 178, .16), 0 18px 50px rgba(0, 0, 0, .4); }
.tl-step[data-status="running"] .tl-card::before { background: linear-gradient(90deg, var(--tl-trace), rgba(125, 255, 178, .2)); height: 2px; box-shadow: 0 0 10px var(--tl-trace); }
.tl-step[data-status="next"] .tl-card { border-color: rgba(255, 180, 84, .38);
  background: linear-gradient(160deg, rgba(52, 38, 18, .6), rgba(8, 12, 22, .9) 60%); box-shadow: 0 0 36px rgba(255, 180, 84, .08), 0 18px 50px rgba(0, 0, 0, .35); }
.tl-step[data-status="gated"] .tl-card { border-style: dashed; border-color: rgba(143, 163, 196, .24); background: rgba(10, 15, 26, .72); }
.tl-step[data-status="gated"] .tl-card h3 { color: #cdd6e4; }
.tl-step:last-child .tl-card { border-color: rgba(168, 140, 255, .45); border-style: solid;
  background: linear-gradient(160deg, rgba(40, 30, 72, .6), rgba(8, 12, 22, .92) 65%); box-shadow: 0 0 44px rgba(168, 140, 255, .12), 0 18px 50px rgba(0, 0, 0, .4); }
.tl-step:last-child .tl-node { border-color: var(--tl-peel); box-shadow: 0 0 20px rgba(168, 140, 255, .5); }

.tl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tl-num { font: 700 30px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--tl-eye), var(--tl-peel)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-step[data-status="running"] .tl-num { background-image: linear-gradient(90deg, var(--tl-trace), var(--tl-eye)); }
.tl-step[data-status="gated"] .tl-num { background-image: linear-gradient(90deg, #7b8aa4, #56637c); }
.tl-chip { display: inline-flex; align-items: center; gap: 7px; font: 700 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .16em;
  text-transform: uppercase; padding: 7px 11px; border-radius: 999px; color: var(--tl-gated); border: 1px solid rgba(143, 163, 196, .32); background: rgba(143, 163, 196, .06); }
.tl-step[data-status="running"] .tl-chip { color: var(--tl-bg); background: var(--tl-trace); border-color: var(--tl-trace); box-shadow: 0 0 18px rgba(125, 255, 178, .6); }
.tl-step[data-status="running"] .tl-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tl-bg); animation: tl-blink 1.6s ease-in-out infinite; }
.tl-step[data-status="next"] .tl-chip { color: var(--tl-fail); border-color: rgba(255, 180, 84, .55); background: rgba(255, 180, 84, .08); }
.tl-lock { flex: none; opacity: .85; }
@keyframes tl-blink { 50% { opacity: .25; } }
.tl-card h3 { margin: 0 0 8px; font-size: 1.28rem; line-height: 1.25; letter-spacing: -.015em; text-align: left; }
.tl-card p { margin: 0 0 12px; color: #b9c5d6; font-size: .98rem; line-height: 1.62; text-align: left; }
.tl-card p.tl-crutch { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--tl-line); color: #d6deea; font-size: .94rem; }
.tl-crutch b { display: block; margin-bottom: 5px; font: 600 10px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--tl-floor); }

/* the comet riding the line at reading position (created by timeline.js; absent without JS) */
.tl-comet { position: absolute; left: 50%; top: 0; width: 10px; height: 64px; margin-top: -60px; pointer-events: none; z-index: 2; opacity: 0;
  border-radius: 5px; background: linear-gradient(180deg, transparent, rgba(99, 227, 255, .5) 60%, #fff); filter: drop-shadow(0 0 8px var(--tl-eye));
  transition: opacity .3s ease; }

/* ignite on scroll: only when timeline.js opted in (html.tl-anim), never under reduced motion */
html.tl-anim .tl-step .tl-card { opacity: 0; transform: translateY(26px) scale(.98); }
html.tl-anim .tl-step:nth-child(odd) .tl-card { transform: translate(-22px, 18px) scale(.98); }
html.tl-anim .tl-step:nth-child(even) .tl-card { transform: translate(22px, 18px) scale(.98); }
html.tl-anim .tl-step.is-in:nth-child(n) .tl-card { opacity: 1; transform: none; }
html.tl-anim .tl-step .tl-node { transform: scale(.4); opacity: .3; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), opacity .4s ease; }
html.tl-anim .tl-step.is-in .tl-node { transform: none; opacity: 1; }
html.tl-anim .tl-stage > span:not(.tl-dot) { opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; }
html.tl-anim .tl-stage:nth-child(even) > span:not(.tl-dot) { transform: translateY(-8px); }
html.tl-anim .tl-stage.is-in > span:not(.tl-dot) { opacity: 1; transform: none; }
html.tl-anim .tl-stage:nth-child(2).is-in > span { transition-delay: .06s; } html.tl-anim .tl-stage:nth-child(3).is-in > span { transition-delay: .12s; }
html.tl-anim .tl-stage:nth-child(4).is-in > span { transition-delay: .18s; } html.tl-anim .tl-stage:nth-child(5).is-in > span { transition-delay: .24s; }
html.tl-anim .tl-stage:nth-child(6).is-in > span { transition-delay: .3s; } html.tl-anim .tl-stage:nth-child(7).is-in > span { transition-delay: .36s; }
html.tl-anim .tl-stage:nth-child(8).is-in > span { transition-delay: .42s; } html.tl-anim .tl-stage:nth-child(9).is-in > span { transition-delay: .48s; }

@media (prefers-reduced-motion: reduce) {
  .tl-step .tl-node::after, .tl-chip::before { animation: none !important; }
  .tl-card, .tl-card:hover { transition: none; transform: none; }
}
@media print { html.tl-anim .tl-step .tl-card, html.tl-anim .tl-stage > span { opacity: 1 !important; transform: none !important; } }

/* ---------------------------------------------------------------- tablet: the rail turns vertical */
@media (max-width: 1000px) {
  /* the hero stacks: text on top, the road standing up the screen beneath it */
  .peel-site .band.d3-hero { min-height: 0; justify-content: flex-start; padding: 56px 24px clamp(280px, 42vw, 380px); }
  .d3-hero::after { background: linear-gradient(180deg, rgba(4, 6, 11, .8) 0%, rgba(4, 6, 11, .6) 55%, transparent 72%, var(--tl-bg) 100%); }
  .band > ol.tl-lineage { grid-template-columns: 1fr; max-width: 560px; margin: 34px auto 26px; text-align: left; }
  .tl-lineage::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; transform: none;
    background: linear-gradient(180deg, rgba(125, 255, 178, .9), var(--tl-eye) 40%, var(--tl-peel) 82%, rgba(255, 180, 84, .9)); }
  .band ol.tl-lineage li.tl-stage, .band ol.tl-lineage li.tl-stage:nth-child(even) { height: auto; padding: 0 0 18px 34px; justify-content: flex-start; }
  .tl-stage > span:not(.tl-dot) { width: auto; margin-left: 0; }
  .tl-dot { left: 8px; top: 4px; margin: 0 0 0 -7px; }
  .tl-stage::after, .tl-stage:nth-child(even)::after { display: none; }
  html.tl-anim .tl-stage:nth-child(even) > span:not(.tl-dot) { transform: translateY(8px); }
}

/* ---------------------------------------------------------------- phones: one column, line on the left */
@media (max-width: 760px) {
  .peel-site .band.d3-hero { padding: 44px 20px 300px; }
  .band ol.tl-road > li.tl-step { grid-template-columns: 34px minmax(0, 1fr); padding-bottom: 22px; }
  .band ol.tl-road > li.tl-step + li.tl-step { margin-top: 0; }
  .tl-step::before, .tl-comet { left: 13px; }
  .tl-node { left: 13px; }
  .tl-card, .tl-step:nth-child(even) .tl-card { grid-column: 2; }
  .tl-card::before, .tl-step:nth-child(even) .tl-card::before { left: -21px; right: auto; width: 21px; }
  .tl-card { padding: 18px 18px 16px; }
  .tl-num { font-size: 24px; }
  .tl-meter-bar i { width: 26px; }
  html.tl-anim .tl-step:nth-child(odd) .tl-card, html.tl-anim .tl-step:nth-child(even) .tl-card { transform: translate(14px, 14px) scale(.98); }
  .tl-label { font-size: 9px; padding: 4px 7px; }
}
