/* De la semnal la elicopter — microsite explicativ SAREX 2026.
   Dual theme from day one. All colours through semantic variables. */

:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --bg-raised: #fffdf8;
  --bg-sunken: #ece6d9;
  --fg: #182230;
  --fg-soft: #43536a;
  --fg-faint: #4f5c72;
  --line: rgba(24, 34, 48, 0.16);
  --line-strong: rgba(24, 34, 48, 0.38);
  --shadow: rgba(24, 34, 48, 0.14);
  --sea: #0a4e77;
  --sea-soft: #e0eef6;
  --signal: #821f14;
  --signal-soft: #f8e2db;
  --ok: #124e2c;
  --ok-soft: #ddf0e3;
  --warn: #5d3f09;
  --warn-soft: #f6e8c8;
  --focus: #0a4e77;
  --on-sea: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 70ch;
  --wide: 1120px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d141d;
    --bg-raised: #141d29;
    --bg-sunken: #090e15;
    --fg: #edf1f6;
    --fg-soft: #bcc8d8;
    --fg-faint: #9fadc0;
    --line: rgba(237, 241, 246, 0.16);
    --line-strong: rgba(237, 241, 246, 0.4);
    --shadow: rgba(0, 0, 0, 0.55);
    --sea: #7cc3e8;
    --sea-soft: #14293a;
    --signal: #f0937f;
    --signal-soft: #3a1a13;
    --ok: #7fd6a4;
    --ok-soft: #123426;
    --warn: #e3bd6d;
    --warn-soft: #33270e;
    --focus: #9fd8f5;
    --on-sea: #0b1520;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d141d;
  --bg-raised: #141d29;
  --bg-sunken: #090e15;
  --fg: #edf1f6;
  --fg-soft: #bcc8d8;
  --fg-faint: #9fadc0;
  --line: rgba(237, 241, 246, 0.16);
  --line-strong: rgba(237, 241, 246, 0.4);
  --shadow: rgba(0, 0, 0, 0.55);
  --sea: #7cc3e8;
  --sea-soft: #14293a;
  --signal: #f0937f;
  --signal-soft: #3a1a13;
  --ok: #7fd6a4;
  --ok-soft: #123426;
  --warn: #e3bd6d;
  --warn-soft: #33270e;
  --focus: #9fd8f5;
  --on-sea: #0b1520;
}

:root[data-theme="light"] {
  color-scheme: light;
  --on-sea: #ffffff;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.001em;
}

a { color: var(--sea); }
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.wrap-wide {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--wide);
  margin-inline: auto;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
}

.topbar-tools { display: flex; align-items: center; gap: 0.75rem; }

.lang-switch { display: flex; gap: 0.25rem; }
.lang-switch a {
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-soft);
  border: 1px solid transparent;
}
.lang-switch a[aria-current="page"] {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--bg-raised);
}

.theme-toggle {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  min-height: 44px;
}

/* Hero */

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to bottom, var(--sea-soft), transparent 22rem);
}

.hero-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 3rem 1.25rem 2.25rem;
}

.kicker {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin: 0 0 1rem;
}

.deck {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--fg-soft);
  margin: 0 0 1.5rem;
  max-width: 58ch;
}
.deck strong { color: var(--fg); }

.fact-strip {
  list-style: none;
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px var(--shadow);
  font-size: 0.95rem;
  display: grid;
  gap: 0.45rem;
}
.fact-strip li { display: flex; gap: 0.6rem; }
.fact-strip li::before { content: "–"; color: var(--fg-faint); }
.fact-strip .tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  align-self: flex-start;
}

/* Sections */

main section { padding-block: 2.75rem; }
main section + section { border-top: 1px solid var(--line); }

section h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--fg-soft);
  max-width: 60ch;
}

/* Interactive chain */

.chain-block {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 14px var(--shadow);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.chain-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.clock {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--fg-soft);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
}

