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

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
    --font-devanagari: 'Noto Sans Devanagari', sans-serif;
    --max-width: 72rem;
    --content-width: 48rem;
    --nav-height: 4rem;
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --transition: 150ms ease;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg: #090b10;
    --bg-scroll: #12151e;
    --bg-surface: #1a1d27;
    --bg-surface-hover: #222638;
    --bg-elevated: #252a3a;
    --border: #2a2f42;
    --border-subtle: #1e2233;
    --scroll-edge: rgba(201, 168, 76, 0.04);
    --text: #e4e6ef;
    --text-secondary: #9498ae;
    --text-muted: #6b6f85;
    --accent: #c9a84c;
    --accent-dim: rgba(201, 168, 76, 0.15);
    --accent-text: #e0c36a;
    --vadi: #e07c4a;
    --vadi-dim: rgba(224, 124, 74, 0.2);
    --samvadi: #5b9fd4;
    --samvadi-dim: rgba(91, 159, 212, 0.2);
    --used-note: rgba(201, 168, 76, 0.25);
    --unused-note: var(--bg-surface);
    --key-white: #1e2233;
    --key-black: #0d0f16;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* Light theme */
[data-theme="light"] {
    --bg: #edeae4;
    --bg-scroll: #faf9f6;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f5f3ee;
    --bg-elevated: #ffffff;
    --border: #e2dfd8;
    --border-subtle: #eae7e0;
    --scroll-edge: rgba(160, 120, 42, 0.06);
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #a0782a;
    --accent-dim: rgba(160, 120, 42, 0.1);
    --accent-text: #8a6520;
    --vadi: #c05a2a;
    --vadi-dim: rgba(192, 90, 42, 0.15);
    --samvadi: #3a7ab5;
    --samvadi-dim: rgba(58, 122, 181, 0.15);
    --used-note: rgba(160, 120, 42, 0.2);
    --unused-note: var(--bg-surface);
    --key-white: #ffffff;
    --key-black: #2a2a2a;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

a { color: var(--accent-text); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* === Nav === */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-scroll);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    max-width: 60%;
    margin: 0 auto;
    padding: 0 3rem;
    height: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-home {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color var(--transition);
}
.nav-home:hover { color: var(--text); }
.nav-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
    justify-self: center;
    color: var(--accent);
}
.nav-title:hover { color: var(--accent-text); }
.nav-title-en {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.nav-title-hi {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
}
.nav-right button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.nav-right button:hover { color: var(--text); }
.search-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.search-toggle:hover { color: var(--text); }

/* Theme toggle icon states */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* Search bar */
.search-bar {
    padding: 0.75rem 3rem 1rem;
    max-width: 60%;
    margin: 0 auto;
    position: relative;
}
.search-bar[hidden] { display: none; }
#search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
}
#search-input:focus { border-color: var(--accent); }
.search-results {
    position: absolute;
    top: 100%;
    left: 1.5rem;
    right: 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 24rem;
    overflow-y: auto;
    display: none;
    z-index: 50;
}
.search-results.active { display: block; }
.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-surface-hover); }
.search-result-item:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; }
.search-result-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}
.search-result-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* === Scroll Layout === */
.main-content {
    max-width: 60%;
    margin: 0 auto;
    padding: 2.5rem 3rem 4rem;
    min-height: calc(100vh - var(--nav-height) - 10rem);
    background: var(--bg-scroll);
    border-left: 1px solid var(--scroll-edge);
    border-right: 1px solid var(--scroll-edge);
    box-shadow: -1px 0 0 var(--scroll-edge), 1px 0 0 var(--scroll-edge);
}

/* === Hero === */
.hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}
.hero h1 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.hero-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 34rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* === Raag of the Moment (nav) === */
.nav-moment-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--transition);
    white-space: nowrap;
}
.nav-moment-link:hover {
    border-color: var(--accent);
    color: var(--text);
}
.nav-moment-link[hidden] { display: none; }
.nav-moment-note {
    font-size: 0.9rem;
    color: var(--accent-text);
    flex-shrink: 0;
}
.nav-moment-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.nav-moment-raag {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.nav-moment-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
}
.nav-moment-shuffle[hidden] { display: none; }
.nav-moment-shuffle,
.theme-toggle,
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color var(--transition);
}
.nav-moment-shuffle:hover,
.theme-toggle:hover,
.search-toggle:hover {
    color: var(--accent);
}

/* === Sections === */
.home-section {
    margin-top: 2.5rem;
}
.home-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
    color: var(--accent);
}
.section-intro {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    max-width: 44rem;
    font-size: 0.95rem;
}

