/* MAGU — Mar Aguilar Serrats
   Design tokens, layout, and components. No third-party CSS runtime. */

:root {
    --gold: #f6c25c;
    --gold-deep: #c9952e;
    --blue: #5c7a9d;
    --blue-dark: #3e5a78;
    --ink: #161616;
    --muted: #5a5a5a;
    --paper: #f3f0ea;
    --paper-2: #e8e3d9;
    --white: #fffcf8;
    --line: rgba(22, 22, 22, 0.08);
    --nav-bg: rgba(14, 14, 14, 0.72);
    --shadow: 0 18px 50px rgba(22, 22, 22, 0.08);
    --shadow-hover: 0 28px 60px rgba(22, 22, 22, 0.14);
    --radius: 22px;
    --radius-sm: 14px;
    --font: "Space Grotesk", system-ui, sans-serif;
    --header-h: 76px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

html,
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video {
    max-width: 100%;
    display: block;
}

video {
    height: auto;
}

picture {
    width: 100%;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keep intrinsic aspect ratio when width is constrained.
   HTML width/height are hints only; without height:auto the
   height attribute becomes the used CSS height and images stretch. */
img {
    max-width: 100%;
    height: auto;
}
picture {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -120px;
    z-index: 100000;
    background: var(--ink);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 16px;
    color: var(--white);
}

/* Icons */
.icon {
    width: 1.15em;
    height: 1.15em;
    fill: currentColor;
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

/* Layout */
.wrap,
.wrap--s,
.wrap--m,
.wrap--wide {
    margin-inline: auto;
}
.wrap { width: min(1180px, calc(100% - 48px)); }
.wrap--s { width: min(760px, calc(100% - 48px)); }
.wrap--m { width: min(920px, calc(100% - 48px)); }
.wrap--wide { width: min(1400px, calc(100% - 48px)); }

.section {
    padding: 88px 0;
}

.section--tight {
    padding: 48px 0 88px;
}

.section--bottom {
    padding: 0 0 112px;
}

.lede {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    line-height: 1.75;
    color: var(--muted);
    text-align: center;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 48px;
}

.category-title {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    text-align: center;
}

/* Header / nav */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 28px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
    min-width: 0;
    z-index: 1002;
}

.nav-brand img {
    height: 30px;
    width: auto;
}

.nav-brand-name {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--gold);
}

.nav-menu a.active {
    background: rgba(246, 194, 92, 0.12);
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    z-index: 1002;
}

.lang-switch {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.lang-switch button {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    min-width: 40px;
}

.lang-switch button[aria-pressed="true"] {
    background: var(--gold);
    color: var(--ink);
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    color: var(--white);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Hero (home) */
.hero-video {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #111;
}

.hero-video video,
.hero-video .hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-video .overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(820px, calc(100% - 40px));
    padding: 52px 56px 48px;
    text-align: center;
    border-radius: 32px;
    background: rgba(8, 8, 8, 0.58);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    animation: heroReveal 0.9s var(--ease);
}

.hero-avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    margin: 0 auto 22px;
    background: #222;
}

.hero-logo {
    width: min(420px, 100%);
    margin: 0 auto;
}

.hero-subtitle {
    margin-top: 22px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

.hero-description {
    margin-top: 16px;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.45;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.btn,
.hero-button {
    margin-top: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.82rem;
    text-decoration: none;
    border: 0;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}

.btn:hover,
.hero-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(246, 194, 92, 0.28);
    background: #ffd57a;
}

@keyframes heroReveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

/* About */
.about {
    text-align: center;
}

.about h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}

/* Portfolio cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.portfolio-card,
.project-card,
.animation-card,
.contact-box {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.portfolio-card:hover,
.project-card:hover,
.animation-card:hover,
.contact-box:hover,
.project-link:hover .project-card {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.portfolio-card .card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--paper-2);
}

.portfolio-card .card-media img,
.portfolio-card .card-media picture,
.portfolio-card .card-media picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.portfolio-card:hover .card-media img {
    transform: scale(1.06);
}

.portfolio-card .card-body,
.animation-card .card-body {
    padding: 22px 22px 26px;
}

.portfolio-card h3,
.animation-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 12px;
}

.portfolio-card p,
.animation-card p,
.project-card p {
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.65;
}

.tag,
.project-tags span,
.hero-label {
    display: inline-flex;
    align-items: center;
    background: rgba(92, 122, 157, 0.1);
    color: var(--blue-dark);
    border: 1px solid rgba(92, 122, 157, 0.22);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* Skills */
.skills-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.skills-grid span {
    background: var(--white);
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--blue-dark);
}

/* Footer */
footer {
    background: #111;
    color: var(--white);
    padding: 72px 0 56px;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 22px;
}

