/* Patrick Yao — Personal Website
   Sound artist theme · Black background · White typography
   Computer Modern Typewriter */

:root {
    --bg: #0a0a0a;
    --bg-subtle: #111;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #888;
    --border: #222;
    --font-main: 'Computer Modern Typewriter', 'CMU Typewriter', monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f5;
        --bg-subtle: #eee;
        --text: #1a1a1a;
        --text-muted: #555;
        --accent: #444;
        --border: #ddd;
    }
}

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

html {
    scroll-behavior: smooth;
    color-scheme: light dark;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Sound artist background: subtle waveform/spectral grid */
.waveform-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Alternating bands evoke spectral frequencies */
.waveform-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    background-size: 100% 100%;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 3rem;
}

@media (prefers-color-scheme: light) {
    .site-header {
        background: rgba(255, 255, 255, 0.92);
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.nav-brand:hover {
    opacity: 0.7;
}

.nav-logo {
    height: 1.75rem;
    width: auto;
    filter: invert(1); /* white on dark header */
}

@media (prefers-color-scheme: light) {
    .nav-logo {
        filter: none; /* dark on light header */
    }
}

.nav {
    grid-column: 2;
    justify-self: center;
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 3rem;
    justify-content: center;
    align-items: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    transition: opacity 0.2s ease;
}

.nav-toggle:hover {
    opacity: 0.7;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 3rem;
    justify-content: center;
    align-items: center;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    position: relative;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-num {
    opacity: 0.5;
    margin-right: 0.5rem;
    font-size: 0.9em;
}

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

.nav-link:hover .nav-num {
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text);
    transition: width 0.35s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link--active {
    color: var(--text-muted);
}

.nav-link--active::after {
    display: none;
}

/* Page with sidebar (homepage) — grid centers main on page axis */
.page-with-sidebar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 720px) minmax(220px, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 1;
    padding: 0 2rem;
}

.side-nav {
    grid-column: 1;
    justify-self: end;
    position: sticky;
    top: 5.5rem;
    align-self: flex-start;
    width: 220px;
    padding: 2rem 2rem 2rem 0;
    padding-top: 7rem;
}

.side-nav::before {
    content: '';
    position: absolute;
    top: 7rem;
    right: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.side-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.side-nav-link {
    position: relative;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.side-nav-link.side-nav-link--active {
    color: var(--text);
}

.side-nav-link.side-nav-link--active .nav-num {
    opacity: 1;
}

.side-nav-link.side-nav-link--active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0.75em;
    background: var(--text);
}

/* Main content */
.page-with-sidebar > main {
    grid-column: 2;
}

main {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    min-height: 200px;
}

/* About page */
.about-page {
    max-width: 800px;
}

.about-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    margin: 0 0 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.about-image-wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 1.5rem;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.about-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 8%;
    filter: brightness(1.15) contrast(1.05);
}

.about-bio {
    padding: 0.25rem 0 3rem;
    border-bottom: 1px solid var(--border);
}

.about-bio p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.about-bio p:last-child {
    margin-bottom: 0;
}

/* Works page */
.works-page {
    max-width: 800px;
}

.works-page-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    margin: 0 0 0.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.works-page-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 3rem;
}

.works-section {
    padding: 0 0 3rem;
}

.works-section:last-child {
    padding-bottom: 2rem;
}

.works-section-title {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 2rem;
    color: var(--text);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.work-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    transition: border-color 0.2s ease;
}

.work-card:hover {
    border-color: var(--text-muted);
}

.work-year {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.work-title {
    font-size: 0.95rem;
    font-weight: bold;
    margin: 0 0 0.35rem;
    line-height: 1.4;
}

.work-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.works-timeline {
    position: relative;
}

.works-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.work-event {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.work-event:last-child {
    border-bottom: none;
}

.work-event-year {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.15rem;
}

.work-event-content {
    padding-left: 0;
}

.work-event-title {
    font-size: 0.95rem;
    font-weight: bold;
    margin: 0 0 0.35rem;
}

.work-event-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.work-event-meta ol {
    margin: 0;
    padding-left: 1.25rem;
}

.work-event-meta li {
    margin-bottom: 0.25rem;
}

.work-event-meta li:last-child {
    margin-bottom: 0;
}

.works-videos-intro {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.works-videos-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.works-videos-link:hover {
    color: var(--text-muted);
}

.works-videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 3rem;
}

.work-video {
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--bg-subtle);
}

.work-video-frame {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.work-video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 640px) {
    .works-grid {
        grid-template-columns: 1fr;
    }

    .works-videos-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .work-event {
        grid-template-columns: 40px 1fr;
        gap: 1rem;
    }
}

/* Gallery page — same heading style as About / Works */
.gallery-page {
    padding: 3rem 2rem 0;
}

.gallery-page-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    margin: 0 auto 0.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    max-width: 800px;
}

.gallery-page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 auto 2rem;
    max-width: 800px;
}