/* === Featured Raag Card === */
.featured-raag-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 40rem;
    margin: 0 auto;
}
.featured-raag-card {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.featured-raag-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    background: var(--bg-surface-hover);
    color: var(--text);
}
.featured-raag-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.featured-raag-header .devanagari {
    font-weight: 400;
    color: var(--text-secondary);
}
.featured-raag-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 2rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}
.featured-raag-detail {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.detail-value {
    font-size: 0.9rem;
    color: var(--text);
}
.detail-value.swaras {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.featured-raag-footer {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}
.featured-raag-rasa {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}
.featured-raag-cta {
    font-size: 0.85rem;
    color: var(--accent-text);
    font-weight: 500;
}
.featured-raag-card:hover .featured-raag-cta {
    text-decoration: underline;
}

/* === Coming Soon === */
.home-coming-soon {
    margin-top: 2rem;
    padding-bottom: 1rem;
}
.coming-soon-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.coming-soon-tag {
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition);
}
.coming-soon-tag:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* === Cards === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    display: block;
    color: var(--text);
}
.card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--text);
}
.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}
.card h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.card-small { padding: 1rem; }
.card-placeholder { opacity: 0.5; cursor: default; }
.card-placeholder:hover { background: var(--bg-surface); border-color: var(--border); box-shadow: none; }

.card-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.meta-tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    background: var(--accent-dim);
    color: var(--accent-text);
    border-radius: 1rem;
    white-space: nowrap;
}
.card-pakad {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}
.card-swaras {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.card-mood { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }

.swaras-label { font-weight: 500; color: var(--text-secondary); }

/* === Article === */
.article {
    margin: 0 auto;
}
.article-header { margin-bottom: 2rem; }
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-text); }
.article-header h1 {
    font-size: 2rem;
    line-height: 1.3;
}
.article-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.devanagari {
    font-family: var(--font-devanagari), sans-serif;
    font-weight: 400;
    color: var(--text-secondary);
}
h1 .devanagari { font-size: 0.8em; }
h3 .devanagari { font-size: 0.85em; }

/* Article body prose */
.article-body h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--accent);
}
.article-body h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.article-body p {
    margin-bottom: 1rem;
    color: var(--text);
}
.article-body ul, .article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.article-body li {
    margin-bottom: 0.3rem;
    color: var(--text);
}
.article-body li::marker { color: var(--accent); }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { font-style: italic; }
.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.15rem 0.4rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.article-body th, .article-body td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    text-align: left;
}
.article-body th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text);
}
.article-body td { color: var(--text-secondary); }

/* Article nav */
.article-nav {
    margin-top: 3rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.article-nav h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.article-nav ul { list-style: none; padding: 0; }
.article-nav li { margin-bottom: 0.3rem; }
.article-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.article-nav a:hover { color: var(--accent-text); }

/* === Raag Page === */
.raag-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.raag-meta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.raag-meta-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.raag-meta-card dl { display: grid; gap: 0.3rem; }
.raag-meta-card dt {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.raag-meta-card dd {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.swaras {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}
.swaras-large {
    font-size: 1.2rem;
    padding: 0.5rem 0;
}
.pakad { font-style: italic; }

/* === Swara Keyboard === */
.swara-keyboard-container {
    margin: 1.5rem 0 2rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.swara-keyboard-container h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.keyboard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.keyboard-row-label {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    min-width: 4.5rem;
    text-align: right;
    flex-shrink: 0;
}
.keyboard-keys {
    display: flex;
    gap: 3px;
}
.key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 0.3rem;
    min-width: 3.5rem;
    height: 4.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform 80ms ease;
    user-select: none;
}
.key:active {
    transform: scale(0.95);
}
.key.used {
    background: var(--used-note);
    border-color: var(--accent);
}
.key.vadi {
    background: var(--vadi-dim);
    border-color: var(--vadi);
    border-width: 2px;
}
.key.samvadi {
    background: var(--samvadi-dim);
    border-color: var(--samvadi);
    border-width: 2px;
}
.key-name {
    font-weight: 600;
    font-size: 0.85rem;
}
.key-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.keyboard-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.5rem;
}
.keyboard-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 2px solid var(--border);
}
.legend-swatch.used { background: var(--used-note); border-color: var(--accent); }
.legend-swatch.vadi { background: var(--vadi-dim); border-color: var(--vadi); }
.legend-swatch.samvadi { background: var(--samvadi-dim); border-color: var(--samvadi); }
.legend-swatch.unused { background: var(--unused-note); border-color: var(--border); }

/* === Thaat page === */
.thaat-swaras-display {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.thaat-swaras-display h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.western-equiv {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.child-raags, .similar-raags { margin-top: 2.5rem; }
.child-raags h2, .similar-raags h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}
.similar-raags-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem;
}

/* === Taal page === */
.taal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.taal-meta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.taal-meta-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.taal-meta-card dl { display: grid; gap: 0.3rem; }
.taal-meta-card dt { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.taal-meta-card dd { font-size: 0.95rem; color: var(--text); margin-bottom: 0.5rem; }

.theka-display {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.theka-display h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.theka-bols {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: var(--text);
    line-height: 1.8;
}
.theka-preview {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.taal-beats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* === Directory / Filters === */
.directory { max-width: var(--max-width); margin: 0 auto; }
.directory .article-header { max-width: var(--content-width); }
.directory-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}
.filter-group select {
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}
.filter-group select:focus { outline: none; border-color: var(--accent); }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    font-size: 1rem;
}

/* === Footer === */
.site-footer {
    max-width: 60%;
    margin: 0 auto;
    background: var(--bg-scroll);
    border-left: 1px solid var(--scroll-edge);
    border-right: 1px solid var(--scroll-edge);
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 3rem;
    text-align: center;
}
.footer-inner {
    margin: 0 auto;
}
.site-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.footer-nav {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.footer-nav a:hover { color: var(--accent-text); }

/* === Raag Family === */
.raag-family { margin-top: 2.5rem; }
.raag-family h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}
.raag-family .section-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.raag-transform-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.raag-transform-table th,
.raag-transform-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    text-align: left;
}
.raag-transform-table th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}
.raag-transform-table td { color: var(--text-secondary); }
.raag-transform-table td:first-child { font-weight: 500; color: var(--text); }

