:root {
  color-scheme: dark;
  --bg: #090d11;
  --panel: #121a21;
  --panel-2: #18232c;
  --ink: #eef6f4;
  --muted: #a8b8b3;
  --line: #2d3c45;
  --accent: #5ee0c2;
  --blue: #78b7ff;
  --amber: #f2c15b;
  --danger: #ff6b5f;
  --violet: #b990ff;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(94, 224, 194, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 224, 194, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--ink);
}

a {
  color: var(--accent);
}

.site-demo-menu {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 17, 0.94);
  backdrop-filter: blur(10px);
}

.site-demo-menu a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.site-demo-menu a:hover {
  color: var(--accent);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(720px, 1fr);
}

.lesson-panel {
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(18, 26, 33, 0.94);
  overflow: auto;
}

.visual-panel {
  padding: 22px;
  overflow: auto;
}

.title-block,
.mode-card,
.cards-grid article,
.voiceover-panel {
  border: 1px solid var(--line);
  background: rgba(18, 26, 33, 0.92);
  border-radius: 8px;
}

.title-block {
  padding: 18px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.08;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.mode-card {
  padding: 16px;
  margin-bottom: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mode-btn,
.primary,
.secondary {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.mode-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

.mode-btn.active {
  color: #04100d;
  border-color: var(--accent);
  background: var(--accent);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #0c1318;
  color: var(--ink);
  font: inherit;
}

button:disabled,
select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #04100d;
  padding: 8px 14px;
}

.secondary {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 8px 14px;
}

.lesson-text {
  color: var(--muted);
  line-height: 1.52;
  font-size: 14px;
}

.lesson-text p {
  margin: 10px 0 0;
}

.source-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.readout {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--amber);
  background: rgba(18, 26, 33, 0.92);
  font-weight: 900;
  text-align: center;
}

#drfmCanvas {
  display: block;
  width: 100%;
  max-width: 1220px;
  height: auto;
  aspect-ratio: 61 / 34;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070c10;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.cards-grid article {
  padding: 16px;
}

.cards-grid article:last-child {
  grid-column: 1 / -1;
}

.cards-grid p,
.cards-grid ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.cards-grid ul {
  padding-left: 18px;
}

.voiceover-panel {
  margin-top: 16px;
  padding: 18px;
}

.voiceover-heading {
  margin-bottom: 12px;
}

.voiceover-copy {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 14px;
  color: #dce8e5;
  font-size: 16px;
  line-height: 1.62;
  scrollbar-color: var(--accent) #10161b;
}

.voiceover-copy p {
  margin: 0 0 12px;
}

.demo-mode .source-list {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .lesson-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .cards-grid article:last-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .canvas-bar,
  .actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
