:root {
  --bg-top: #f4ede2;
  --bg-bottom: #e7ddd0;
  --paper: rgba(255, 250, 242, 0.86);
  --paper-strong: rgba(253, 248, 240, 0.94);
  --ink: #1c1c1b;
  --muted: #6a645c;
  --line: rgba(53, 41, 30, 0.14);
  --line-soft: rgba(53, 41, 30, 0.08);
  --accent: #9d4434;
  --accent-soft: rgba(157, 68, 52, 0.16);
  --accent-strong: rgba(157, 68, 52, 0.3);
  --shadow: 0 26px 70px rgba(88, 55, 30, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(104, 128, 170, 0.18), transparent 22%),
    radial-gradient(circle at 84% 16%, var(--accent-soft), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 1px), rgba(53, 41, 30, 0.035) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, transparent 0, transparent calc(100% - 144px), rgba(53, 41, 30, 0.04) 100%);
}

body::after {
  background-image:
    radial-gradient(circle at 18% 84%, rgba(157, 68, 52, 0.09) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 76%, rgba(70, 95, 138, 0.12) 0 2px, transparent 3px);
  background-size: 180px 180px, 220px 220px;
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.site-shell {
  width: min(1560px, calc(100vw - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: 18px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 249, 240, 0.62)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.site-shell::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 4px 4px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.traffic {
  display: flex;
  gap: 8px;
}

.light {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(24, 24, 24, 0.08);
}

.red { background: #ff5f57; }
.amber { background: #ffbd2e; }
.green { background: #28c840; }

.title-block {
  min-width: 0;
}

.eyebrow,
.phase-tag,
.bridge-label,
.triad-label,
.status-rule,
.counter,
.metric-text {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}

h1,
h2,
p,
ol,
ul,
blockquote,
footer {
  margin: 0;
}

h1,
h2,
.voice-title,
.statement,
.quote-text {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

h1 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 0.98;
  letter-spacing: 0.01em;
}

.lede {
  margin-top: 10px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

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

button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font: inherit;
  padding: 11px 14px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(157, 68, 52, 0.12);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  padding: 20px 0 18px;
}

.panel,
.stage-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 32px rgba(84, 58, 34, 0.08);
}

.panel {
  padding: 18px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel h2 {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.08;
}

.voice-title {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.02;
}

.panel-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.sequence-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.sequence-button {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.34);
}

.sequence-button.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 12px 22px rgba(157, 68, 52, 0.08);
}

.sequence-kicker,
.sequence-title {
  display: block;
}

.sequence-kicker {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sequence-title {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.stage {
  min-height: 100%;
}

.stage-card {
  position: relative;
  min-height: 100%;
  padding: 24px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 18px;
  background:
    radial-gradient(circle at 14% 14%, var(--accent-soft), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(69, 94, 134, 0.14), transparent 26%),
    linear-gradient(180deg, var(--paper-strong), rgba(253, 247, 239, 0.9));
  transition: opacity 420ms ease, transform 420ms ease;
}

.stage-card.is-fading {
  opacity: 0;
  transform: translateY(10px);
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(53, 41, 30, 0.05);
  border-radius: 18px;
  pointer-events: none;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.phase-tag,
.counter {
  color: var(--muted);
  font-size: 11px;
}

.voice-title {
  margin-top: 8px;
}

.statement-block {
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid rgba(53, 41, 30, 0.08);
  background: rgba(255, 255, 255, 0.38);
}

.statement {
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.quote-block {
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.48);
  border-radius: 16px;
}

.quote-text {
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.22;
  font-style: italic;
}

.quote-source {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.intent-text {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-self: end;
}

.bridge-card,
.triad-block {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(53, 41, 30, 0.08);
  background: rgba(255, 255, 255, 0.36);
}

.bridge-label,
.triad-label {
  color: var(--muted);
  font-size: 10px;
}

.bridge-text,
.triad-text,
.active-label,
.audience-label {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.65;
}

.context {
  display: grid;
  gap: 18px;
}

.context-panel {
  min-height: 0;
}

.active-list,
.audience-list {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
}

.active-item,
.audience-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(53, 41, 30, 0.08);
  background: rgba(255, 255, 255, 0.34);
}

.active-name,
.audience-name {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.active-label,
.audience-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.triad {
  display: grid;
  gap: 12px;
}

.metric-text {
  margin-top: 16px;
  color: var(--accent);
  font-size: 11px;
  line-height: 1.8;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 6px 4px 0;
  border-top: 1px solid var(--line-soft);
}

.status-rule {
  color: var(--muted);
  font-size: 11px;
}

.status-sig {
  color: rgba(30, 28, 25, 0.42);
  font-size: 10px;
  letter-spacing: 0.14em;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .context {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar,
  .layout,
  .bridge-grid,
  .context {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 14px;
  }

  .controls {
    justify-content: flex-start;
  }

  .stage-card {
    padding: 20px;
  }

  .statement {
    font-size: clamp(28px, 8vw, 46px);
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

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