/* === External Links === */
.external-icon {
    font-size: 0.75em;
    opacity: 0.6;
    margin-left: 0.15rem;
}

/* === Gharana Lens === */
.gharana-lens { margin-top: 2.5rem; }
.gharana-lens h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}
.gharana-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}
.gharana-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.gharana-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.gharana-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.gharana-artists {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* === Film Songs === */
.film-songs { margin-top: 2.5rem; }
.film-songs h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}
.film-songs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.film-songs-table th,
.film-songs-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    text-align: left;
}
.film-songs-table th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}
.film-songs-table td { color: var(--text-secondary); }

/* === Sources === */
.sources { margin-top: 2.5rem; }
.sources h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.sources-list {
    list-style: none;
    padding: 0;
}
.sources-list li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.sources-list li:last-child { border-bottom: none; }
.source-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* === Footnotes (markdown-it) === */
.footnotes {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.footnotes ol { padding-left: 1.5rem; }
.footnotes li { margin-bottom: 0.5rem; }
.footnote-ref { font-size: 0.75em; vertical-align: super; }
.footnote-backref { text-decoration: none; }

/* === Mobile === */
@media (max-width: 48rem) {

    .main-content, .site-footer, .nav-inner, .search-bar {
        max-width: 100%;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }
    .nav-inner { grid-template-columns: auto 1fr auto; }
    .nav-title-hi { display: none; }
    .nav-title { font-size: 0.95rem; }
    .nav-moment-text { display: none; }
    .nav-moment-link { padding: 0.25rem 0.4rem; }
    .nav-moment-shuffle { display: none; }
    .hero h1 { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero { padding: 1.5rem 0 1rem; }
    .card-grid { grid-template-columns: 1fr; }
    .featured-raag-body { grid-template-columns: 1fr; }
    .raag-meta-grid { grid-template-columns: 1fr; }
    .taal-meta-grid { grid-template-columns: 1fr; }

    .article-header h1 { font-size: 1.6rem; }
    .keyboard-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    .keyboard-row-label { text-align: left; min-width: auto; }
    .keyboard-keys { flex-wrap: wrap; }
    .key { min-width: 2.8rem; }
    .keyboard-legend { flex-wrap: wrap; justify-content: center; }

    .similar-raags-list { grid-template-columns: 1fr 1fr; }
    .directory-filters { flex-direction: column; }

    .film-songs-table { font-size: 0.8rem; }
    .film-songs-table th,
    .film-songs-table td { padding: 0.4rem 0.5rem; }
    .gharana-cards { grid-template-columns: 1fr; }
}

@media (max-width: 30rem) {
    .similar-raags-list { grid-template-columns: 1fr; }
    .key { min-width: 2.2rem; font-size: 0.7rem; height: 3.5rem; }
    .key-name { font-size: 0.75rem; }
    .keyboard-row-label { font-size: 0.65rem; }
}