.socials a {
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.socials a .icon {
    width: 18px;
    height: 18px;
}

.socials a:hover {
    color: var(--gold);
    border-color: var(--gold);
    transform: translateY(-2px);
}

footer p {
    text-align: center;
}

.footer-small {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.9rem;
}

.footer-dev {
    margin-top: 28px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.footer-dev a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.25s, outline-color 0.25s;
}

.footer-dev a:hover,
.footer-dev a:focus-visible {
    color: rgba(255, 255, 255, 0.9);
}

.footer-dev a:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

/* Page heroes */
.page-hero {
    position: relative;
    min-height: 58vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 160px 28px 100px;
    color: var(--white);
    background-color: #1a1a1a;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.55)),
        image-set(
            url("../images/Art/art-header.webp") type("image/webp"),
            url("../images/Art/art-header.jpg") type("image/jpeg")
        );
    background-size: cover;
    background-position: center;
}

.page-hero h1 {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-top: 14px;
    text-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.page-hero p {
    max-width: 640px;
    margin: 20px auto 0;
    font-size: 1.15rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.page-hero .hero-label {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

/* Project cards (story pages) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.project-card {
    position: relative;
    overflow: visible;
}

.project-card > a,
.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-image,
.project-card > picture,
.project-card > img:not(.wip-tag),
.project-card .project-image,
.project-card picture:not(.wip-tag) img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius) var(--radius) 0 0;
}

.project-card .card-body {
    padding: 28px;
}

.project-card h3 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 12px 0 10px;
}

.project-card .wip-tag,
.wip-tag {
    position: absolute;
    top: -16px;
    left: -18px;
    width: 72px;
    height: auto;
    z-index: 4;
    transform: rotate(-14deg);
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Animation */
.featured-video {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    background: #111;
}

.featured-video video {
    width: 100%;
}

.video-description {
    text-align: center;
    margin-top: 18px;
    color: var(--muted);
}

.anim-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.animation-card video {
    width: 100%;
    background: #111;
}

/* Phone showcase */
.phone-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 56px;
}

.phone-project {
    max-width: 360px;
    text-align: center;
}

.phone-showcase {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 36px;
    overflow: hidden;
}

.phone-showcase::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(rgba(92, 122, 157, 0.16), transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}

.phone-frame {
    position: relative;
    z-index: 1;
    width: 280px;
    padding: 10px;
    border-radius: 36px;
    background: linear-gradient(145deg, #2c2c2c, #0f0f0f);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.phone-frame video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 28px;
    display: block;
    background: #000;
}

.phone-content { margin-top: 20px; }
.phone-content h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.phone-content p { color: var(--muted); line-height: 1.7; }

/* Art gallery */
.gallery-container {
    width: min(1500px, calc(100% - 48px));
    margin: auto;
    padding: 72px 0 120px;
}

.gallery {
    columns: 4 260px;
    column-gap: 20px;
}

.gallery figure {
    break-inside: avoid;
    margin: 0 0 20px;
}

.gallery button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.gallery button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
}

.gallery picture {
    display: block;
    width: 100%;
}

/* Character lineup (Entre Mesas visual development) */
.gallery--portraits {
    columns: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 28px 32px;
    max-width: 1100px;
    margin-inline: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 48px 40px 36px;
    box-shadow: var(--shadow);
}
.gallery--portraits figure {
    margin: 0;
    width: auto;
    flex: 0 1 auto;
}
.gallery--portraits button {
    width: auto;
    background: transparent;
    box-shadow: none;
    cursor: zoom-in;
}
.gallery--portraits button:hover {
    transform: translateY(-4px);
    box-shadow: none;
}
.gallery--portraits img {
    width: auto;
    height: auto;
    max-height: 520px;
    max-width: min(240px, 100%);
    object-fit: contain;
    border-radius: 16px;
    margin-inline: auto;
}
@media (max-width: 700px) {
    .gallery--portraits {
        padding: 28px 20px 24px;
        gap: 24px 16px;
        max-width: 100%;
    }
    .gallery--portraits figure {
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
    .gallery--portraits img {
        max-height: 420px;
        max-width: 100%;
    }
}

/* Lightbox */
#lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 20000;
    background: rgba(6, 6, 6, 0.94);
    padding: 24px;
}

#lightbox.is-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#lightbox figure {
    margin: 0;
    max-width: min(1200px, 100%);
    text-align: center;
}

#lightbox img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 78vh;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

#lightbox figcaption {
    color: rgba(255, 255, 255, 0.82);
    margin-top: 16px;
    font-weight: 500;
}

.lb-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-btn:hover { background: rgba(246, 194, 92, 0.25); color: var(--gold); }

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Mayra / project pages */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.project-title {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.project-title span {
    display: block;
    color: var(--blue);
}

.project-subtitle {
    margin-top: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--blue-dark);
}

.project-description {
    margin-top: 24px;
    line-height: 1.85;
    color: var(--muted);
}

.project-description p + p { margin-top: 1em; }

.project-feature-image,
.rounded-media img,
.rounded-media picture img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
}

