/* Audio Engineer Portfolio Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* Space for fixed header */
}

/* Fixed Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* Fixed height */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth animation */
}

.header-content {
    flex: 1;
    text-align: left;
}

.header-content h1 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 300;
    letter-spacing: -0.5px;
    color: #000;
    margin-bottom: 0;
}

/* Make the header name look like regular text (not a link) */
.header-content h1 a {
    color: inherit;
    text-decoration: none;
}

.header-content h1 a:hover {
    color: inherit;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav li a {
    text-decoration: none;
    color: #333;
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    font-weight: 300;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.main-nav li a:hover {
    color: #000;
}

/* Hover effect - underline */
.main-nav li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #000;
    transition: width 0.3s ease;
}

.main-nav li a:hover::after {
    width: 100%;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* Hero section */
.hero {
    margin-bottom: 1.5rem; /* Reduced spacing */
    text-align: center;
    padding: 1rem 0; /* Reduced padding */
}

.hero h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem; /* Reduced spacing */
    color: #000;
}

/* Removed subtitle paragraph
.hero p {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: #666;
    font-weight: 300;
}
*/

/* Featured projects section */
.featured-projects {
    width: 100%;
    margin: 2rem 0; /* Adjusted spacing */
}

.featured-projects h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    margin-bottom: 1.5rem; /* Reduced spacing */
    color: #000;
    text-align: center;
}

/* Tabs: a pill-shaped segmented control that sticks below the header */
.tabs {
    position: sticky;
    top: 70px; /* header height while the header is showing */
    z-index: 900;
    width: 100%;
    align-self: stretch;
    margin: 1rem 0 2rem;
    padding: 0.6rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: top 0.3s ease;
}

body.header-hidden .tabs {
    top: 0;
}

.tabs ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.3rem;
    background: #f0f0f0;
    border-radius: 999px;
}

.tab-link {
    display: block;
    text-decoration: none;
    color: #666;
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    white-space: nowrap;
    text-align: center;
    transition: background 0.25s ease, color 0.25s ease;
}

.tab-link:hover {
    color: #000;
}

.tab-link.active {
    background: #000;
    color: #fff;
}

.tab-link:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.tab-short {
    display: none;
}

/* Tab content */
.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active.from-right {
    animation: slideFromRight 0.35s ease-out;
}

.tab-content.active.from-left {
    animation: slideFromLeft 0.35s ease-out;
}

@keyframes slideFromRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: none; }
}

@keyframes slideFromLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Project grid - Enhanced responsive design */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(220px, 30vw, 280px), 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
    margin: 1rem 0; /* Reduced spacing */
    width: 100%;
}

