/* Latent Spectral Equivariance — project page */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../../assets/fonts/inter.woff2") format("woff2");
}
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../../assets/fonts/source-serif-4.woff2") format("woff2");
}
@font-face {
    font-family: "Source Serif 4";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../../assets/fonts/source-serif-4-italic.woff2") format("woff2");
}

:root {
    --ink: #14171c;
    --ink-2: #3c434d;
    --muted: #6a7280;
    --line: #e2e5ea;
    --line-soft: #edf0f3;
    --paper: #ffffff;
    --wash: #f4f5f8;
    --accent: #3558d6;
    --accent-ink: #2646b8;
    --ours: #edf1fd;
    --ref: #12936b;
    --ref-ink: #0b6a4d;
    --ref-bg: #e8f6f0;
    --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Source Serif 4", "Source Serif Pro", Charter, Georgia, "Times New Roman", serif;
    --page: 1480px;
    --bar: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bar) + 20px);
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: var(--serif);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--wash);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="slider"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); }

.skip-link {
    position: absolute;
    top: -80px;
    left: 20px;
    z-index: 30;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-family: var(--sans);
    font-size: 0.9rem;
}
.skip-link:focus { top: 12px; }

/* ---------- Section bar (slides in once the title block is out of view) ---------- */
.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 15;
    height: var(--bar);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.topbar.is-visible {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease, visibility 0s;
}
.topbar-inner {
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
    gap: 16px;
    max-width: var(--page);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    font-family: var(--sans);
}
.topbar-title {
    justify-self: start;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.topbar-title:hover { text-decoration: none; color: var(--accent-ink); }
.topbar-links {
    position: relative;
    display: flex;
    gap: 2px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar-links::-webkit-scrollbar { display: none; }
.topbar-links a {
    flex: none;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.topbar-links a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.topbar-links a[aria-current="true"] { background: var(--ink); color: #fff; }
.topbar-links .short { display: none; }

/* ---------- Title block ---------- */
.hero {
    padding: 84px 20px 0;
    background: linear-gradient(180deg, #eef2fc 0, #f8f9fd 180px, var(--paper) 440px);
    text-align: center;
}
.hero-inner { max-width: 1000px; margin: 0 auto; }
.hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4.8vw, 3.3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.authors {
    margin: 20px 0 0;
    font-family: var(--sans);
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--ink-2);
}
.tldr {
    max-width: 44rem;
    margin: 28px auto 0;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--ink-2);
    text-wrap: balance;
}
.tldr .label {
    margin-right: 6px;
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    vertical-align: 0.14em;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
    font-family: var(--sans);
}
.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.button:hover { border-color: #c5cbd3; transform: translateY(-1px); text-decoration: none; }
.button svg {
    flex: none;
    color: var(--muted);
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.teaser {
    max-width: 1100px;
    margin: 56px auto 0;
    padding: 0;
}
.teaser a { display: block; cursor: zoom-in; }
.teaser img { display: block; width: 100%; height: auto; }
.teaser figcaption {
    max-width: 52rem;
    margin: 18px auto 0;
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--muted);
}
.teaser figcaption .label { font-weight: 600; color: var(--ink-2); }

/* ---------- Abstract and contributions ---------- */
.paper {
    padding: 0 20px 88px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.section { max-width: 1100px; margin: 0 auto; padding-top: 80px; }
.section > h3,
.demos-section > h3 {
    margin: 0 0 24px;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-align: center;
}
.prose { max-width: 760px; }
.prose p {
    margin: 0 0 16px;
    text-align: justify;
}
.prose p:last-child { margin-bottom: 0; }

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.card {
    padding: 24px 24px 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafbfc;
}
.card-index {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 700;
}
.card h4 {
    margin: 16px 0 8px;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.card p { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--ink-2); }
/* Number, title and text sit on shared rows, so the three cards line up whatever the title length. */
@media (min-width: 981px) {
    @supports (grid-template-rows: subgrid) {
        .card {
            display: grid;
            grid-row: span 3;
            grid-template-rows: subgrid;
            row-gap: 0;
        }
        .card-index { justify-self: start; }
    }
}

/* ---------- Demo sections ---------- */
.demos-section {
    max-width: var(--page);
    margin: 0 auto;
    padding: 80px 20px 16px;
}
.demos-section:last-of-type { padding-bottom: 96px; }
.demos-section > h3 { margin-bottom: 0; }
.demos-section > .section-intro {
    max-width: 44rem;
    margin: 10px auto 0;
    font-size: 1rem;
    line-height: 1.55;
    color: #59616d;
    text-align: center;
}
.demos-group { margin-top: 20px; }
.demos-group + .demos-group { margin-top: 64px; }
.demos-group > h4 {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-2);
}
.demos-group > h4::before,
.demos-group > h4::after {
    content: "";
    flex: 1 1 0;
    height: 1px;
    background: var(--line);
}

.demo-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 10px 10px;
    margin-top: 40px;
    scroll-margin-top: calc(var(--bar) + 20px);
}
.demos-group > h4 + .demo-block { margin-top: 24px; }
.demo-block > h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    color: var(--accent-ink);
}
.demo-block > .demo-desc {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.5;
    color: var(--ink);
}
.demo-block > .demo-table-wrapper { grid-column: 1 / -1; }

.demo-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.03);
}
/* Methods are columns of equal width; images, players and videos scale with the column.
   Below the minimum width for the column count, the table scrolls sideways. */
