/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #16161f;
  --bg-hover: #1c1c28;
  --border: #2a2a3a;
  --border-light: #3a3a4f;
  --text: #d8d6e0;
  --text-muted: #8a8799;
  --text-dim: #5e5c6e;
  --accent: #7b6fbf;
  --accent-light: #9e93d4;
  --accent-glow: rgba(123, 111, 191, 0.15);
  --warm: #c49454;
  --warm-glow: rgba(196, 148, 84, 0.12);
  --cyan: #5eaaa8;
  --red: #bf6f6f;
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --max-width: 1100px;
  --header-height: 64px;
  --transition: 0.25s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee;
    --bg-surface: #ede9e0;
    --bg-card: #e4dfd4;
    --bg-hover: #d9d3c6;
    --border: #c8c0b0;
    --border-light: #b8af9c;
    --text: #2a2520;
    --text-muted: #6b6358;
    --text-dim: #9a9184;
    --accent: #5a4a9e;
    --accent-light: #7b6fbf;
    --accent-glow: rgba(90, 74, 158, 0.1);
    --warm: #9a6b2f;
  }
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--accent); text-decoration: underline; }

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 16px;
  border-radius: 0 0 var(--radius) var(--radius); font-size: 0.9rem;
}
.skip-link:focus { top: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  height: var(--header-height); display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 36px; height: 36px; color: var(--accent-light); flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.3; }
.logo-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.logo-tag { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 6px 14px; border-radius: var(--radius); font-size: 0.88rem;
  color: var(--text-muted); transition: all var(--transition);
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--text); background: var(--bg-hover); text-decoration: none;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 4px; background: none; border: none;
  cursor: pointer; padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; }
.mobile-nav { display: none; padding: 8px 24px 16px; border-top: 1px solid var(--border); }
.mobile-nav a { display: block; padding: 10px 0; color: var(--text-muted); font-size: 0.95rem; }
.mobile-nav a:hover { color: var(--text); }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav:not([hidden]) { display: block; }
}

/* ── Intro ── */
.intro {
  max-width: var(--max-width); margin: 0 auto; padding: 80px 24px 60px;
  display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: center;
}
.intro-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-light); margin-bottom: 16px;
}
.intro h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.2; margin-bottom: 20px; }
.intro-lead { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin-bottom: 32px; }
.intro-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.intro-visual { display: flex; justify-content: center; align-items: center; }
.signal-rings {
  position: relative; width: 160px; height: 160px;
}
.signal-rings span {
  position: absolute; inset: 0; border: 1px solid var(--accent);
  border-radius: 50%; opacity: 0;
  animation: pulse 4s ease-out infinite;
}
.signal-rings span:nth-child(1) { animation-delay: 0s; }
.signal-rings span:nth-child(2) { animation-delay: 1.3s; }
.signal-rings span:nth-child(3) { animation-delay: 2.6s; }
@keyframes pulse {
  0% { transform: scale(0.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 0; }
}

@media (max-width: 768px) {
  .intro { grid-template-columns: 1fr; padding: 48px 24px 40px; }
  .intro-visual { display: none; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius); font-size: 0.9rem;
  font-family: var(--font); cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--accent-light); border-color: var(--accent-light);
  color: #fff; text-decoration: none;
}
.btn-ghost {
  background: transparent; color: var(--text-muted); border-color: var(--border);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--bg-hover); color: var(--text); border-color: var(--border-light);
  text-decoration: none;
}

/* ── Sections ── */
section { scroll-margin-top: calc(var(--header-height) + 16px); }
.section-header { margin-bottom: 32px; }
.section-header h2 { font-size: 1.6rem; margin-bottom: 8px; }
.section-header p { color: var(--text-muted); max-width: 600px; }

/* ── Timeline ── */
.timeline-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
}
.timeline-controls { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-select {
  background: var(--bg-surface); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--radius); font-size: 0.88rem;
  font-family: var(--font); cursor: pointer;
}
.filter-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.tl-year {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-light);
  padding-top: 4px; text-align: right;
}
.tl-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px; }
.tl-badge {
  display: inline-block; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 2px 8px; border-radius: 4px;
  margin-bottom: 10px;
}
.tl-badge.music { background: rgba(123,111,191,0.15); color: var(--accent-light); }
.tl-badge.film { background: rgba(196,148,84,0.15); color: var(--warm); }
.tl-badge.visual { background: rgba(94,170,168,0.15); color: var(--cyan); }
.tl-badge.digital { background: rgba(191,111,111,0.15); color: var(--red); }
.tl-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.tl-card p { color: var(--text-muted); font-size: 0.92rem; }
.tl-refs { margin-top: 10px; font-size: 0.85rem; color: var(--text-dim); }
.timeline-empty { color: var(--text-dim); font-style: italic; padding: 20px 0; }

