:root {
  color-scheme: dark;
  --ink: #0b151a;
  --surface: #101f25;
  --panel: #11242c;
  --stroke: #304750;
  --white: #edf3f2;
  --muted: #afc3c8;
  --gold: #e5b769;
  --mint: #a9dfcd;
  --heading: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  --body: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--white); font-family: var(--body); line-height: 1.6; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); font-weight: 700; line-height: 1.1; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.wrap { width: min(76rem, 100% - 6rem); margin-inline: auto; }
.eyebrow { font-size: .875rem; font-weight: 750; letter-spacing: .12em; color: var(--gold); }

.skip-link { position: absolute; top: .5rem; left: 1rem; z-index: 4; padding: .6rem 1rem; background: var(--gold); color: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header { position: relative; z-index: 1; border-bottom: 1px solid #233942; background: #0c171d; }
.header-content { min-height: 4.625rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--white); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  background: #213c41;
  color: var(--mint);
  border: 1px solid #648e83;
  border-radius: .35rem 1rem .35rem .35rem;
  font: 750 .96rem/1 var(--heading);
  letter-spacing: .055em;
}
.brand-lockup { display: grid; gap: .16rem; font-size: .765rem; letter-spacing: .095em; line-height: 1.2; }
.brand-lockup span { color: var(--muted); }
.header-content nav { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem clamp(.8rem, 2.25vw, 2rem); }
.header-content nav a { color: var(--muted); font-size: .94rem; font-weight: 650; text-decoration: none; }
.header-content nav a:hover { color: var(--white); }
.header-content nav .staff-link { border: 1px solid #36515a; color: var(--white); padding: .36rem .82rem; border-radius: .35rem; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid #334950;
  background:
    linear-gradient(90deg, #0b151a 0%, #0b151ae8 26%, #0b151aa1 58%, #0b151a56 100%),
    linear-gradient(0deg, #0b151ae6, transparent 63%),
    url("/assets/cascade-night.webp") 58% 49% / cover no-repeat,
    radial-gradient(ellipse at 79% 32%, #31525b 0%, #162a32 39%, #0b151a 90%);
}
.hero::after { content: ""; position: absolute; pointer-events: none; inset: auto 0 0; height: .2rem; background: linear-gradient(90deg, var(--gold), #627a76 53%, transparent 83%); opacity: .6; }
.hero-grid { min-height: 35rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 22rem); align-items: end; gap: clamp(1.5rem, 5vw, 4.75rem); padding-block: clamp(5rem, 8.8vw, 8.5rem) 4.5rem; }
.hero-copy { align-self: center; }
.hero h1 { margin-top: 1rem; font-size: clamp(3.375rem, 6vw, 5.3rem); line-height: .99; letter-spacing: -.045em; text-wrap: balance; }
.hero h1 span { color: var(--mint); }
.hero-description { max-width: 33rem; margin-top: 1.35rem; color: #cfddde; font-size: clamp(1rem, 1.45vw, 1.19rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; border: 1px solid transparent; padding: .7rem 1.12rem; border-radius: .35rem; font-size: .94rem; font-weight: 750; text-decoration: none; }
.button-primary { border-color: var(--gold); background: var(--gold); color: #1d1a14; }
.button-primary:hover { border-color: #ffd598; background: #ffd598; }
.button-secondary { border-color: #6b8389; background: #16252acd; color: var(--white); }
.button-secondary:hover { border-color: #b6cacd; background: #263d45; }

.status-panel { display: grid; gap: .7rem; padding: 1.35rem; border: 1px solid #4d6671; border-radius: .7rem; background: #0e1d25f5; box-shadow: 0 1.2rem 2rem #0005; }
.status-header { min-height: 1.65rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.status-panel h2 { font-size: 1.55rem; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: center; gap: .55rem; color: #c1d0d3; font-size: .94rem; }
.status-dot { width: .54rem; height: .54rem; flex: none; border-radius: 50%; background: #95acb6; }
.status-dot[data-state="online"] { background: #9ce5ba; box-shadow: 0 0 0 3px #9ce5ba2d; }
.status-dot[data-state="offline"] { background: #f3a784; }
.status-dot[data-state="unavailable"] { background: #e5bf82; }
.small-button { cursor: pointer; border: 1px solid #3f5b68; border-radius: .29rem; padding: .23rem .52rem; background: #1d3039; color: var(--white); font-size: .875rem; line-height: 1.35; white-space: nowrap; }
.small-button:hover { background: #2c4855; }
.small-button:disabled { opacity: .72; cursor: wait; }
.capacity { display: grid; gap: .55rem; padding-top: .45rem; }
.capacity p { display: flex; gap: .7rem; justify-content: space-between; color: var(--muted); font-size: .94rem; }
.capacity strong { color: var(--white); font-variant-numeric: tabular-nums; }
.capacity progress { appearance: none; border: 0; width: 100%; height: .32rem; border-radius: .25rem; overflow: hidden; background: #314751; color: #a9dfcd; }
.capacity progress::-webkit-progress-bar { background: #314751; }
.capacity progress::-webkit-progress-value { background: #a9dfcd; }
.capacity progress::-moz-progress-bar { background: #a9dfcd; }
.connection { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem .55rem; margin-top: .35rem; padding-top: .82rem; border-top: 1px solid #2e4450; }
.connection p { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .06em; }
code { color: var(--mint); font-family: Consolas, "Courier New", monospace; font-size: .94rem; overflow-wrap: anywhere; }
.updated { color: #aebfc5; font-size: .82rem; }

.roles { padding-block: clamp(4rem, 7.5vw, 6rem); background: #101d23; border-bottom: 1px solid #2a4049; }
.section-header { display: flex; gap: 1rem 3rem; align-items: end; justify-content: space-between; }
.section-header h2, .join h2 { margin-top: .65rem; font-size: clamp(2.15rem, 4.8vw, 3.65rem); letter-spacing: -.035em; }
.section-header > p, .join-intro > p:last-child { max-width: 28rem; color: var(--muted); }
.role-explorer { display: grid; grid-template-columns: 15.75rem minmax(0, 1fr); gap: .85rem; margin-top: 1.85rem; }
.role-controls { display: grid; gap: .45rem; align-content: start; }
.role-controls button {
  appearance: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  min-height: 3.2rem;
  padding: .6rem .85rem;
  border: 1px solid #304650;
  border-radius: .37rem;
  background: #172931;
  color: #c0d1d4;
  font-weight: 650;
}
.role-controls button:hover { background: #203641; }
.role-controls button[aria-selected="true"] { border-color: #648f89; background: #233c41; box-shadow: inset .19rem 0 0 var(--mint); color: var(--white); }
.role-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, .56fr);
  align-items: center;
  min-height: 15.7rem;
  padding: clamp(1.35rem, 4.4vw, 2.65rem);
  border: 1px solid #364e55;
  border-radius: .55rem;
  background: radial-gradient(ellipse at 80% 43%, #213d43, #172931 72%);
}
.role-panel[data-theme="rescue"] { background: radial-gradient(ellipse at 80% 43%, #4c342e, #1b2a2f 72%); }
.role-panel[data-theme="dispatch"] { background: radial-gradient(ellipse at 80% 43%, #324257, #182a34 72%); }
.role-panel[data-theme="civilian"] { background: radial-gradient(ellipse at 80% 43%, #4c422c, #202b2d 72%); }
.role-controls[hidden] + .role-panel { grid-column: 1 / -1; }
.role-copy { position: relative; z-index: 1; }
.role-copy h3 { margin-top: .46rem; font-size: clamp(1.85rem, 3.1vw, 2.7rem); letter-spacing: -.025em; }
.role-copy > p:not(.eyebrow) { max-width: 32rem; margin-top: .75rem; color: #c3d2d5; }
.scene-place { display: inline-block; margin-top: 1rem; padding: .2rem .55rem; border: 1px solid #56727b; border-radius: .25rem; color: var(--mint); font-size: .875rem; }
.route-art {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 59%;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, #b6e5d713 0 1px, transparent 1px 1.4rem),
    repeating-linear-gradient(0deg, #b6e5d713 0 1px, transparent 1px 1.4rem);
  mask-image: linear-gradient(90deg, transparent, #000 33%);
}
.route-art::before, .route-art::after { content: ""; position: absolute; width: 9rem; height: 7rem; top: 28%; left: 28%; border: 2px solid #9dd5c76e; border-radius: 25% 55% 47% 35%; transform: rotate(-28deg); }
.route-art::after { width: 12rem; height: 9rem; top: 20%; left: 20%; border-color: #9dd5c738; }
.route-marker { position: absolute; top: 47%; left: 53%; width: .7rem; height: .7rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 .36rem #e5b76933; transition: transform 240ms ease; }
[data-theme="rescue"] .route-marker { transform: translate(2rem, -2rem); }
[data-theme="dispatch"] .route-marker { transform: translate(-1.3rem, -.9rem); }
[data-theme="civilian"] .route-marker { transform: translate(1.2rem, 1.4rem); }

.join { background: #0b151a; padding-block: clamp(4rem, 7.5vw, 6rem); }
.join-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: clamp(1.2rem, 6vw, 6rem); }
.join-intro > p:last-child { margin-top: .9rem; }
.join-steps { margin: 0; padding: 0 0 0 2.45rem; border-left: 1px solid #344b54; }
.join-steps li { padding: 0 0 1.15rem .45rem; margin-bottom: 1.15rem; border-bottom: 1px solid #273d46; }
.join-steps li:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.join-steps li::marker { color: var(--gold); font-weight: 700; }
.join-steps h3 { font-size: 1.2rem; }
.join-steps p { margin-top: .35rem; color: var(--muted); }
.text-link { display: inline-block; margin-top: .4rem; color: var(--mint); text-underline-offset: .2em; }
.text-link:hover { color: var(--white); }
.join-steps .join-note { color: var(--gold); font-size: .94rem; }
kbd { display: inline-block; border: 1px solid #526671; border-radius: .25rem; padding: 0 .28rem; color: var(--white); }
.step-command { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .5rem; }
.site-footer { border-top: 1px solid #2a4049; padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.footer-content { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.footer-content strong { color: var(--white); }
.footer-content a { color: var(--mint); margin-left: auto; text-underline-offset: .2em; }

@media (max-width: 63rem) {
  .wrap { width: min(100% - 3.5rem, 76rem); }
  .hero-grid { min-height: 32rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem); gap: 1.5rem; }
  .hero h1 { font-size: clamp(3.2rem, 6vw, 4.35rem); }
}

@media (max-width: 46rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-content { min-height: auto; flex-wrap: wrap; gap: .7rem; padding-block: .85rem; }
  .header-content nav { flex-basis: 100%; border-top: 1px solid #2a4149; padding-top: .58rem; justify-content: space-between; gap: .4rem .75rem; }
  .header-content nav a { font-size: .9rem; }
  .header-content nav .staff-link { padding: .28rem .51rem; }
  .hero { background-position: center, center, 57% 50%, center; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; justify-items: start; gap: 1.8rem; padding-block: 4.1rem 2rem; }
  .hero h1 { font-size: clamp(2.85rem, 10.3vw, 4.4rem); }
  .hero-description { max-width: 28rem; }
  .hero-actions { margin-top: 1.45rem; }
  .status-panel { width: min(100%, 25rem); padding: 1.15rem; }
  .section-header { align-items: start; flex-direction: column; }
  .role-explorer { grid-template-columns: 1fr; }
  .role-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-controls button { font-size: .95rem; min-height: 2.8rem; padding: .58rem .58rem .58rem .73rem; }
  .role-panel { min-height: 13rem; grid-template-columns: minmax(0, 1fr); }
  .route-art { opacity: .6; inset-inline-start: 65%; }
  .join-grid { grid-template-columns: 1fr; gap: 1.65rem; }
  .footer-content a { margin-left: 0; }
}

@media (max-width: 21rem) {
  .hero h1 { font-size: 2.55rem; }
  .brand-lockup { font-size: .72rem; }
  .header-content nav { gap: .35rem; }
  .header-content nav a { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

