/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #08080d;
    --bg-card: #101018;
    --bg-card-hover: #18182a;
    --surface: #161624;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(124, 111, 247, 0.3);
    --text: #ececf4;
    --text-muted: #7a7a96;
    --accent: #7c6ff7;
    --accent-light: #a99cff;
    --accent-glow: rgba(124, 111, 247, 0.15);
    --major: #34d399;
    --minor: #60a5fa;
    --seventh: #fbbf24;
    --sus: #a78bfa;
    --aug: #f472b6;
    --dim: #fb7185;
    --white-key: #ffffff;
    --black-key: #1a1a2e;
    --highlight: #7c6ff7;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px rgba(124, 111, 247, 0.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ========== VIEWS ========== */
.view { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== LOGO & HERO ========== */
.hero {
    position: relative;
    padding: 56px 0 40px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 111, 247, 0.2) 0%, transparent 70%),
        radial-gradient(circle at 20% 80%, rgba(96, 165, 250, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(244, 114, 182, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    transition: transform var(--transition);
}

.logo-link:hover { transform: scale(1.02); }

.logo-svg {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(124, 111, 247, 0.3));
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
}

.accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-light), #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    margin-top: 14px;
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.01em;
}

/* ========== NAV BAR ========== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 13, 0.85);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.nav-inner { display: flex; flex-direction: column; gap: 8px; }
.nav-roots, .nav-types { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.nav-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.nav-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: rgba(124, 111, 247, 0.08);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent), #6459d4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(124, 111, 247, 0.3);
}

.nav-btn-accent {
    border-color: rgba(124, 111, 247, 0.25);
    color: var(--accent-light);
}

.nav-btn-accent:hover {
    background: linear-gradient(135deg, var(--accent), #6459d4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(124, 111, 247, 0.3);
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
    background: rgba(22, 22, 36, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255,255,255,0.15);
}

.breadcrumbs a { color: var(--accent-light); transition: color var(--transition); }
.breadcrumbs a:hover { color: #fff; }
.breadcrumbs .current { color: var(--text); }

/* ========== INTRO ========== */
.intro { padding: 52px 0 36px; }
.intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 16px;
    background: linear-gradient(to right, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.intro p { color: var(--text-muted); max-width: 720px; font-size: 1rem; line-height: 1.7; }

.legend { margin-top: 32px; }
.legend h3 { font-size: 1rem; margin-bottom: 16px; color: var(--text); font-weight: 600; }

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.legend-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.legend-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

.legend-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.legend-item:hover::before { opacity: 1; }

.legend-item:nth-child(1)::before { background: linear-gradient(90deg, var(--major), transparent); }
.legend-item:nth-child(2)::before { background: linear-gradient(90deg, var(--minor), transparent); }
.legend-item:nth-child(3)::before { background: linear-gradient(90deg, var(--seventh), transparent); }
.legend-item:nth-child(4)::before { background: linear-gradient(90deg, var(--sus), transparent); }
.legend-item:nth-child(5)::before { background: linear-gradient(90deg, var(--aug), transparent); }
.legend-item:nth-child(6)::before { background: linear-gradient(90deg, var(--dim), transparent); }

.legend-item p { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.badge-lg { font-size: 0.85rem; padding: 6px 18px; border-radius: 14px; }

.badge-major { background: rgba(52, 211, 153, 0.12); color: var(--major); border-color: rgba(52, 211, 153, 0.15); }
.badge-minor { background: rgba(96, 165, 250, 0.12); color: var(--minor); border-color: rgba(96, 165, 250, 0.15); }
.badge-seventh { background: rgba(251, 191, 36, 0.12); color: var(--seventh); border-color: rgba(251, 191, 36, 0.15); }
.badge-sus { background: rgba(167, 139, 250, 0.12); color: var(--sus); border-color: rgba(167, 139, 250, 0.15); }
.badge-aug { background: rgba(244, 114, 182, 0.12); color: var(--aug); border-color: rgba(244, 114, 182, 0.15); }
.badge-dim { background: rgba(251, 113, 133, 0.12); color: var(--dim); border-color: rgba(251, 113, 133, 0.15); }

/* ========== CHORD GRID ========== */
.chord-grid { padding: 24px 0 60px; }
.root-section { margin-bottom: 48px; }

.root-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.root-title .note-circle {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(124, 111, 247, 0.25);
}

.chord-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ========== CHORD CARD ========== */
.chord-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chord-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(124, 111, 247, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.chord-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(124, 111, 247, 0.06);
}

.chord-card:hover::before { opacity: 1; }

.card-header { padding: 16px 18px 10px; }
.card-name { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-notes { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.02em; }
.card-keyboard { padding: 2px 12px 8px; }
.card-keyboard svg { width: 100%; height: auto; }
.card-actions { padding: 10px 18px 14px; display: flex; gap: 8px; margin-top: auto; }

.btn-play {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--accent), #6459d4);
    color: #fff; border: none;
    padding: 8px 16px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition); font-family: inherit;
    box-shadow: 0 2px 8px rgba(124, 111, 247, 0.2);
}
.btn-play:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(124, 111, 247, 0.35);
}
.btn-play.playing { background: linear-gradient(135deg, var(--major), #22c55e); box-shadow: 0 2px 12px rgba(52,211,153,0.3); }
.btn-play svg { width: 13px; height: 13px; fill: currentColor; }

/* ========== CHORD PAGE ========== */
.note-circle-lg {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 700; color: #fff;
    margin-bottom: 10px;
    box-shadow: 0 8px 32px rgba(124, 111, 247, 0.3);
}

.root-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 720px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.root-quick-facts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.chord-hero {
    text-align: center;
    padding: 56px 0 28px;
    position: relative;
}

.chord-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 350px;
    background: radial-gradient(ellipse, rgba(124, 111, 247, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.chord-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-top: 14px;
    position: relative;
}

.chord-symbol {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.5em;
    font-weight: 400;
    margin-left: 8px;
}

.chord-hero-accroche {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 14px;
    max-width: 600px;
    margin-inline: auto;
    line-height: 1.6;
}

.chord-main {
    text-align: center;
    padding: 24px 0 44px;
}

.chord-keyboard-large {
    max-width: 600px;
    margin: 0 auto 28px;
}
.chord-keyboard-large svg { width: 100%; height: auto; }

.chord-quick-facts {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.fact {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    text-align: center;
    transition: all var(--transition);
}

.fact:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.fact-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.fact-value { font-size: 0.9rem; font-weight: 600; }

.chord-play-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--accent), #6459d4);
    color: #fff; border: none;
    padding: 14px 36px; border-radius: 28px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition); font-family: inherit;
    box-shadow: 0 4px 20px rgba(124, 111, 247, 0.3);
}
.chord-play-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 28px rgba(124, 111, 247, 0.4);
}
.chord-play-btn.playing { background: linear-gradient(135deg, var(--major), #22c55e); box-shadow: 0 4px 20px rgba(52,211,153,0.3); }
.chord-play-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ========== CHORD SECTIONS ========== */
.chord-section {
    padding: 36px 0;
    border-top: 1px solid var(--border);
}

.chord-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 22px;
}

/* Theory grid */
.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.theory-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: all var(--transition);
}