@media (max-width: 600px) {
  .tl-item { grid-template-columns: 1fr; }
  .tl-year { text-align: left; }
}

/* ── Techniques ── */
.techniques-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
  background: var(--bg-surface);
}
.technique-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
.technique-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.technique-card summary {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; cursor: pointer; list-style: none;
  transition: background var(--transition);
}
.technique-card summary::-webkit-details-marker { display: none; }
.technique-card summary:hover { background: var(--bg-hover); }
.technique-icon { font-size: 1.2rem; color: var(--accent-light); flex-shrink: 0; }
.technique-title { font-size: 1rem; font-weight: 600; }
.technique-body { padding: 0 20px 20px; }
.technique-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 14px; }
.technique-examples h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 8px; }
.technique-examples ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.technique-examples li { font-size: 0.88rem; color: var(--text-muted); padding-left: 14px; position: relative; }
.technique-examples li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }
.technique-note {
  margin-top: 14px; padding: 12px 16px; background: var(--accent-glow);
  border-radius: var(--radius); font-size: 0.85rem; color: var(--text-muted);
  border-left: 3px solid var(--accent);
}
.technique-card[open] { border-color: var(--accent); }

/* ── Compare ── */
.compare-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
}
.compare-table-wrapper { overflow-x: auto; margin-bottom: 16px; }
.compare-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  min-width: 640px;
}
.compare-table th {
  text-align: left; padding: 12px 16px; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim);
  border-bottom: 2px solid var(--border);
}
.compare-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-muted); vertical-align: top;
}
.compare-table tr:hover td { background: var(--bg-hover); }
.compare-note { color: var(--text-dim); font-size: 0.88rem; font-style: italic; }

/* ── Curator ── */
.curator-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
  background: var(--bg-surface);
}
.curator-controls {
  margin-bottom: 32px; padding: 24px; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.curator-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
#intensity-slider {
  width: 100%; max-width: 400px; accent-color: var(--accent);
  cursor: pointer;
}
.intensity-labels {
  display: flex; justify-content: space-between; max-width: 400px;
  font-size: 0.7rem; color: var(--text-dim); margin-top: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.intensity-description {
  margin-top: 16px; font-size: 0.9rem; color: var(--text-muted);
  padding: 12px 16px; background: var(--warm-glow);
  border-radius: var(--radius); border-left: 3px solid var(--warm);
}

.curator-results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.curator-column h3 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-light); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.curator-column ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.curator-column li {
  padding: 12px 14px; background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 0.88rem;
  transition: opacity var(--transition), transform var(--transition);
}
.curator-column li strong { display: block; margin-bottom: 4px; }
.curator-column li span { color: var(--text-muted); font-size: 0.82rem; }
.curator-column li.dimmed { opacity: 0.25; }

@media (max-width: 768px) {
  .curator-results { grid-template-columns: 1fr; }
}

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

/* ── Guide ── */
.guide-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
}
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.guide-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.guide-card h3 { font-size: 1rem; margin-bottom: 10px; color: var(--accent-light); }
.guide-card p { color: var(--text-muted); font-size: 0.92rem; }

/* ── Reading ── */
.reading-section {
  max-width: var(--max-width); margin: 0 auto; padding: 60px 24px;
  background: var(--bg-surface);
}
.reading-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.reading-list li {
  padding: 20px; background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.reading-list strong { display: block; font-size: 1rem; margin-bottom: 6px; }
.reading-list span { color: var(--text-muted); font-size: 0.92rem; }
.ecosystem-link { margin-top: 24px; font-size: 0.85rem; color: var(--text-dim); }
.ecosystem-link a { color: var(--accent-light); }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 24px; margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-name { font-size: 0.9rem; font-weight: 600; }
.footer-version { font-size: 0.75rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 0.85rem; color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Focus styles ── */
:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Print ── */
@media print {
  .site-header, .site-footer, .curator-actions, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
  .intro-visual { display: none; }
  .technique-card { break-inside: avoid; }
  .curator-column li { break-inside: avoid; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