.rounded-media button[data-lightbox] {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    cursor: zoom-in;
}
.rounded-media button[data-lightbox] img {
    box-shadow: none;
    border-radius: 0;
    transition: transform 0.45s var(--ease);
}
.rounded-media button[data-lightbox]:hover img {
    transform: scale(1.03);
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.episode-card {
    background: var(--white);
    padding: 26px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform 0.3s var(--ease);
}

.episode-card:hover { transform: translateY(-4px); }

.episode-card h3 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--blue);
}

.episode-card h4 { margin-top: 8px; font-weight: 700; }
.episode-card p { margin-top: 12px; color: var(--muted); line-height: 1.7; }

.project-gallery {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto 112px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-gallery button,
.gallery-item {
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    border-radius: 18px;
    overflow: hidden;
}

.project-gallery .gallery-featured {
    display: block;
    width: 100%;
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.project-gallery .gallery-featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.project-gallery .gallery-mosaic {
    columns: 2 300px;
    column-gap: 20px;
}

.project-gallery .gallery-mosaic button {
    display: block;
    width: 100%;
    margin: 0 0 20px;
    break-inside: avoid;
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.project-gallery .gallery-mosaic button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.project-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    transition: transform 0.3s var(--ease);
}

.teaser-section {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto 112px;
}

.teaser-content {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    align-items: stretch;
    background: var(--white);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.teaser-media,
.teaser-content > button[data-lightbox] {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    background: var(--paper-2);
    padding: 0;
    border: 0;
    width: 100%;
    cursor: zoom-in;
}
.teaser-image,
.teaser-content picture,
.teaser-content img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.teaser-text { padding: 48px; }
.teaser-text h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 10px;
}
.teaser-text p { margin-top: 16px; color: var(--muted); line-height: 1.75; }
.teaser-credit { margin-top: 24px; font-size: 0.95rem; color: #8a8a8a; }

.project-hero { padding-top: var(--header-h); background: var(--paper-2); }
.project-hero .banner {
    width: min(1400px, 100%);
    margin: 0 auto;
}
.project-hero .banner img { width: 100%; height: auto; display: block; }

.note-card {
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 56px 40px;
    text-align: center;
}

.note-card h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.03em;
    margin-top: 10px;
}

.note-card p { margin-top: 20px; color: var(--muted); max-width: 640px; margin-inline: auto; }
.note-card .credit {
    margin-top: 22px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9a9a9a;
}

.italic { font-style: italic; color: var(--muted); }
.stack > * + * { margin-top: 1.15em; }
.kicker { margin-bottom: 8px; }

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 64px;
    align-items: center;
}

.contact-photo img,
.contact-photo picture img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 18px 40px rgba(22, 22, 22, 0.14);
    background: #e8e4dc;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.contact-info h2 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0;
    line-height: 1.1;
}

.contact-role {
    font-size: 1.05rem;
    color: var(--blue);
    font-weight: 600;
}

.contact-description {
    line-height: 1.85;
    color: var(--muted);
    max-width: 640px;
}

.availability-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #eef8f0;
    color: #2d7a36;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
}

.availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2d7a36;
    box-shadow: 0 0 0 4px rgba(45, 122, 54, 0.18);
    flex-shrink: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.contact-box {
    padding: 36px 22px;
    text-align: center;
}

.contact-box .icon {
    width: 28px;
    height: 28px;
    margin: 0 auto 14px;
    color: var(--blue);
}

.contact-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.contact-box p { color: var(--muted); }

.split-text p,
.prose p {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #444;
}

.split-text h1 {
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    letter-spacing: -0.04em;
    margin: 8px 0 12px;
}

/* Reveals */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Responsive */
@media (max-width: 1100px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .nav-brand-name { display: none; }

    .menu-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        background: #111;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        z-index: 1001;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
    }

    .nav-menu.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .nav-menu a {
        font-size: 1.35rem;
        letter-spacing: 0.14em;
        padding: 12px 20px;
    }

    .split,
    .teaser-content,
    .contact-layout,
    .project-grid,
    .anim-grid {
        grid-template-columns: 1fr;
    }

    .contact-info { align-items: center; text-align: center; }
    .contact-description { margin-inline: auto; }
    .teaser-text { padding: 32px; }
    .project-gallery .gallery-mosaic { columns: 1; }
    .hero-content { padding: 36px 24px; }
    .hero-avatar { width: 104px; height: 104px; }
}