/* Project card styling with enhanced layout */
.project-card {
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

a.project-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.project-card:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Album cover styling */
.album-cover {
    position: relative;
    overflow: hidden;
    height: clamp(250px, 35vw, 320px);
    width: 100%;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .album-cover img {
    transform: scale(1.08);
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: clamp(1rem, 2vw, 1.2rem);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    text-align: center;
    backdrop-filter: blur(2px);
}

.project-card:hover .cover-overlay {
    transform: translateY(0);
}

.project-title {
    font-weight: 500;
    display: block;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Released music: streaming service buttons appear over the cover on hover
   (on touch screens, the first tap on a card shows them) */
.release-card {
    cursor: default;
}

.release-card:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

.stream-links {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding-bottom: 3rem; /* sit above the title bar */
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.release-card:is(:focus-visible, :has(:focus-visible)) .stream-links,
.release-card.show-links .stream-links {
    opacity: 1;
    pointer-events: auto;
}

/* Title bar: same frosted glass as the streaming buttons */
.release-card .cover-overlay {
    z-index: 2;
    background: rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.release-card.show-links .cover-overlay,
.release-card:is(:focus-visible, :has(:focus-visible)) .cover-overlay {
    transform: translateY(0);
}

/* Just the logos, divided by thin vertical lines */
.stream {
    display: grid;
    place-items: center;
    padding: 0.4rem clamp(0.9rem, 2.5vw, 1.25rem);
    color: #fff;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.stream + .stream {
    border-left: 1px solid rgba(255,255,255,0.5);
}

.stream:nth-child(2) { transition-delay: 0.05s; }
.stream:nth-child(3) { transition-delay: 0.1s; }

.release-card:is(:focus-visible, :has(:focus-visible)) .stream,
.release-card.show-links .stream {
    transform: none;
    opacity: 1;
}

/* Mouse hover (phones would keep a "sticky" hover after a tap, so they use
   the tap-to-show class instead) */
@media (hover: hover) {
    .release-card:hover .stream-links {
        opacity: 1;
        pointer-events: auto;
    }
    .release-card:hover .stream {
        transform: none;
        opacity: 1;
    }
}

.stream svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    opacity: 0.85;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.stream:hover svg,
.stream:focus-visible svg {
    opacity: 1;
    transform: scale(1.15);
}

.stream:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .stream { transform: none; transition: opacity 0.2s ease; }
}

/* Content sections */
.content {
    margin: 1rem 0; /* Reduced spacing */
    max-width: clamp(600px, 80vw, 900px);
}

.content h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    margin-bottom: 1rem; /* Reduced spacing */
    color: #000;
}

.content p {
    margin-bottom: 1rem; /* Reduced spacing */
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    line-height: 1.7;
}

.content ul {
    list-style: none;
    text-align: left;
    margin: 1.5rem 0; /* Adjusted spacing */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 25vw, 200px), 1fr));
    gap: clamp(0.8rem, 2vw, 1rem);
}

