:root {
  color-scheme: light;
  --paper: #f3ede2;
  --paper-dark: #e6dac4;
  --ink: #17130f;
  --muted: #64594d;
  --line: rgba(41, 31, 18, 0.14);
  --panel: rgba(255, 249, 240, 0.82);
  --accent: #be5b36;
  --shadow: 0 28px 56px rgba(41, 29, 14, 0.16);
  --serif: "Baskerville Old Face", "Palatino Linotype", Georgia, serif;
  --sans: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.75), transparent 24%),
    linear-gradient(135deg, #fbf7f0 0%, #efe6d6 52%, #ded0bb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(90, 70, 41, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 70, 41, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.42), transparent 82%);
}

.storm-app {
  position: relative;
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px;
}

.storm-topbar,
.storm-stage-panel,
.storm-control-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.storm-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border-radius: 30px;
}

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

.storm-brand__image {
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(145deg, #2a2218, #66563f);
}

.storm-brand__text,
.storm-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.storm-kicker {
  margin: 0 0 8px;
}

.storm-title h1,
.storm-stage-bar h2,
.storm-section__heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
}

.storm-title h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.94;
}

.storm-lede {
  max-width: 62ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.storm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.storm-link,
.storm-pill,
.storm-reset,
.storm-room-card {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.storm-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
}

.storm-link--coffee,
.storm-reset {
  background: #1d1712;
  border-color: #1d1712;
  color: #fbf5eb;
}

.storm-link--account {
  background: rgba(190, 91, 54, 0.12);
  color: #9a4b2c;
}

.storm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
}

.storm-stage-panel,
.storm-control-panel {
  border-radius: 32px;
}

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

.storm-control-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.storm-stage-bar,
.storm-section__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.storm-stage-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.storm-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(27, 92, 121, 0.14);
  color: #1b5c79;
  font-size: 0.82rem;
  font-weight: 700;
}

.storm-badge--soft {
  background: rgba(190, 91, 54, 0.12);
  color: #9c4b2a;
}

.storm-room-shell {
  margin-top: 18px;
  padding: 18px;
  border-radius: 30px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.84), rgba(255,255,255,0.22));
  border: 1px solid rgba(255,255,255,0.34);
}

.storm-room {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border-radius: 26px;
  transform-style: preserve-3d;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.7), transparent 40%),
    linear-gradient(180deg, #f9f3e7 0%, #e0d0b7 100%);
  perspective: 1400px;
}

.storm-room__ceiling,
.storm-room__wall,
.storm-room__floor,
.storm-room__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.storm-room__ceiling {
  height: 34%;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), transparent);
}

.storm-room__wall--left {
  clip-path: polygon(0 0, 14% 10%, 14% 100%, 0 100%);
  background: linear-gradient(180deg, #e9dcc9, #d5c2a7);
}

.storm-room__wall--right {
  clip-path: polygon(86% 10%, 100% 0, 100% 100%, 86% 100%);
  background: linear-gradient(180deg, #eadfcd, #d0bea5);
}

.storm-room__wall--back {
  inset: 12% 14% 18%;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(rgba(122, 91, 56, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 91, 56, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #fff9f0, #e8d8be);
  background-size: 48px 48px, 48px 48px, auto;
}

.storm-room__floor {
  inset: 68% 8% 4%;
  border-radius: 44% 44% 12% 12% / 48% 48% 16% 16%;
  background: linear-gradient(180deg, #bf9f71, #8b6848);
}

.storm-room__shine {
  background:
    radial-gradient(circle at 78% 20%, rgba(255,255,255,0.62), transparent 18%),
    radial-gradient(circle at 26% 26%, rgba(255,255,255,0.34), transparent 14%);
}

.storm-papers {
  position: absolute;
  inset: 0;
}

.storm-paper {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  border-radius: 10px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.88), rgba(243,231,207,0.88)),
    radial-gradient(circle at top right, rgba(255,255,255,0.6), transparent 34%);
  border: 1px solid rgba(79, 58, 29, 0.12);
  box-shadow:
    0 10px 16px rgba(53, 37, 17, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.6);
  overflow: hidden;
  will-change: transform;
}

.storm-paper::before,
.storm-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.storm-paper::before {
  background:
    linear-gradient(rgba(118, 86, 44, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 86, 44, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.72;
}

.storm-paper::after {
  inset: auto 12% 14% 12%;
  height: 1px;
  background: rgba(123, 92, 54, 0.22);
  box-shadow: 0 -14px 0 rgba(123, 92, 54, 0.16), 0 -28px 0 rgba(123, 92, 54, 0.14);
}

.storm-paper--tag { clip-path: polygon(0 0, 100% 0, 100% 86%, 58% 100%, 0 100%); }
.storm-paper--mobile { clip-path: polygon(50% 0, 100% 44%, 50% 100%, 0 44%); }
.storm-paper--flyer { clip-path: polygon(4% 0, 100% 0, 100% 100%, 0 96%); }
.storm-paper--strip { clip-path: polygon(0 12%, 100% 0, 100% 88%, 0 100%); }

.storm-cursor-pulse {
  position: absolute;
  width: 140px;
  height: 140px;
  margin-left: -70px;
  margin-top: -70px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.54), rgba(190,91,54,0.08), transparent 72%);
  opacity: 0;
}

.storm-cursor-pulse.is-active { opacity: 1; }

.storm-scene-caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: grid;
  gap: 4px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(22, 16, 11, 0.72);
  color: #f6efe5;
}

.storm-scene-caption strong { font-family: var(--serif); font-size: 1.1rem; }
.storm-scene-caption span { color: rgba(246,239,229,0.84); line-height: 1.45; font-size: 0.9rem; }

.storm-ticker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.storm-ticker__item {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
}

.storm-ticker__item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.storm-ticker__item strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.storm-section {
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.52);
}

.storm-room-list {
  display: grid;
  gap: 10px;
}

.storm-room-card {
  padding: 14px;
  border-radius: 20px;
  text-align: left;
}

.storm-room-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.storm-room-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.storm-room-card.is-active,
.storm-link:hover,
.storm-pill:hover,
.storm-reset:hover,
.storm-room-card:hover {
  transform: translateY(-1px);
  border-color: rgba(190,91,54,0.34);
  background: rgba(255,255,255,0.84);
}

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

.storm-pill {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 18px;
}

.storm-field {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.storm-field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.storm-field input[type="range"] { width: 100%; }

.storm-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.storm-reset {
  min-height: 50px;
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .storm-layout { grid-template-columns: 1fr; }
  .storm-topbar { grid-template-columns: 1fr; }
  .storm-actions { justify-content: start; }
}

@media (max-width: 760px) {
  .storm-app { padding: 14px; }
  .storm-room { min-height: 520px; }
  .storm-ticker, .storm-gust-grid { grid-template-columns: 1fr; }
  .storm-stage-status { justify-content: start; }
}