.gallery-grid-wrap {
    padding: 2.5rem 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

.gallery-grid {
    max-width: 1600px;
    margin: 0 auto;
    column-count: 3;
    column-gap: 1.25rem;
}

.gallery-item {
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    break-inside: avoid;
    margin-bottom: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
    border-color: var(--text-muted);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* Gallery lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    min-width: 44px;
    min-height: 44px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-close:hover {
    opacity: 1;
}

.gallery-lightbox-inner {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--border);
    transition: opacity 0.2s ease;
}

.gallery-lightbox-img.gallery-lightbox-img--loading {
    opacity: 0.4;
}

@media (min-width: 1400px) {
    .gallery-grid {
        column-count: 4;
        column-gap: 1.5rem;
    }

    .gallery-item {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .gallery-grid-wrap {
        padding: 1.5rem 1rem 3rem;
    }

    .gallery-grid {
        column-count: 1;
        column-gap: 0.75rem;
    }

    .gallery-item {
        margin-bottom: 0.75rem;
    }

    .gallery-lightbox {
        padding: 1rem;
    }

    .gallery-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Hero — same look as before, with subtle entrance animation */
@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroPortraitReveal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero {
    text-align: center;
    padding: 4rem 0 5rem;
    border-bottom: 1px solid var(--border);
}

.hero-portrait {
    display: block;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    object-fit: cover;
    animation: heroPortraitReveal 0.7s ease-out both;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: bold;
    letter-spacing: 0.12em;
    margin: 0 0 0.5rem;
    animation: heroReveal 0.6s ease-out 0.12s both;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 1.8rem;
    letter-spacing: 0.2em;
    animation: heroReveal 0.6s ease-out 0.2s both;
}

.hero-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
    margin: 0 0 2rem;
}

.hero-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
    animation: heroReveal 0.5s ease-out both;
}

.hero-social-link:nth-child(1) { animation-delay: 0.3s; }
.hero-social-link:nth-child(2) { animation-delay: 0.36s; }
.hero-social-link:nth-child(3) { animation-delay: 0.42s; }
.hero-social-link:nth-child(4) { animation-delay: 0.48s; }
.hero-social-link:nth-child(5) { animation-delay: 0.54s; }
.hero-social-link:nth-child(6) { animation-delay: 0.6s; }

.hero-social-link:hover {
    color: var(--text);
    transform: translateY(-2px);
}

.hero-social-link--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.hero-social-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.hero-tagline {
    max-width: 540px;
    margin: 0 auto;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    animation: heroReveal 0.6s ease-out 0.4s both;
}

.hero-cv-btn {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.6rem 1.5rem;
    min-height: 44px;
    box-sizing: border-box;
    background-color: var(--text);
    color: var(--bg);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: opacity 0.2s ease;
    animation: heroReveal 0.6s ease-out 0.5s both;
    line-height: 1.4;
}

.hero-cv-btn:hover {
    opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
    .hero-portrait,
    .hero-title,
    .hero-subtitle,
    .hero-social-link,
    .hero-tagline,
    .hero-cv-btn {
        animation: none;
    }
}

/* Sections */
.section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 2rem;
    color: var(--text);
}

.section-text {
    margin: 0;
    color: var(--text-muted);
}

/* Experience */
.experience-item {
    margin-bottom: 2.5rem;
}

.experience-item:last-child {
    margin-bottom: 0;
}

.experience-item h3 {
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 0.25rem;
}

.experience-item .org {
    margin: 0 0 0.25rem;
}

.experience-item .org a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.experience-item .org a:hover {
    color: var(--text-muted);
}

.experience-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.experience-item ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.experience-item li {
    margin-bottom: 0.35rem;
}

.conference-list {
    margin-top: 0.5rem !important;
}

.conferences {
    font-size: 0.9rem;
    margin: 0.75rem 0 0.25rem !important;
    color: var(--text);
}

/* Certifications */
.cert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cert-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.cert-list li:last-child {
    border-bottom: none;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}