.theory-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.theory-card h3 {
    font-size: 0.95rem;
    color: var(--accent-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.theory-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Intervals table */
.intervals-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.interval-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    transition: all var(--transition);
}

.interval-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.interval-note {
    font-weight: 700;
    min-width: 50px;
    color: var(--accent-light);
}

.interval-name { flex: 1; color: var(--text-muted); font-size: 0.88rem; }
.interval-dt { color: var(--text-muted); font-size: 0.82rem; font-weight: 500; }

/* Associations */
.assoc-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.assoc-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: all var(--transition);
}
.assoc-tag:hover {
    border-color: var(--border-hover);
    color: var(--accent-light);
    background: rgba(124, 111, 247, 0.06);
}

/* Related chords */
.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.related-group h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.related-links { display: flex; flex-wrap: wrap; gap: 8px; }

.related-link {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    transition: all var(--transition);
}
.related-link:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

/* ========== HOWTO ========== */
.howto-steps { display: flex; flex-direction: column; gap: 18px; }

.howto-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 111, 247, 0.25);
}

.step-content { flex: 1; }
.step-content h3 { font-size: 0.95rem; margin-bottom: 6px; font-weight: 600; }
.step-content p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }

.step-tip {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(124, 111, 247, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: var(--accent-light);
    font-style: italic;
    line-height: 1.5;
}

/* ========== FAQ ========== */
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:hover { border-color: var(--border-hover); }

.faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}

