:root {
  color-scheme: dark;
  --sky-0: #071018;
  --sky-1: #0d1f2d;
  --sand-0: #3c2f1f;
  --sand-1: #8e7340;
  --sand-2: #d7bf7b;
  --storm: #70d8e4;
  --storm-soft: rgba(112, 216, 228, 0.18);
  --charge: #f2d778;
  --ember: #e48c55;
  --stone: #d9d0bf;
  --line: rgba(255, 255, 255, 0.08);
  --panel: rgba(7, 12, 18, 0.74);
  --panel-strong: rgba(9, 17, 24, 0.92);
  --muted: #b8c7cf;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.monolith-body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: #f5f1df;
  background:
    radial-gradient(circle at top, rgba(112, 216, 228, 0.16), transparent 32%),
    radial-gradient(circle at 18% 100%, rgba(228, 140, 85, 0.16), transparent 20%),
    linear-gradient(180deg, #050c12 0%, #0c1c29 42%, #16120d 100%);
}

body.monolith-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
}

.storm-app {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 22px;
}

.storm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.storm-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.storm-brand__logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.2));
}

.storm-brand__copy {
  display: grid;
  gap: 2px;
}

.storm-brand__copy strong,
.storm-heading h1,
.storm-stage-head h2,
.storm-section__title h2 {
  font-family: "Instrument Serif", Georgia, serif;
}

.storm-brand__copy strong {
  font-size: 1.6rem;
  font-weight: 400;
}

.storm-brand__eyebrow,
.storm-kicker,
.storm-scorecard__label {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.storm-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.storm-nav form {
  margin: 0;
}

.storm-nav__button,
.storm-button,
.storm-mode-switch__button {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f1df;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.storm-nav__button:hover,
.storm-nav__button:focus-visible,
.storm-button:hover,
.storm-button:focus-visible,
.storm-mode-switch__button:hover,
.storm-mode-switch__button:focus-visible,
.storm-rack__card:hover,
.storm-rack__card:focus-visible,
.storm-preset-grid button:hover,
.storm-preset-grid button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.storm-nav__button--coffee,
.storm-button--primary {
  background: linear-gradient(135deg, rgba(228, 140, 85, 0.95), rgba(242, 215, 120, 0.95));
  color: #1e1206;
  border-color: rgba(242, 215, 120, 0.34);
}

.storm-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.42fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.storm-panel {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.03), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.storm-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.storm-panel--rack,
.storm-panel--inspector {
  padding: 22px;
}

.storm-panel--stage {
  padding: 16px;
}

.storm-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  line-height: 0.94;
  font-weight: 400;
  max-width: 11ch;
}

.storm-copy {
  color: var(--muted);
  line-height: 1.55;
  max-width: 34ch;
}

.storm-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.storm-section__title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.storm-section__title h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
}

.storm-section__title span,
.storm-rack__meta,
.storm-timeline li,
.storm-objective__copy,
.storm-forecast__copy {
  color: var(--muted);
  line-height: 1.45;
}

.storm-rack,
.storm-preset-grid,
.storm-forecast-grid,
.storm-objectives,
.storm-ledger {
  display: grid;
  gap: 10px;
}

.storm-rack__card,
.storm-preset-grid button,
.storm-forecast,
.storm-objective,
.storm-ledger__item {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.storm-rack__card,
.storm-preset-grid button {
  text-align: left;
  padding: 14px;
  color: inherit;
  cursor: pointer;
}

.storm-rack__card.is-active,
.storm-preset-grid button.is-active,
.storm-mode-switch__button.is-active {
  border-color: rgba(242, 215, 120, 0.45);
  background: linear-gradient(135deg, rgba(228, 140, 85, 0.18), rgba(112, 216, 228, 0.12));
}

.storm-rack__head,
.storm-ledger__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.storm-rack__head strong,
.storm-ledger__head strong,
.storm-forecast strong,
.storm-objective strong,
.storm-scorecard strong,
.storm-hud-card strong {
  font-size: 1rem;
}

.storm-rack__count,
.storm-ledger__metric {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f7e8bc;
  font-size: 0.76rem;
}

.storm-slider {
  display: grid;
  gap: 8px;
}

.storm-slider input {
  width: 100%;
}

.storm-actions {
  grid-template-columns: 1fr 1fr;
}

.storm-stage-head,
.storm-field-footer {
  display: grid;
  gap: 14px;
}

.storm-stage-head {
  padding: 10px 10px 0;
}

.storm-stage-head h2 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 400;
}

.storm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storm-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

.storm-canvas-shell {
  position: relative;
  margin-top: 14px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(112, 216, 228, 0.15), transparent 36%),
    linear-gradient(180deg, rgba(13, 31, 45, 0.94), rgba(47, 35, 20, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 560px;
}

#stormCanvas {
  display: block;
  width: 100%;
  height: 560px;
}

.storm-canvas-shell__overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  pointer-events: none;
}

.storm-hud-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(5, 10, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.storm-hud-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.storm-canvas-shell__hint {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 11px 14px;
  border-radius: 18px;
  background: rgba(5, 10, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

.storm-field-footer {
  padding: 16px 8px 8px;
}

.storm-ledger {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.storm-ledger__item {
  padding: 14px;
}

.storm-ledger__detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.storm-ledger__empty,
.storm-timeline__empty {
  color: var(--muted);
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.storm-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.storm-mode-switch__button {
  border-radius: 18px;
  min-height: 52px;
}

.storm-scorecard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(112, 216, 228, 0.14), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.storm-scorecard strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  color: #fff3bf;
}

.storm-forecast {
  padding: 14px;
}

.storm-forecast__tone {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #dceef0;
}

.storm-objective {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
}

.storm-objective__marker {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  margin-top: 4px;
  border: 2px solid rgba(242, 215, 120, 0.45);
  background: transparent;
}

.storm-objective.is-complete .storm-objective__marker {
  background: linear-gradient(135deg, rgba(112, 216, 228, 0.95), rgba(242, 215, 120, 0.95));
}

.storm-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.storm-timeline li {
  padding-left: 4px;
}

@media (max-width: 1220px) {
  .storm-shell {
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  }

  .storm-panel--inspector {
    grid-column: 1 / -1;
  }

  .storm-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .storm-app {
    padding: 14px;
  }

  .storm-topbar,
  .storm-shell,
  .storm-actions,
  .storm-scorecard,
  .storm-canvas-shell__overlay,
  .storm-ledger {
    grid-template-columns: 1fr;
  }

  .storm-topbar {
    display: grid;
  }

  .storm-nav {
    justify-content: flex-start;
  }

  .storm-shell {
    display: grid;
  }

  .storm-panel--rack,
  .storm-panel--inspector,
  .storm-panel--stage {
    padding: 16px;
  }

  .storm-canvas-shell {
    min-height: 440px;
  }

  #stormCanvas {
    height: 440px;
  }

  .storm-heading h1 {
    font-size: 2.4rem;
  }
}