.chain-svg { width: 100%; height: auto; display: block; margin-block: 0.5rem; }
.chain-svg .link {
  stroke: var(--line-strong);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  transition: stroke 0.4s ease;
}
.chain-svg .link.done { stroke: var(--sea); }
.chain-svg .link.strained { stroke: var(--warn); stroke-dasharray: 8 6; }
.chain-svg .link.missing { stroke: var(--signal); stroke-dasharray: 3 7; }
.chain-svg .node circle {
  fill: var(--bg-raised);
  stroke: var(--line-strong);
  stroke-width: 2.5;
  transition: fill 0.4s ease, stroke 0.4s ease;
}
.chain-svg .node text {
  fill: var(--fg-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
}
.chain-svg .node.done circle { fill: var(--sea); stroke: var(--sea); }
.chain-svg .node.done text { fill: var(--bg-raised); }
.chain-svg .node.active circle { stroke: var(--sea); stroke-width: 4; }
.chain-svg .node.strained circle { stroke: var(--warn); }
.chain-svg .node.missing circle { stroke: var(--signal); stroke-dasharray: 4 3; }
.chain-svg .node-label {
  fill: var(--fg-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  text-anchor: middle;
}
.chain-svg .node.active .node-label { fill: var(--fg); font-weight: 700; }
.chain-svg .sea-line { stroke: var(--sea); stroke-width: 2; fill: none; opacity: 0.45; }
.chain-svg .marker { fill: var(--signal); transition: opacity 0.3s ease; }

.controls { display: grid; gap: 1rem; margin-top: 1rem; }

.transport { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.transport button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}
.transport button.primary {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--on-sea);
}
.transport button:disabled { opacity: 0.45; cursor: default; }
.transport button:not(:disabled):hover { border-color: var(--sea); }

.scrub { display: grid; gap: 0.35rem; }
.scrub label { font-weight: 600; font-size: 0.95rem; }
.scrub input[type="range"] {
  width: 100%;
  accent-color: var(--sea);
  min-height: 44px;
}
.scrub .scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-faint);
}

.scenarios { display: grid; gap: 0.5rem; }
.scenarios legend, .scenarios > p.legend {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  padding: 0;
}
.scenario-list { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .scenario-list { grid-template-columns: 1fr 1fr 1fr; } }
.scenario-list label {
  display: grid;
  gap: 0.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  font-size: 0.92rem;
  background: var(--bg-raised);
}
.scenario-list label:has(input:checked) {
  border-color: var(--sea);
  border-width: 2px;
  padding: calc(0.65rem - 1px) calc(0.8rem - 1px);
}
.scenario-list input { accent-color: var(--sea); width: 1.1rem; height: 1.1rem; }
.scenario-list .sub { color: var(--fg-faint); font-size: 0.82rem; }

.step-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-left: 6px solid var(--sea);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--bg);
}
.step-card[data-tone="warn"] { border-left-color: var(--warn); }
.step-card[data-tone="alert"] { border-left-color: var(--signal); }
.step-card h3 { margin: 0 0 0.3rem; font-size: 1.25rem; }
.step-card .handoff {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: var(--fg-soft);
}
.step-card .handoff strong { color: var(--fg); }
.step-card p { margin: 0.4rem 0; }
.step-card .checks {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.8rem;
  background: var(--bg-sunken);
  border-radius: 8px;
  font-size: 0.92rem;
}
.step-card .scenario-note {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--warn-soft);
  color: var(--fg);
  border: 1px dashed var(--line-strong);
}
.step-card .scenario-note[hidden] { display: none; }
.illustrative {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  margin-bottom: 0.5rem;
}

/* Scenario cards */

.scenario-cards { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 720px) { .scenario-cards { grid-template-columns: 1fr 1fr; } }
.scenario-cards article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: var(--bg-raised);
}
.scenario-cards h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.scenario-cards p { margin: 0.45rem 0; font-size: 0.98rem; }
.scenario-cards button {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  color: var(--sea);
  background: transparent;
  border: 1px solid var(--sea);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

/* Thesis columns */

.two-col { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 720px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: var(--bg-raised);
}
.two-col h3 { margin-top: 0; font-size: 1.2rem; }
.two-col ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.two-col li { margin-bottom: 0.4rem; }

/* Accessible timeline */

.timeline-fallback { margin-top: 2rem; }
.timeline-fallback ol {
  list-style: none;
  counter-reset: step;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.timeline-fallback li {
  counter-increment: step;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
  padding: 0.9rem 1rem 0.9rem 3.4rem;
}
.timeline-fallback li::before {
  content: counter(step);
  position: absolute;
  left: 0.9rem; top: 0.9rem;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  background: var(--sea);
  color: var(--on-sea);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
}
.timeline-fallback h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.timeline-fallback p { margin: 0.25rem 0; font-size: 0.96rem; }

table.handoffs {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.92rem;
}
table.handoffs caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
table.handoffs th, table.handoffs td {
  border: 1px solid var(--line-strong);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
table.handoffs th { background: var(--bg-sunken); }
.table-scroll { overflow-x: auto; }

/* Method */

.method-links { padding-left: 1.2rem; }
.method-links li { margin-bottom: 0.55rem; }
.small { font-size: 0.9rem; color: var(--fg-soft); }

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--fg-soft);
  font-size: 0.92rem;
}
footer.site .foot-grid {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}
footer.site nav { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Return to top */

.to-top {
  position: fixed;
  right: 1rem; bottom: 1rem;
  font: inherit;
  font-weight: 700;
  background: var(--bg-raised);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--shadow);
  min-height: 44px;
  display: none;
}
.to-top.show { display: block; }

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .deck { font-size: 1.08rem; }
  .chain-block { padding: 0.9rem; }
  .transport button { flex: 1 1 45%; }
}