.skill-category h4 {
    font-size: 0.85rem;
    font-weight: bold;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.skill-category ul {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.skill-category li {
    margin-bottom: 0.25rem;
}

/* Honours */
.honours-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.honours-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.honours-list li:last-child {
    border-bottom: none;
}

/* Contact */
.contact-section {
    padding-bottom: 4rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.contact-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

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

/* Footer */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.site-footer p {
    margin: 0;
}

/* 404 / Error page — responsive */
.error-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}

.error-page-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    margin: 0 0 1rem;
}

.error-page-text {
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.error-page-btn {
    text-decoration: none;
}

/* Contact page — artistic layout */
.contact-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    position: relative;
}

/* Contact hero — cooler layout + animations */
@keyframes contactReveal {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-hero {
    text-align: center;
    padding: 2rem 2rem 3rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.contact-hero-logo-btn {
    display: block;
    margin: 0 auto 2.25rem;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.contact-hero-logo-btn:hover .contact-hero-logo,
.contact-hero-logo-btn:focus-visible .contact-hero-logo {
    opacity: 0.85;
}

.contact-hero-logo {
    display: block;
    height: clamp(3.5rem, 10vw, 5.5rem);
    width: auto;
    margin: 0;
    filter: invert(1); /* white on dark */
    transition: opacity 0.2s ease;
}

@media (prefers-color-scheme: light) {
    .contact-hero-logo {
        filter: none; /* black on light */
    }
}

.contact-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(255, 255, 255, 0.04) 0%, transparent 55%);
    pointer-events: none;
}

/* Logo pop-up card */
.logo-card-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.logo-card-overlay--open {
    opacity: 1;
    visibility: visible;
}

.logo-card {
    position: relative;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.logo-card-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-card-close:hover {
    opacity: 1;
}

.logo-card-img {
    display: block;
    height: 8rem;
    width: auto;
    margin: 0 auto 1.5rem;
    filter: invert(1);
}

@media (prefers-color-scheme: light) {
    .logo-card-img {
        filter: none;
    }
}

.logo-card-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
    margin: 0;
}

.contact-hero-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    animation: contactReveal 0.6s ease-out both;
}

.contact-hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: bold;
    letter-spacing: 0.06em;
    margin: 0 0 2.5rem;
    position: relative;
    animation: contactReveal 0.6s ease-out 0.1s both;
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.contact-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem 2rem;
    min-width: 200px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    animation: contactReveal 0.6s ease-out both;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
}

.contact-detail-card:nth-child(1) { animation-delay: 0.2s; }
.contact-detail-card:nth-child(2) { animation-delay: 0.3s; }

.contact-detail-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 0 0 1px var(--text-muted), 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.contact-detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
}

.contact-detail-value {
    font-size: 0.95rem;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.contact-detail-card:hover .contact-detail-value {
    color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    .contact-hero-label,
    .contact-hero-title,
    .contact-detail-card {
        animation: none;
    }
}

.contact-social-section {
    padding: 2.5rem 0 2rem;
    text-align: center;
}

.contact-social-intro {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    margin: 0 0 2.5rem;
}

.contact-social-orbit {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2rem;
    max-width: 520px;
    margin: 0 auto;
}

.contact-social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.75rem;
    min-width: 100px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-social-card:hover {
    color: var(--text);
    border-color: var(--text-muted);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.contact-social-card--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.contact-social-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.contact-social-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.contact-social-name {
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contact-social-name em {
    font-style: normal;
    font-size: 0.7em;
    opacity: 0.8;
}

.contact-decoration {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.contact-decoration-line {
    width: 1px;
    flex: 1;
    min-height: 120px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
    opacity: 0.6;
}

.contact-decoration-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
}

@media (max-width: 640px) {
    .contact-page {
        padding: 3rem 1.25rem 2.5rem;
    }

    .contact-hero {
        padding: 1.5rem 1rem 2.5rem;
    }

    .contact-detail-card {
        min-width: 100%;
        padding: 1rem 1.5rem;
    }

    .contact-social-orbit {
        gap: 1rem;
    }

    .contact-social-card {
        padding: 1.25rem 1.5rem;
        min-width: 88px;
    }

    .contact-decoration {
        display: none;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .page-with-sidebar {
        grid-template-columns: 1fr;
        padding: 0 1.25rem;
    }

    .side-nav {
        display: none;
    }

    .page-with-sidebar > main {
        grid-column: 1;
    }

    main {
        padding: 2rem 1.25rem 3rem;
    }

    .site-header {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .nav {
        grid-column: 1;
        justify-self: stretch;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .nav-toggle {
        display: flex;
        order: 2;
    }

    .nav-brand {
        order: 1;
    }

    .nav-links {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav.nav--open .nav-links {
        display: flex;
    }

    .nav.nav--open .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav.nav--open .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .nav.nav--open .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-link {
        font-size: 0.95rem;
    }

    .nav-num {
        display: none;
    }

    .hero-title {
        letter-spacing: 0.1em;
    }

    .section-title {
        letter-spacing: 0.15em;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .about-title,
    .gallery-page-title {
        font-size: 1.25rem;
        letter-spacing: 0.12em;
    }

    .error-page {
        padding: 3rem 1.25rem 4rem;
    }

    .error-page-title {
        font-size: 1.25rem;
    }
}