.content li {
    padding: clamp(0.6rem, 1.5vw, 0.8rem) clamp(1rem, 2vw, 1.2rem);
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

/* Contact info */
.contact-info {
    margin: 1rem 0; /* Reduced spacing */
}

.contact-info p {
    margin: 0.8rem 0; /* Reduced spacing */
    font-size: clamp(1rem, 1.8vw, 1.1rem);
}

.social-links {
    margin: 1rem 0; /* Reduced spacing */
}

.social-links a {
    text-decoration: none;
    color: #333;
    margin: 0 clamp(0.5rem, 1.5vw, 0.8rem);
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-size: clamp(1rem, 1.8vw, 1.1rem);
}

.social-links a:hover {
    color: #000;
}

/* Form styling */
.contact-form {
    margin: 1rem 0; /* Reduced spacing */
    text-align: left;
    max-width: clamp(400px, 70vw, 600px);
}

.form-group {
    margin-bottom: 1rem; /* Reduced spacing */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: clamp(0.8rem, 1.5vw, 1rem);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: clamp(1rem, 1.5vw, 1rem);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000;
}

button {
    background: #000;
    color: white;
    border: none;
    padding: clamp(1rem, 2vw, 1.5rem) clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

button:hover {
    background: #333;
    transform: translateY(-2px);
}

button:disabled {
    background: #666;
    cursor: wait;
    transform: none;
}

/* Contact form spam trap + status line */
.botcheck {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-status {
    margin-top: 1rem;
    min-height: 1.5em;
    font-size: 0.95rem;
}

.form-status.success { color: #1a7f37; }
.form-status.error { color: #c0392b; }

/* Footer */
.main-footer {
    background: #f8f8f8;
    padding: 1rem 0; /* Reduced padding */
    color: #999;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    border-top: 1px solid #eee;
    margin-top: auto;
    text-align: center;
}

/* Responsive design with enhanced responsiveness */
@media (max-width: 1400px) {
    .container {
        padding: 1.5rem;
    }

    .project-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .hero h2 {
        font-size: 2.5rem;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .hero h2 {
        font-size: 2.2rem;
    }

    .main-nav ul {
        gap: 1rem;
    }

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-top: 80px; /* Extra space for header on mobile */
    }

    .main-header {
        padding: 0.8rem 1rem;
        height: 60px;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .main-nav ul {
        gap: 0.8rem;
    }

    .main-nav li a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    /* Removed subtitle paragraph
    .hero p {
        font-size: 1.1rem;
    }
    */

    .featured-projects h3 {
        font-size: 1.6rem;
    }

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

@media (max-width: 576px) {
    body {
        padding-top: 60px; /* Less space for header on very small screens */
    }

    .container {
        padding-top: 70px;
    }

    .main-header {
        height: 55px;
        padding: 0.6rem 1rem;
    }

    .header-content h1 {
        font-size: 1.3rem;
    }

    .main-nav li a {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    /* Removed subtitle paragraph
    .hero p {
        font-size: 1rem;
    }
    */

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

    .content h3 {
        font-size: 1.4rem;
    }

    .content ul {
        grid-template-columns: 1fr;
    }
}
/* ===== Personal Projects: category dropdowns + audio player ===== */
.project-categories {
    width: 100%;
    max-width: 820px;
    margin: 1rem auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category {
    background: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.category summary {
    list-style: none;
    cursor: pointer;
    padding: 1.1rem 1.5rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 400;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.category summary::-webkit-details-marker { display: none; }

.category summary::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 1.5px solid #333;
    border-bottom: 1.5px solid #333;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.category[open] summary::after { transform: rotate(-135deg); }

.category summary:hover { background: #f0f0f0; }

.category summary:focus-visible {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.track-list {
    list-style: none;
    padding: 0 1.5rem 0.75rem;
}

.track {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid #e6e6e6;
}

.play-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* play triangle */
.play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #000;
}

/* pause bars */
.track.playing .play-btn::before {
    left: 50%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 15px;
    border: none;
    border-left: 3px solid #000;
    border-right: 3px solid #000;
}

/* external link arrow */
.track.is-link .play-btn::before {
    left: 46%;
    top: 54%;
    width: 9px;
    height: 9px;
    border-width: 1.5px 1.5px 0 0;
    border-color: #000;
    transform: translate(-50%, -50%) rotate(0deg);
}

.play-btn:hover {
    opacity: 1;
    transform: scale(1.12);
}

.play-btn:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
    border-radius: 3px;
}

.track-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.track-title {
    color: #000;
    font-weight: 500;
}

.track-desc {
    color: #777;
    font-size: 0.9rem;
}

.track-progress {
    margin-top: 0.45rem;
    height: 4px;
    background: #e2e2e2;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.track-progress::before {          /* bigger click target */
    content: '';
    position: absolute;
    inset: -8px 0;
}

.track-progress-fill {
    height: 100%;
    width: 0;
    background: #000;
    border-radius: 2px;
}

.track.is-link .track-progress { display: none; }

.track-time {
    color: #777;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    min-width: 3.2rem;
    text-align: right;
}

.track.error .track-time { color: #b33; }

/* Video rows: the Vimeo player expands underneath the row */
.track.is-video { flex-wrap: wrap; }

.track-video {
    flex-basis: 100%;
    position: relative;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.track-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* open video -> close (x) icon */
.track.is-video.open .play-btn::before,
.track.is-video.open .play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    border: none;
    background: #000;
    transform: translate(-50%, -50%) rotate(45deg);
}

.track.is-video.open .play-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 576px) {
    .category summary { padding: 1rem; }
    .track-list { padding: 0 1rem 0.5rem; }
    .track { gap: 0.75rem; }
}

/* Graphic Design cards (open a gallery) */
button.project-card {
    font: inherit;
    color: inherit;
    text-align: left;
    border: 0;
    padding: 0;
    width: 100%;
    cursor: pointer;
}

/* Override the site-wide dark button:hover so the card stays light */
button.project-card:hover {
    background: #f8f8f8;
    color: inherit;
}

button.project-card:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

.design-card p {
    padding: 0.8rem 1rem 1rem;
    font-size: 0.95rem;
    color: #555;
}

.image-count {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    pointer-events: none;
}

/* Gallery: full-screen, scrollable grid of a project's images */
.lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #111;
    color: #fff;
    overflow: hidden;
}

.lightbox:focus {
    outline: none;
}

.lightbox[open] {
    display: flex;
    flex-direction: column;
}

.lightbox::backdrop {
    background: rgba(0,0,0,0.6);
}

.lightbox-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem 0.8rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.lightbox-title {
    font-weight: 500;
    font-size: 1.05rem;
}

.lightbox-counter {
    color: #aaa;
    font-size: 0.9rem;
}

.lightbox-close {
    margin-left: auto;
    background: none;
    border: 0;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0.15em;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.12);
    transform: none;
}

.lightbox-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lightbox-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1rem, 3vw, 2rem);
}

.lightbox-grid:focus {
    outline: none;
}

.lightbox-cols {
    columns: 2;
    column-gap: clamp(0.75rem, 2vw, 1.25rem);
    max-width: 1500px;
    margin: 0 auto;
}

.lightbox-cols.single {
    columns: 1;
    max-width: 1000px;
}

.lightbox-cols img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
    break-inside: avoid;
    border-radius: 4px;
    background: #1c1c1c;
}

@media (max-width: 700px) {
    .lightbox-grid {
        padding: 1rem;
    }
    .lightbox-cols {
        columns: 1;
    }
}

/* Link styled like the site's buttons (e.g. "View my work" on the home page) */
a.button-link {
    display: inline-block;
    margin-top: 1.5rem;
    background: #000;
    color: #fff;
    text-decoration: none;
    padding: clamp(0.8rem, 1.6vw, 1rem) clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
}

a.button-link:hover {
    background: #333;
    color: #fff;
    transform: translateY(-2px);
}

a.button-link:focus-visible {
    outline: 2px solid #000;
    outline-offset: 3px;
}

/* Track is downloading before it plays: pulse the play button */
.track.loading .play-btn {
    animation: track-loading 0.9s ease-in-out infinite alternate;
    cursor: progress;
}

@keyframes track-loading {
    from { opacity: 0.85; }
    to { opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
    .track.loading .play-btn {
        animation: none;
        opacity: 0.4;
    }
}

/* Tabs on phones: one full-width row with short labels */
@media (max-width: 768px) {
    .tabs {
        top: 60px; /* mobile header height */
        margin: 0.5rem 0 1.25rem;
    }
}

@media (max-width: 576px) {
    .tabs ul {
        width: 100%;
    }
    .tabs li {
        flex: 1;
    }
    .tab-link {
        padding: 0.6rem 0.5rem;
        font-size: 0.95rem;
    }
    .tab-full {
        display: none;
    }
    .tab-short {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tab-content.active,
    .tab-content.active.from-right,
    .tab-content.active.from-left {
        animation: none;
    }
}

/* Page transitions between Home / Work / Contact (Chrome, Edge, Safari 18.2+;
   other browsers simply switch pages as before) */
@view-transition {
    navigation: auto;
}

/* Keep the header still while the page content changes */
.main-header {
    view-transition-name: site-header;
}

::view-transition-old(root) {
    animation: page-out 0.2s ease-in both;
}

::view-transition-new(root) {
    animation: page-in 0.35s ease-out both;
}

@keyframes page-out {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}

/* ===== Home page: video hero + scroll story ===== */
.home {
    flex: 1;
    width: 100%;
}

.home-hero {
    position: relative;
    height: calc(100svh - 70px);
    min-height: 420px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    /* first frame of the video shows while it downloads */
    background: #111 url("../images/home/hero-poster.jpg") center / cover no-repeat;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-video.ready {
    opacity: 1;
}

/* Darkens the video slightly so the name stays readable */
.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}

.hero-overlay {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 18px rgba(0,0,0,0.45);
    text-align: center;
    padding: 0 1.5rem;
    animation: hero-in 1s ease-out both;
}

.hero-name {
    font-size: clamp(2.6rem, 9vw, 7rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #fff;
    margin: 0;
}

.hero-role {
    margin-top: 1rem;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
}

/* Contact button under the name: frosted glass to sit on the video */
.hero-contact {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.75rem 1.6rem;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.hero-contact:hover,
.hero-contact:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #000;
    outline: none;
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(16px); }
}

.scroll-cue {
    position: absolute;
    z-index: 1;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.scroll-cue::after {
    content: '';
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), transparent);
    animation: scroll-cue 1.8s ease-in-out infinite;
    transform-origin: top;
}

@keyframes scroll-cue {
    0% { transform: scaleY(0); opacity: 1; }
    60% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
}

/* Scroll story: text steps scroll by on the left while a framed photo
   sticks on the right and changes with the step in view. */
.story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 6rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.story-media {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding-top: 70px; /* clear the header */
    perspective: 1200px;
}

.story-frame {
    position: relative;
    width: 100%;
    max-width: 30rem;
    aspect-ratio: 4 / 5;
    max-height: calc(100svh - 70px - 7rem);
    margin-left: auto;
    border-radius: 14px;
    overflow: hidden;
    background: #eee;
    box-shadow: 0 30px 60px -25px rgba(0,0,0,0.35);
    transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.4s ease-out;
}

/* Each photo wipes up over the one before it; scrolling back wipes it down */
.story-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(100% 0 0 0);
    transform: scale(1.15);
    transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-img.shown {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
}

.story-img:first-child {
    clip-path: inset(0 0 0 0);
}

.story-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 30rem;
    margin-left: auto;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: #777;
    font-variant-numeric: tabular-nums;
}

.story-current {
    color: #000;
}

.story-bar {
    flex: 1;
    height: 2px;
    background: #e5e5e5;
    overflow: hidden;
}

.story-bar span {
    display: block;
    height: 100%;
    background: #000;
    transform-origin: left;
    transform: scaleX(var(--progress, 0));
}

.story-steps {
    grid-column: 1;
    grid-row: 1;
}

.story-step {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 70px;
    opacity: 0.18;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Less empty space after the last step, so "Keep scrolling" follows closely */
.story-step:last-child {
    min-height: 90svh;
    justify-content: flex-end;
    padding-bottom: 25svh;
}

.story-step.active {
    opacity: 1;
    transform: none;
}

.story-num {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    color: #888;
    margin-bottom: 0.75rem;
}

.story-step h3 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

.story-step p {
    max-width: 26rem;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    color: #444;
    margin: 0;
}

/* "Hear the results" clip buttons in the story */
.showcase {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
}

.showcase-btn,
.showcase-btn:hover {
    --p: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem 0.6rem 0.9rem;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    overflow: hidden;
    transform: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.showcase-btn:hover,
.showcase-btn.playing {
    background: #000;
    color: #fff;
}

/* thin bar along the bottom showing how far the clip has played */
.showcase-btn::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: currentColor;
    opacity: 0.6;
    transform-origin: left;
    transform: scaleX(var(--p));
}

/* play triangle, which becomes a pause sign while playing */
.showcase-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent currentColor;
}

.showcase-btn.playing .showcase-icon {
    width: 8px;
    height: 10px;
    border: 0;
    border-left: 3px solid currentColor;
    border-right: 3px solid currentColor;
}

.showcase-btn.loading .showcase-icon {
    animation: showcase-pulse 0.9s ease-in-out infinite;
}

@keyframes showcase-pulse {
    50% { opacity: 0.3; }
}

.showcase-label {
    font-size: 0.85rem;
    color: #666;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.showcase.active .showcase-label {
    opacity: 1;
    transform: none;
}

.showcase-btn.error .showcase-text::after {
    content: ' (unavailable)';
}

/* Credit line: same look as the song name, on its own line, shown only
   while the clip plays */
.story-credit {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: -0.25rem;
    font-size: 0.85rem;
    color: #666;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.showcase.active .story-credit {
    opacity: 1;
    transform: none;
}

.credit-star {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Star-bulleted list under a step's text */
.story-list {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    max-width: 26rem;
}

.story-list li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    line-height: 1.5;
    color: #222;
}

.story-list li + li {
    margin-top: 0.5rem;
}

.story-list .credit-star {
    position: relative;
    top: 1px;
}

/* Phones/tablets: photo sticks at the top, text scrolls up underneath it */
@media (max-width: 768px) {
    .story {
        display: block;
        padding: 60px 1rem 0; /* room for the white strip above the photo */
    }
    .story-media {
        z-index: 2;
        height: auto;
        padding: 0.75rem 0 0.6rem;
        background: #fff;
        /* slides down out of the header's way when it reappears (scrolling up);
           moving the sticky offset doesn't shift the rest of the page */
        top: 60px;
        transition: top 0.3s ease;
        perspective: none;
        gap: 0.6rem;
    }
    body.header-hidden .story-media {
        top: 0;
    }
    /* Each text step snaps into place just below the photo. "proximity" only
       snaps when you stop near a step, so the rest of the page scrolls freely. */
    html:has(.story) {
        scroll-snap-type: y proximity;
    }
    .story-step {
        scroll-snap-align: start;
        /* header + sticky photo + counter: a fixed value (not tied to the
           header showing/hiding) so snapping never bounces */
        scroll-margin-top: calc(42svh + 112px);
    }
    /* white strip above the photo, so text scrolling underneath doesn't
       peek through the gap while the photo is moved down */
    .story-media::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 60px;
        background: #fff;
    }
    .story-frame {
        max-width: none;
        aspect-ratio: auto;
        height: 42svh;
        max-height: none;
        border-radius: 10px;
        transform: none;
    }
    .story-meter {
        max-width: none;
    }
    .story-step {
        min-height: 55svh;
        justify-content: flex-start;
        padding: 2rem 0.25rem 0;
    }
    .story-step:last-child {
        min-height: 55svh;
        justify-content: flex-start;
        padding-bottom: 15svh;
    }
}

/* Keep scrolling → Work page. The section is taller than the screen; its
   content sticks while --p (0 → 1, set by js/main.js) tracks your scroll. */
.home-next {
    --p: 0;
    position: relative;
    height: 170svh;
}

.home-next-inner {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0 1.5rem;
    text-align: center;
}

.home-next-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #000;
    text-decoration: none;
}

.home-next-title {
    max-width: 14em;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    opacity: calc(0.35 + 0.65 * var(--p));
    transform: translateY(calc((1 - var(--p)) * 40px)) scale(calc(0.94 + 0.06 * var(--p)));
}

.home-next-link:hover .home-next-title {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.15em;
}

.home-next-meter {
    width: min(18rem, 70vw);
    height: 2px;
    background: #e5e5e5;
    overflow: hidden;
}

.home-next-meter span {
    display: block;
    height: 100%;
    background: #000;
    transform-origin: left;
    transform: scaleX(var(--p));
}

.home-next-arrow {
    width: 14px;
    height: 14px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(45deg);
    animation: next-bob 1.6s ease-in-out infinite;
}

@keyframes next-bob {
    0%, 100% { transform: translateY(-4px) rotate(45deg); opacity: 0.4; }
    50% { transform: translateY(4px) rotate(45deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-overlay,
    .scroll-cue::after,
    .home-next-arrow {
        animation: none;
    }
    .home-next-title {
        transform: none;
    }
    .story-img,
    .story-step,
    .story-frame {
        transition: none;
        transform: none;
    }
}

/* Keep the header on one line on small phones: name left, links right */
.header-content {
    min-width: 0;
}

.header-content h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-nav {
    flex-shrink: 0;
}

.main-nav ul {
    flex-wrap: nowrap;
}

@media (max-width: 420px) {
    .header-content h1 {
        font-size: 1.15rem;
    }
    .main-nav ul {
        gap: 0.25rem;
    }
    .main-nav li a {
        padding: 0.4rem 0.5rem;
    }
}
