:root {
  color-scheme: dark;
  --paper: #eee9dd;
  --muted: #c0b9ad;
  --line: #3d4a46;
  --accent: #def29b;
  --bg: #111715;
  --panel: #18201d;
  --panel-active: #212c28;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font: 17px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

header, main, footer {
  max-width: 1120px;
  margin: auto;
  padding: 32px 24px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px;
}

h1 {
  font: clamp(2.5rem, 6.5vw, 4.8rem)/1.08 Georgia, serif;
  max-width: 880px;
  margin: 20px 0 24px;
  letter-spacing: -0.01em;
}

h2 {
  font: clamp(1.8rem, 4vw, 2.4rem)/1.2 Georgia, serif;
  margin: 40px 0 18px;
}

h3 {
  font: 1.25rem/1.3 Georgia, serif;
  margin: 28px 0 12px;
}

.intro {
  max-width: 760px;
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 24px;
}

section {
  margin: 60px 0;
  scroll-margin-top: 24px;
}

.film-container {
  background: #090c0a;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}

.film {
  width: 100%;
  display: block;
  background: #000;
  aspect-ratio: 16/9;
}

video {
  max-width: 100%;
}

audio {
  width: 100%;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tab-btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  background: var(--panel-active);
}

.tab-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #142016;
  border-color: var(--accent);
  font-weight: 600;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

button {
  font: inherit;
  color: var(--paper);
  background: #222c27;
  border: 1px solid #738374;
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover {
  background: var(--accent);
  color: #142016;
  border-color: var(--accent);
}

button[aria-pressed="true"] {
  background: var(--accent);
  color: #142016;
  border-color: var(--accent);
}

button:focus-visible, a:focus-visible, input:focus-visible, video:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

figure img {
  width: 100%;
  height: auto;
  display: block;
}

figcaption, .small {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 10px 12px;
}

.essay {
  max-width: 780px;
  margin-top: 40px;
}

.essay p {
  margin: 1.4em 0;
  font-size: 1.06rem;
  line-height: 1.75;
}

.queue {
  padding-left: 24px;
}

.queue li {
  margin: 18px 0;
}

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
}

.panel p:first-child {
  margin-top: 0;
}

.motif-card {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  margin: 16px 0;
}

.motif-card h4 {
  font: 1.15rem/1.2 Georgia, serif;
  color: var(--accent);
  margin: 0 0 8px;
}

.motif-card p {
  margin: 0;
  font-size: 0.98rem;
}

footer {
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 60px;
}

[hidden] {
  display: none !important;
}

#room-status {
  min-height: 2em;
  font-size: 0.92rem;
  color: var(--accent);
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

@media (max-width: 768px) {
  header, main, footer {
    padding: 20px 16px;
  }
  .grid, .grid-4 {
    grid-template-columns: 1fr;
  }
  button {
    min-height: 46px;
  }
  .controls > * {
    flex-grow: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
