:root {
  --navy: #2c3e50;
  --teal: #1abc9c;
  --gold: #f1c40f;
  --coral: #e74c3c;
  --bg: #0a0a1a;
  --bg-soft: #141432;
  --bg-panel: #1b1b3a;
  --text: #e9ecf5;
  --text-muted: #a8b0c6;
  --border: rgba(255, 255, 255, 0.08);
  --max-width: 1120px;
  --radius: 10px;
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----- Header ----- */
.page-header {
  padding: 12px 0 4px;
}

.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.header-left {
  justify-self: start;
}

.header-center {
  justify-self: center;
  text-align: center;
}

.header-actions {
  justify-self: end;
}

.page-title {
  margin: 0 0 4px;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.page-subtitle {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ----- Simulation section ----- */
.sim-section {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 10px;
  overflow: hidden;
  background: #050510;
  border: 1px solid var(--border);
}

#dopplerCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ----- Controls bar ----- */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 4px 0;
}

.control-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 240px;
}

.cluster-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speed-btn,
.action-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
  flex: 1 1 auto;
  min-width: 84px;
}

.speed-btn:hover,
.action-btn:hover {
  background: #232352;
  transform: translateY(-1px);
}

.speed-btn.active {
  background: rgba(26, 188, 156, 0.2);
  color: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.18);
}

.teal-btn {
  background: rgba(26, 188, 156, 0.18);
  border-color: rgba(26, 188, 156, 0.45);
  color: #fff;
}
.teal-btn:hover {
  background: rgba(26, 188, 156, 0.3);
}

.navy-btn {
  background: rgba(44, 62, 80, 0.6);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.navy-btn:hover {
  background: rgba(44, 62, 80, 0.85);
}

.gold-btn {
  background: rgba(241, 196, 15, 0.14);
  border-color: rgba(241, 196, 15, 0.45);
  color: var(--gold);
}
.gold-btn:hover {
  background: rgba(241, 196, 15, 0.22);
}

.gold-btn[aria-pressed='true'] {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.action-btn:focus-visible,
.speed-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ----- Panels ----- */
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.observe-panel h3 {
  color: var(--gold);
}

.prompt-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.prompt-list li::marker {
  color: var(--teal);
  font-weight: 700;
}

.prompt-list strong {
  color: var(--gold);
}

.prompt-list em {
  color: var(--coral);
  font-style: italic;
}

/* ----- Investigation collapsible ----- */
.investigation-panel {
  padding: 0;
}

.investigation-panel details {
  width: 100%;
}

.investigation-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  user-select: none;
}

.investigation-panel summary::-webkit-details-marker {
  display: none;
}

.summary-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
}

.summary-icon {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(26, 188, 156, 0.14);
  transition: transform 0.2s ease;
}

.investigation-panel details[open] .summary-icon {
  transform: rotate(45deg);
}

.investigation-body {
  padding: 0 20px 20px;
}

.aim {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(241, 196, 15, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.aim strong {
  color: var(--gold);
}

/* ----- Footer ----- */
.site-footer {
  background: #050510;
  color: var(--text-muted);
  text-align: center;
  padding: 18px 16px;
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.site-footer p {
  margin: 0;
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  .page-title {
    font-size: 1.8rem;
  }

  .header-grid {
    grid-template-columns: 1fr;
  }

  .header-left,
  .header-center,
  .header-actions {
    justify-self: center;
  }

  .canvas-wrap {
    height: 320px;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-cluster {
    min-width: 0;
  }

  .speed-btn,
  .action-btn {
    flex: 1 1 calc(50% - 4px);
  }
}

@media (max-width: 420px) {
  .canvas-wrap {
    height: 280px;
  }
}