@media (max-width: 640px) {
    .wrap, .wrap--s, .wrap--m, .wrap--wide, .gallery-container, .project-gallery, .teaser-section {
        width: calc(100% - 32px);
    }
    .card-grid,
    .contact-grid { grid-template-columns: 1fr; }
    .section { padding: 64px 0; }
    .navbar { padding: 12px 16px; }
    .page-hero { padding: 140px 20px 80px; min-height: 48vh; }
    .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
    .lb-prev { left: 20px; }
    .lb-next { right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal { opacity: 1; transform: none; }
    html.is-loading .loader,
    .loader {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.page-block {
    padding-top: calc(var(--header-h) + 56px);
    padding-bottom: 88px;
}

.project-title span:first-child { color: inherit; }
.stack img,
.stack picture img,
img.rounded-media {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* Home studios credit */
.hero-studios {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.hero-studios-label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}
.hero-studios-names {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Experience & Education */
.cv-timeline {
    text-align: left;
    max-width: 720px;
    margin-inline: auto;
}
.cv-heading {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--blue);
    margin: 36px 0 18px;
}
.cv-heading:first-child { margin-top: 0; }
.cv-list {
    list-style: none;
    border-left: 2px solid var(--line);
    margin: 0;
    padding: 0 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.cv-item { position: relative; }
.cv-item::before {
    content: "";
    position: absolute;
    left: -33px;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(246, 194, 92, 0.2);
}
.cv-dates {
    display: block;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.cv-item h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: -0.02em;
}
.cv-role {
    color: var(--blue-dark);
    font-weight: 600;
    margin-top: 2px;
}
.cv-note {
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.65;
}
.cv-timeline--compact .cv-list { gap: 20px; }
.cv-timeline--compact .cv-item h4 { font-size: 1.05rem; }
.cv-home { margin-top: 56px; }
.cv-home .section-title { margin-bottom: 36px; font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* Wix port: painted banner, short clips, episode examples, genre line */
.painted-band {
    margin-bottom: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--paper-2);
}
.painted-band img {
    width: 100%;
    height: auto;
    aspect-ratio: 1600 / 537;
    object-fit: cover;
}
.anim-grid--three { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.animation-card video { aspect-ratio: 16 / 9; height: auto; object-fit: cover; }
.genre-line {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue-dark);
}
.episode-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.episode-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 28px 30px;
}
.episode-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.episode-card p { color: var(--muted); margin-top: 10px; line-height: 1.7; }
.project-card .wip-tag,
.wip-tag { width: 96px; }
@media (max-width: 1100px) {
    .anim-grid--three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .anim-grid--three,
    .episode-list { grid-template-columns: 1fr; }
    .painted-band { margin-bottom: 40px; }
}
@media (max-width: 640px) {
    .project-card .wip-tag,
    .wip-tag { width: 76px; left: -10px; top: -12px; }
}


/* ── Page loader ───────────────────────────────────────────────
   Full-screen MAGU wordmark between pages. Hidden for
   prefers-reduced-motion (see the reduce block above). */

html.is-loading {
    background: #111;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: #111;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

html.is-loading .loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.is-loading.is-loader-out .loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Cover instantly when leaving for another internal page. */
html.is-leaving .loader {
    transition: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loader picture {
    width: auto;
    max-width: min(240px, 62vw);
    display: block;
}

.loader-mark {
    width: min(240px, 62vw);
    height: auto;
    display: block;
    opacity: 0;
    transform: scale(0.92);
    filter: drop-shadow(0 0 0 rgba(246, 194, 92, 0));
}

html.is-loading .loader-mark {
    animation: loader-logo-in 0.45s var(--ease) forwards;
}

html.is-leaving .loader-mark {
    animation: none;
    opacity: 1;
    transform: none;
    filter: drop-shadow(0 12px 28px rgba(246, 194, 92, 0.22));
}

@keyframes loader-logo-in {
    from {
        opacity: 0;
        transform: scale(0.92);
        filter: drop-shadow(0 0 0 rgba(246, 194, 92, 0));
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 12px 28px rgba(246, 194, 92, 0.22));
    }
}

/* Freeze a frame of the intro for screenshots (?freeze=0.3).
   --freeze is a negative time set by the boot script. */
html[data-freeze] .loader,
html[data-freeze].is-loading .loader {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    pointer-events: auto;
}

html[data-freeze] .loader-mark,
html[data-freeze].is-loading .loader-mark {
    animation: loader-logo-in 0.45s var(--ease) forwards;
    animation-delay: var(--freeze, 0s);
    animation-play-state: paused !important;
}