.demo-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--sans);
}
.demo-table:has(thead th:nth-child(8)) { min-width: 1000px; }
.demo-table:has(thead th:nth-child(10)) { min-width: 1216px; }
.demo-table:has(thead th:nth-child(12)) { min-width: 1472px; }
.demo-table th,
.demo-table td {
    padding: 5px 6px;
    text-align: center;
    vertical-align: middle;
}
.demo-table thead th {
    padding: 14px 6px 9px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
}
.demo-table thead th:first-child,
.demo-table tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 58px;
    background: var(--paper);
}
.demo-table tbody th {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.demo-table tbody tr:last-child > * { padding-bottom: 12px; }
.demo-table .col-ours { background: var(--ours); }
.demo-table thead th.col-ours {
    color: var(--accent-ink);
    box-shadow: inset 0 3px 0 var(--accent);
}
/* Ground Truth is the first method column of every table. */
.demo-table thead th:nth-child(2),
.demo-table tbody td:nth-child(2) { background: var(--ref-bg); }
.demo-table thead th:nth-child(2) {
    color: var(--ref-ink);
    box-shadow: inset 0 3px 0 var(--ref);
}
.demo-table tbody td:nth-child(2) { --tone: var(--ref); }

.demo-table .mel img,
.demo-table .mel-missing {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 7 / 4;
    border-radius: 6px;
    background: #ece9f1;
}
.demo-table .mel img { cursor: zoom-in; }
.demo-table td.audio.missing,
.demo-table td.video.missing { color: #b0b6bd; }
.demo-table audio { display: block; width: 100%; height: 32px; }
.demo-table video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    background: #000;
    object-fit: contain;
}
.demo-table video:fullscreen { border-radius: 0; }

/* ---------- Players (static/js/main.js) ---------- */
.player {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px 0 3px;
    border-radius: 999px;
    background: #eff1f4;
}
.col-ours .player,
.demo-table tbody td:nth-child(2) .player { background: #fff; }
.player-toggle,
.player-expand {
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.player-toggle {
    width: 24px;
    height: 24px;
    background: var(--ink);
    color: #fff;
    transition: background-color 0.15s ease, transform 0.12s ease;
}
.player-toggle:hover { transform: scale(1.1); }
.player-toggle svg { width: 10px; height: 10px; fill: currentColor; }
.player.playing .player-toggle { background: var(--tone, var(--accent)); }
.player.loading .player-toggle { animation: player-pulse 0.9s ease-in-out infinite; }
@keyframes player-pulse { 50% { opacity: 0.45; } }
.player-expand {
    width: 22px;
    height: 22px;
    margin-right: -4px;
    background: transparent;
    color: var(--muted);
}
.player-expand:hover { background: rgba(20, 23, 28, 0.08); color: var(--ink); }
.player-expand svg { width: 12px; height: 12px; }
.player-bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 20px;
    height: 4px;
    border-radius: 2px;
    background: #d2d7dd;
    cursor: pointer;
}
.player-bar::before { content: ""; position: absolute; inset: -11px 0; }
.player-fill {
    width: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--tone, var(--accent));
}
.player-time {
    flex: none;
    min-width: 25px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    text-align: right;
}

.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
}
.video-glyph {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border-radius: 50%;
    background: rgba(12, 14, 18, 0.58);
    color: #fff;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.video-glyph svg { width: 15px; height: 15px; margin-left: 2px; fill: currentColor; }
.video-frame:hover .video-glyph { transform: scale(1.08); }
.video-frame.is-playing .video-glyph { opacity: 0; }
td.video .player { margin-top: 6px; }

td.has-playhead { position: relative; }
.playhead {
    position: absolute;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
.playhead[hidden] { display: none; }

/* ---------- Full-size figure ---------- */
.figure-panels {
    display: grid;
    gap: 24px;
    max-width: 1100px;
    margin: 28px auto 0;
    padding: 0;
}
.figure-card {
    display: block;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.03);
    cursor: zoom-in;
}
.figure-card img { display: block; width: 100%; height: auto; }
.figure-panels figcaption {
    max-width: 52rem;
    margin: 0 auto;
    font-size: 0.94rem;
    line-height: 1.55;
    color: #59616d;
    text-align: center;
}
.figure-panels figcaption .label { font-weight: 600; color: var(--ink-2); }

/* ---------- Enlarged spectrogram ---------- */
.mel-zoom {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: rgba(12, 14, 18, 0.86);
    cursor: zoom-out;
}
.mel-zoom[hidden] { display: none; }
.mel-zoom img {
    width: min(92vw, 880px);
    height: auto;
    aspect-ratio: 7 / 4;
    border-radius: 8px;
}
.mel-zoom p {
    margin: 0;
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
}

/* ---------- Footer ---------- */
footer {
    padding: 28px 20px 32px;
    border-top: 1px solid var(--line);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 0.86rem;
    color: var(--muted);
    text-align: center;
}
footer p { margin: 0; }
footer a { color: var(--muted); }
footer .dot { margin: 0 8px; color: #c3c8cf; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1180px) {
    .topbar-links .long { display: none; }
    .topbar-links .short { display: inline; }
}
@media (max-width: 760px) {
    .topbar-inner { grid-template-columns: auto minmax(0, 1fr); }
    .topbar-links {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    }
}
@media (max-width: 980px) {
    .cards { grid-template-columns: 1fr; gap: 14px; }
    .card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 16px;
        padding: 20px;
    }
    .card-index { grid-row: 1 / span 2; }
    .card h4 { margin: 3px 0 6px; }
    .card h4 br { display: none; }
}
@media (max-width: 640px) {
    body { font-size: 16px; }
    .hero { padding-top: 56px; }
    .tldr { font-size: 1.08rem; }
    .button { height: 38px; padding: 0 15px; font-size: 0.88rem; }
    .teaser { margin-top: 40px; }
    .paper { padding-bottom: 64px; }
    .section { padding-top: 60px; }
    .section > h3,
    .demos-section > h3 { font-size: 1.5rem; }
    .prose p { text-align: left; }
    .demos-section { padding: 60px 14px 8px; }
    .figure-panels { gap: 16px; margin-top: 22px; }
    .figure-card { padding: 8px; border-radius: 10px; }
    .demos-section:last-of-type { padding-bottom: 72px; }
    .topbar-inner { gap: 6px; padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