.faq-item summary:hover { background: var(--bg-card-hover); }

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent);
    transition: transform var(--transition);
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 20px 18px;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ========== PROGRESSIONS ========== */
.prog-hero {
    text-align: center;
    padding: 52px 0 36px;
}

.prog-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.prog-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 12px;
    line-height: 1.6;
}

.prog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    padding-bottom: 60px;
}

.prog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.prog-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), var(--shadow-glow);
    transform: translateY(-2px);
}

.prog-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.prog-emoji { font-size: 1.6rem; }
.prog-card-header h2, .prog-card-header h3 { font-size: 1.15rem; font-weight: 700; }
.prog-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }

.prog-degrees {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.degree-badge {
    background: rgba(124, 111, 247, 0.08);
    border: 1px solid rgba(124, 111, 247, 0.15);
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
}

.degree-arrow { color: var(--text-muted); font-size: 0.8rem; }

.prog-example {
    margin-bottom: 14px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prog-key-label { color: var(--text-muted); }

.prog-chord-tag {
    background: rgba(124, 111, 247, 0.08);
    padding: 4px 12px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.82rem;
    border: 1px solid rgba(124, 111, 247, 0.1);
}

.prog-songs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.prog-song {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 12px;
    border-radius: 10px;
    font-style: italic;
    border: 1px solid var(--border);
}

.prog-tips {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(124, 111, 247, 0.04);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    line-height: 1.5;
}

.prog-play-btn {
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

/* ========== CIRCLE OF FIFTHS ========== */
.circle-wrapper {
    max-width: 560px;
    margin: 0 auto 40px;
    position: relative;
    text-align: center;
}

.circle-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.3));
}

.cof-segment { transition: fill 0.2s ease, opacity 0.2s ease; }
.cof-major:hover { fill: #2a2a48 !important; }
.cof-minor:hover { fill: #1e1e38 !important; }
@keyframes cofPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.cof-playing {
    fill: var(--accent) !important;
    opacity: 0.85;
    animation: cofPulse 0.5s ease-in-out infinite;
}

.circle-now-playing {
    margin-top: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-light);
    min-height: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.circle-now-playing.visible { opacity: 1; }

.section-intro {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cof-prog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.cof-prog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cof-prog-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), var(--shadow-glow);
    transform: translateY(-2px);
}

.cof-prog-play {
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

/* ========== STAFF NOTATION (classic B&W) ========== */
.card-staff {
    padding: 6px 10px;
    background: #fff;
    border-radius: 8px;
    margin: 0 12px 6px;
    max-width: 140px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
}
.card-staff svg { width: 100%; height: auto; }

.chord-staff-large {
    max-width: 320px;
    margin: 0 auto 16px;
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: none;
}
.chord-staff-large svg { width: 100%; height: auto; }

.prog-staff {
    margin: 6px 0 10px;
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: none;
}
.prog-staff svg { width: 100%; height: auto; min-width: 160px; }

/* Progression chords visible by default, dimmed when playing (except active) */
.staff-progression .staff-chord {
    opacity: 1;
    transition: opacity 0.2s ease;
}
.staff-progression.staff-is-playing .staff-chord {
    opacity: 0.25;
}
.staff-progression.staff-is-playing .staff-chord.staff-playing {
    opacity: 1;
}

@keyframes staffPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.staff-chord.staff-playing path {
    fill: var(--accent) !important;
    stroke: var(--accent) !important;
    animation: staffPulse 0.5s ease-in-out infinite;
}
.staff-chord.staff-playing rect {
    fill: var(--accent) !important;
    stroke: var(--accent) !important;
}
.staff-chord.staff-playing text { fill: var(--accent-light) !important; }

/* ========== FOOTER ========== */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero { padding: 40px 0 32px; }
    .logo-link { gap: 12px; }
    .logo-svg { width: 46px; height: 46px; }
    .chord-cards { grid-template-columns: 1fr; }
    .legend-grid { grid-template-columns: 1fr 1fr; }
    .theory-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .prog-grid { grid-template-columns: 1fr; }
    .chord-quick-facts { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .legend-grid { grid-template-columns: 1fr; }
    .nav-btn { padding: 5px 10px; font-size: 0.75rem; }
}
