/* ==========================================================================
   FFVoid — Void / Signal
   Near-black, quiet layout. Unbounded (variable, wide) for display, Noto Sans SC for text.
   The cursor-driven signal field and the covers carry the colour.
   ========================================================================== */

:root {
    --void: #060607;
    --bone: #e9e6de;
    --ash: #8d8a83;
    --hair: rgba(233, 230, 222, 0.12);
    --signal: #9ff4ff;

    --font-display: 'Unbounded', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-text: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;

    --gutter: 16px;
    --max: 1200px;
    --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

    color-scheme: dark;
}

@media (min-width: 768px) {
    :root { --gutter: 40px; }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--void);
    color: var(--bone);
    font-family: var(--font-text);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

a {
    color: inherit;
}

h1, h2, h3, p, figure, blockquote {
    margin: 0;
}

section[id] {
    scroll-margin-top: 72px;
}

:focus-visible {
    outline: 1px solid var(--signal);
    outline-offset: 4px;
}

/* Full-page signal field that follows the pointer. */
#signal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

main,
.site-footer {
    position: relative;
    z-index: 1;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 12px;
    z-index: 100;
    background: var(--bone);
    color: var(--void);
    padding: 8px 14px;
    text-decoration: none;
}

.skip-link:focus {
    left: 12px;
}

/* ---------- Shared type ---------- */

.section-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.text-link {
    display: inline-block;
    color: var(--bone);
    text-decoration: none;
    font-size: 0.9375rem;
    padding-bottom: 4px;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    transition: color 0.3s var(--ease);
}

.text-link:hover {
    color: var(--signal);
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px var(--gutter);
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.site-header.is-scrolled {
    background: rgba(6, 6, 7, 0.78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--hair);
}

.wordmark {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    gap: 16px;
    font-size: 0.8125rem;
}

.site-nav a {
    color: var(--ash);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.site-nav a:hover {
    color: var(--bone);
}

.lang-toggle {
    font-size: 0.8125rem;
    color: var(--ash);
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.lang-toggle:hover {
    color: var(--bone);
    border-bottom-color: var(--hair);
}

@media (min-width: 600px) {
    .site-nav {
        gap: 32px;
        font-size: 0.9375rem;
    }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 120px var(--gutter) 48px;
}

.hero-inner {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    gap: 40px;
    align-items: end;
}

.hero-id {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.hero-avatar {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    filter: drop-shadow(0 0 22px rgba(159, 244, 255, 0.18));
    animation: avatar-in 1.4s var(--ease) 0.1s both;
}

@keyframes avatar-in {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: none; }
}

.hero-sub {
    font-size: 1rem;
    color: var(--ash);
}

@media (min-width: 900px) {
    .hero-avatar {
        width: 96px;
        height: 96px;
    }
}

/* The wordmark: each letter's weight follows the pointer (see app.js). */
.hero-name {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.75rem, 9.5vw, 9rem);
    line-height: 1;
    letter-spacing: 0;
    margin: 0;
    white-space: nowrap;
}

.hero-name .line {
    display: block;
    overflow: hidden;
    padding: 0.06em 0 0.14em;
}

.hero-name .line > span {
    display: inline-block;
}

.hero-name .ch {
    display: inline-block;
    text-align: center;
    font-variation-settings: normal;
}

/* One orchestrated entrance, CSS only: no script needed. */
.js .hero-name .line > span {
    animation: rise 1.6s var(--ease) 0.15s both;
}

@keyframes rise {
    from { transform: translateY(105%); }
    to   { transform: none; }
}

.hero-lede {
    max-width: 34ch;
    margin-top: 20px;
    font-size: clamp(1rem, 1.5vw, 1.1875rem);
    color: var(--ash);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 32px;
    margin-top: 32px;
}

.hero-latest {
    justify-self: start;
    width: clamp(150px, 40vw, 280px);
    perspective: 900px;
}

.hero-latest a {
    display: block;
    text-decoration: none;
}

.hero-latest img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s var(--ease), box-shadow 0.4s var(--ease);
    box-shadow: 0 0 0 rgba(159, 244, 255, 0);
}

.hero-latest a:hover img {
    box-shadow: 0 20px 80px rgba(120, 90, 255, 0.35);
}

.hero-latest figcaption {
    display: grid;
    gap: 2px;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--ash);
    line-height: 1.5;
}

.hero-latest figcaption strong {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--bone);
}

.latest-label {
    color: var(--ash);
}

@media (max-width: 699px) {
    .hero-name {
        font-size: clamp(2.75rem, 15vw, 5rem);
    }
}

@media (min-width: 900px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 22vw);
        gap: 64px;
    }

    .hero-latest {
        justify-self: end;
        margin-bottom: 8px;
    }
}

:lang(zh) .hero-name {
    font-size: clamp(3.25rem, 12vw, 8rem);
}

/* ---------- Albums ---------- */

.music {
    padding: clamp(96px, 14vw, 170px) 0 clamp(96px, 12vw, 150px);
}

.music-inner,
.notes-inner,
.contact-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px;
    margin-bottom: 48px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 0.9375rem;
}

.filter {
    position: relative;
    color: var(--ash);
    padding: 6px 0;
    transition: color 0.3s var(--ease);
}

.filter:hover {
    color: var(--bone);
}

.filter[aria-pressed="true"] {
    color: var(--bone);
}

.filter[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--bone);
}

.index {
    border-top: 1px solid var(--hair);
}

.row {
    border-bottom: 1px solid var(--hair);
}

