:root {
    --cream: #F5EDD6;
    --cream-dark: #EAD9B4;
    --brown: #3B2410;
    --brown-mid: #6B3F1E;
    --red: #C0392B;
    --gold: #C9922A;
    --gold-light: #E8C56A;
    --ink: #1C1008;
    --paper: #FAF3E0;
    --scratch: rgba(59,36,16,0.07);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--cream);
    font-family: 'DM Sans', sans-serif;
    color: var(--brown);
    overflow-x: hidden;
  }

  /* ── GRAIN OVERLAY ── */
  body::before {
    content: '';
    position: fixed; inset: 0; z-index: 9999; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.35;
  }

  /* ── HERO HEADER ── */
  .hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    border-bottom: 3px double var(--brown-mid);
    position: relative;
    background: var(--paper);
  }
  .hero::after {
    content: '';
    display: block;
    height: 6px;
    background: repeating-linear-gradient(90deg, var(--gold) 0, var(--gold) 8px, transparent 8px, transparent 14px);
    margin-top: 1rem;
  }
  .hero-eyebrow {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    letter-spacing: 0.25em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }
  .hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--ink);
    line-height: 1.05;
  }
  .hero h1 span { color: var(--red); }
  .hero-sub {
    font-size: 14px;
    color: var(--brown-mid);
    margin-top: 0.75rem;
    font-family: 'Special Elite', cursive;
    letter-spacing: 0.08em;
  }

  /* ── CONTROLS BAR ── */
  .controls-bar {
    background: var(--brown);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--gold);
  }
  .controls-bar label {
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--gold-light);
    text-transform: uppercase;
  }
  .search-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(201,146,42,0.4);
    border-radius: 2px;
    color: var(--cream);
    padding: 5px 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    width: 200px;
    outline: none;
  }
  .search-input::placeholder { color: rgba(245,237,214,0.4); }
  .search-input:focus { border-color: var(--gold); }
  .filter-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
  .chip {
    font-size: 11px;
    font-family: 'Special Elite', cursive;
    padding: 3px 10px;
    border-radius: 1px;
    border: 1px solid;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .chip.off { opacity: 0.35; filter: grayscale(1); }

  /* ── SCROLL CONTAINER ── */
  .scroll-outer {
    overflow-x: auto;
    overflow-y: visible;
    padding: 2rem 0 3rem;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
  }
  .scroll-outer:active { cursor: grabbing; }
  .scroll-outer::-webkit-scrollbar { height: 8px; }
  .scroll-outer::-webkit-scrollbar-track { background: var(--cream-dark); }
  .scroll-outer::-webkit-scrollbar-thumb { background: var(--brown-mid); border-radius: 0; }

  /* ── TIMELINE CANVAS ── */
  .timeline {
    display: flex;
    align-items: flex-start;
    padding: 0 3rem;
    gap: 0;
    min-width: max-content;
    position: relative;
  }

  /* ── DECADE COLUMN ── */
  .decade-col {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    padding: 0 1px;
    border-right: 1px dashed rgba(59,36,16,0.2);
    position: relative;
  }
  .decade-col:last-child { border-right: none; }

  .decade-header {
    padding: 0 1rem 1rem;
    border-bottom: 2px solid var(--brown-mid);
    margin-bottom: 1.25rem;
  }
  .decade-year {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
  }
  .decade-name {
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--gold);
    text-transform: uppercase;
    margin-top: 2px;
  }
  .decade-context {
    font-size: 11px;
    color: var(--brown-mid);
    margin-top: 6px;
    line-height: 1.4;
    font-style: italic;
  }

  /* ── GENRE CARD ── */
  .genre-card {
    margin: 0 0.75rem 1rem;
    border: 1px solid var(--scratch);
    border-left: 3px solid;
    padding: 10px 12px;
    background: var(--paper);
    position: relative;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .genre-card::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(59,36,16,0.04) 19px, rgba(59,36,16,0.04) 20px);
    pointer-events: none;
  }
  .genre-card:hover { transform: translateY(-2px) rotate(-0.3deg); box-shadow: 3px 4px 12px rgba(59,36,16,0.18); }
  .genre-card.filtered-out { opacity: 0.15; pointer-events: none; }
  .genre-card.search-dim { opacity: 0.2; }

  .genre-name {
    font-family: 'Special Elite', cursive;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .genre-name::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.25;
  }

  .artists-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .artist-tag {
    font-size: 11px;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 0;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.12s;
    background: transparent;
  }
  .artist-tag:hover { color: white; }
  .artist-tag.highlight-match {
    font-weight: 500;
    outline: 2px solid var(--gold);
    outline-offset: 1px;
  }

  /* ── MODAL ── */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(28,16,8,0.75);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .modal-backdrop.open { opacity: 1; pointer-events: all; }

  .modal {
    background: var(--paper);
    border: 2px solid var(--brown-mid);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 8px 10px 0 var(--brown);
    transform: translateY(12px);
    transition: transform 0.2s;
  }
  .modal-backdrop.open .modal { transform: translateY(0); }

  .modal-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 2px double var(--brown-mid);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }
  .modal-genre-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
  }
  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
  }
  .modal-subtitle {
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--gold);
    text-transform: uppercase;
    margin-top: 3px;
  }
  .modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--brown-mid);
    font-family: 'Playfair Display', serif;
    line-height: 1;
    padding: 2px 6px;
    transition: color 0.15s;
  }
  .modal-close:hover { color: var(--red); }

  .modal-body { padding: 1.25rem 1.5rem; }
  .modal-section { margin-bottom: 1.25rem; }
  .modal-section-title {
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 8px;
  }
  .modal-section-title::after {
    content: ''; flex: 1; height: 1px; background: var(--gold); opacity: 0.3;
  }
  .modal-desc { font-size: 13.5px; line-height: 1.65; color: var(--brown); }

  .albums-grid { display: flex; flex-direction: column; gap: 4px; }
  .album-item {
    font-size: 12.5px; color: var(--brown);
    padding: 5px 8px;
    border-left: 2px solid var(--gold-light);
    background: rgba(201,146,42,0.06);
    line-height: 1.3;
  }
  .album-item strong { color: var(--ink); font-weight: 500; display: block; }
  .album-item span { font-size: 11px; color: var(--brown-mid); font-style: italic; }

  .influence-tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .inf-tag {
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid var(--brown-mid);
    background: transparent;
    color: var(--brown-mid);
    font-family: 'Special Elite', cursive;
    letter-spacing: 0.04em;
  }
  .inf-tag.origin { border-color: var(--gold); color: var(--gold); }
  .inf-tag.led-to { border-color: var(--red); color: var(--red); }

  .youtube-wrap {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    border: 1px solid var(--brown-mid);
    margin-top: 4px;
  }
  .youtube-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
  .yt-placeholder {
    position: relative; padding-bottom: 56.25%; background: var(--cream-dark);
    border: 1px dashed var(--brown-mid);
    display: flex; align-items: center; justify-content: center;
  }
  .yt-placeholder-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
  }
  .yt-btn {
    background: var(--red); color: white; border: none;
    padding: 8px 20px; font-family: 'Special Elite', cursive;
    font-size: 13px; letter-spacing: 0.06em; cursor: pointer;
    transition: background 0.15s;
  }
  .yt-btn:hover { background: #a93226; }
  .yt-note { font-size: 11px; color: var(--brown-mid); font-style: italic; }

  /* ── SCROLL HINT ── */
  .scroll-hint {
    text-align: center;
    padding: 0.5rem;
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--brown-mid);
  }
  .scroll-hint span {
    display: inline-flex; align-items: center; gap: 8px;
  }
  .arrow-anim {
    display: inline-block;
    animation: nudge 1.4s ease-in-out infinite;
  }
  @keyframes nudge {
    0%,100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
  }

  /* ── FOOTER ── */
  .footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 3px double var(--brown-mid);
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--brown-mid);
    background: var(--paper);
  }