.row-main {
    width: 100%;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    column-gap: 20px;
    align-items: baseline;
    padding: 24px 0;
    text-align: left;
}

.row-year {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 0.8125rem;
    color: var(--ash);
    font-variant-numeric: tabular-nums;
    transition: color 0.3s var(--ease);
}

.row-thumb,
.row-year-m {
    display: none;
}

.row-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.0625rem, 1.8vw, 1.5rem);
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--ash);
    transition: color 0.3s var(--ease), transform 0.6s var(--ease), font-weight 0.3s var(--ease);
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--ash);
}

.row-main:hover .row-title,
.row-main:focus-visible .row-title {
    color: var(--bone);
    font-weight: 500;
    transform: translateX(6px);
}

.row.is-selected .row-title {
    color: var(--bone);
    font-weight: 500;
}

.row.is-selected .row-year {
    color: var(--signal);
}

.music-grid {
    display: block;
}

.preview {
    display: none;
}

.player-slot[hidden] {
    display: none;
}

.player-slot iframe {
    display: block;
    width: 100%;
    height: 352px;
    border: 0;
}

@media (min-width: 900px) {
    .music-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        gap: 72px;
        align-items: start;
    }

    .preview {
        display: flex;
        flex-direction: column;
        gap: 28px;
        position: sticky;
        top: 112px;
    }

    .preview-cover {
        aspect-ratio: 1;
        overflow: hidden;
        background: #0c0c0e;
    }

    .preview-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 0.45s var(--ease), transform 1.2s var(--ease);
    }

    .preview-cover img.is-changing {
        opacity: 0;
        transform: scale(1.03);
    }

    .preview-title {
        font-family: var(--font-display);
        font-weight: 400;
        font-size: 1.5rem;
        line-height: 1.25;
        letter-spacing: -0.02em;
    }

    .preview-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 16px;
        margin-top: 10px;
        font-size: 0.875rem;
        color: var(--ash);
    }

    .preview-desc {
        max-width: 40ch;
        margin-top: 14px;
        font-size: 0.9375rem;
        color: var(--ash);
    }

    .preview-info .text-link {
        margin-top: 20px;
    }
}

/* Mobile: compact rows with a thumbnail; the player opens under the chosen row. */
@media (max-width: 899px) {
    .row-main {
        grid-template-columns: 56px minmax(0, 1fr);
        column-gap: 16px;
        align-items: center;
        padding: 16px 0;
    }

    .row-thumb {
        display: block;
        width: 56px;
        height: 56px;
        object-fit: cover;
    }

    .row-year {
        display: none;
    }

    .row-year-m {
        display: inline;
    }

    .row-title {
        font-size: 1.0625rem;
    }

    .row-main:hover .row-title,
    .row-main:focus-visible .row-title {
        transform: none;
    }

    .player-slot {
        padding: 4px 0 28px;
    }
}

/* ---------- Notes ---------- */

.notes {
    padding: clamp(96px, 12vw, 150px) 0;
    border-top: 1px solid var(--hair);
}

.notes-inner {
    display: block;
    padding-top: clamp(56px, 8vw, 96px);
}

.notes-title {
    margin-bottom: 48px;
}

.essay {
    max-width: 38rem;
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 1.95;
    color: rgba(233, 230, 222, 0.82);
}

.essay > p + p {
    margin-top: 1.35em;
}

.essay-lead {
    font-weight: 200;
    font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    line-height: 1.6;
    color: var(--bone);
}

.essay-turn {
    color: var(--bone);
}

.pullquote {
    margin: 3.5rem 0;
    padding-left: 24px;
    border-left: 1px solid var(--signal);
}

.pullquote p {
    font-weight: 300;
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    line-height: 1.65;
    color: var(--bone);
}

.signature {
    margin-top: 3.5rem !important;
    padding-top: 24px;
    border-top: 1px solid var(--hair);
    font-size: 0.875rem;
    color: var(--ash);
}

@media (min-width: 900px) {
    .notes-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
        gap: 80px;
    }

    .notes-title {
        position: sticky;
        top: 112px;
        align-self: start;
        margin-bottom: 0;
    }
}

/* ---------- Contact ---------- */

.contact {
    padding: clamp(96px, 12vw, 150px) 0;
    border-top: 1px solid var(--hair);
}

.contact-inner {
    padding-top: clamp(56px, 8vw, 96px);
}

.contact-sub {
    max-width: 40ch;
    margin: 24px 0 56px;
    font-size: 1rem;
    color: var(--ash);
}

.email-btn {
    display: block;
    max-width: 100%;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.125rem, 4.2vw, 3.25rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.email-btn .email {
    background: linear-gradient(var(--hair), var(--hair)) 0 100% / 100% 1px no-repeat;
    padding-bottom: 8px;
    transition: color 0.3s var(--ease), background-image 0.3s var(--ease);
}

.email-btn:hover .email {
    color: var(--signal);
    background-image: linear-gradient(var(--signal), var(--signal));
}

.copy-hint {
    margin: 14px 0 40px;
    font-size: 0.875rem;
    color: var(--ash);
}

/* ---------- Footer ---------- */

.site-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px var(--gutter) 56px;
    border-top: 1px solid var(--hair);
    font-size: 0.875rem;
    color: var(--ash);
    max-width: var(--max);
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.footer-links a:hover {
    color: var(--bone);
}

.footer-copy p + p {
    margin-top: 2px;
}

@media (min-width: 700px) {
    .site-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 50;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    background: var(--bone);
    color: var(--void);
    font-size: 0.875rem;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
