/* Home — gold/glass academy, balanced cinematic hero */

@keyframes home-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes home-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes home-kenburns {
    from { transform: scale(1.02); }
    to { transform: scale(1.06); }
}

@keyframes home-gold-drift {
    0%, 100% { opacity: 0.35; transform: translate3d(0, 0, 0) scale(1); }
    50% { opacity: 0.62; transform: translate3d(-12px, 10px, 0) scale(1.06); }
}

/* Luxury sequential reveal: soft blur → sharp, fade, subtle rise */
@keyframes home-blur-in {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: translate3d(0, 14px, 0);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(0, 0, 0);
    }
}

/* Escape .site-main cage (max-width 960 + padding + overflow clip) */
.site-main:has(> .home-page) {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 0 110px;
    overflow-x: clip;
}

.home-page {
    --home-gold: var(--primary-color, #dab25d);
    --home-ink: #061618;
    --home-pad: clamp(16px, 4vw, 40px);
    max-width: none;
    /* Cancel body padding-top logo overhang so hero sits flush under the fixed header bar */
    margin: calc(-1 * var(--site-header-logo-overhang, 20px)) 0 0;
    padding: 0;
    overflow-x: clip;
    animation: home-fade-in 0.5s ease-out both;
    background:
        radial-gradient(ellipse 90% 50% at 85% 0%, rgba(218, 178, 93, 0.09), transparent 55%),
        radial-gradient(ellipse 60% 35% at 8% 40%, rgba(218, 178, 93, 0.04), transparent 50%),
        transparent;
}

[data-theme="light"] .home-page {
    background:
        radial-gradient(ellipse 90% 50% at 85% 0%, rgba(201, 162, 55, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 35% at 8% 40%, rgba(160, 120, 42, 0.09), transparent 50%),
        transparent;
}

/* ——— Hero: brand + copy + controlled portrait ——— */

.home-hero {
    --hero-ink: #f7f0e4;
    --hero-stage: 1120px;
    position: relative;
    width: 100%;
    isolation: isolate;
    overflow: hidden;
    /* Desktop RTL: col1 = physical right (portrait), col2 = physical left (text) */
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(20px, 3.5vw, 48px);
    max-width: none;
    margin-inline: auto;
    min-height: min(78vh, 640px);
    padding-block: clamp(28px, 5vh, 56px);
    padding-inline: max(var(--home-pad), calc((100% - var(--hero-stage)) / 2));
}

/* Desktop: nudge portrait + texts 50px toward physical left (RTL-safe). */
@media (min-width: 901px) {
    .home-hero {
        padding-left: max(var(--home-pad), calc((100% - var(--hero-stage)) / 2 - 50px));
        padding-right: max(var(--home-pad), calc((100% - var(--hero-stage)) / 2 + 50px));
    }
}

.home-hero__atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 60% at 72% 40%, rgba(218, 178, 93, 0.16), transparent 58%),
        radial-gradient(ellipse 55% 50% at 18% 70%, rgba(218, 178, 93, 0.07), transparent 55%),
        linear-gradient(155deg, #0f3236 0%, #0a2528 48%, #061618 100%);
}

[data-theme="light"] .home-hero {
    --hero-ink: #100e0a;
}

[data-theme="light"] .home-hero__atmosphere {
    background:
        radial-gradient(ellipse 70% 60% at 72% 40%, rgba(201, 162, 55, 0.22), transparent 58%),
        radial-gradient(ellipse 55% 50% at 18% 70%, rgba(160, 120, 42, 0.10), transparent 55%),
        linear-gradient(155deg, #f6efe3 0%, #eee5d4 48%, #e5dccb 100%);
}

[data-theme="light"] .home-hero__media {
    background: #e8dfcf;
    box-shadow:
        0 18px 36px rgba(55, 38, 12, 0.12),
        inset 0 1px 0 rgba(255, 250, 240, 0.55);
}

[data-theme="light"] .home-hero__veil {
    background:
        linear-gradient(180deg, transparent 55%, rgba(240, 233, 220, 0.28) 100%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(201, 162, 55, 0.16), transparent 70%);
}

[data-theme="light"] .home-hero__brand {
    color: var(--text-heading, #100e0a);
    text-shadow: none;
}

[data-theme="light"] .home-hero__headline {
    color: var(--gold-ink, #9e7a32);
    text-shadow: none;
}

[data-theme="light"] .home-hero__lead {
    color: var(--text-secondary, #4a433a);
}

[data-theme="light"] .home-hero__cta .btn-ghost {
    color: var(--text-heading, #14110d);
    background: rgba(218, 178, 93, 0.10);
    border-color: rgba(196, 157, 74, 0.42);
}

.home-hero__glow {
    position: absolute;
    width: min(55%, 480px);
    height: min(55%, 480px);
    bottom: -12%;
    inset-inline-start: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(218, 178, 93, 0.42), rgba(218, 178, 93, 0.1) 45%, transparent 70%);
    filter: blur(36px);
    animation: home-gold-drift 16s ease-in-out infinite;
}

/* Contained portrait on desktop — strong but not oversized */
.home-hero__media {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 360px;
    height: min(54vh, 480px);
    max-height: 480px;
    margin-inline: auto;
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(218, 178, 93, 0.32);
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    background: #0a2528;
}

.home-hero__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 16%;
    display: block;
    filter: contrast(1.04) brightness(1.03) sepia(0.18) saturate(0.7);
}

.home-hero__veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Soft edge only — text is beside the image on desktop */
    background:
        linear-gradient(180deg, transparent 55%, rgba(5, 22, 24, 0.35) 100%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(218, 178, 93, 0.18), transparent 70%);
}

.home-hero__content {
    position: relative;
    z-index: 2;
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    width: min(100%, 520px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* LTR: same visual — text left, portrait right */
html[dir="ltr"] .home-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 360px);
}

html[dir="ltr"] .home-hero__media {
    grid-column: 2;
}

html[dir="ltr"] .home-hero__content {
    grid-column: 1;
    justify-self: end;
}

html[dir="ltr"] .home-hero__glow {
    inset-inline-start: auto;
    inset-inline-end: 8%;
}

.home-hero__reveal {
    opacity: 1;
}

.home-hero__brand {
    font-family: 'Kalameh', sans-serif;
    font-weight: 700;
    font-size: clamp(1.85rem, 3.8vw, 2.75rem);
    line-height: 1.3;
    color: var(--hero-ink);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}

.home-hero__headline {
    font-family: 'Kalameh', sans-serif;
    font-weight: 500;
    font-size: clamp(1.12rem, 2vw, 1.35rem);
    line-height: 1.55;
    color: rgba(218, 178, 93, 0.95);
    margin: 0 0 14px;
    max-width: 26rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.25);
}

.home-hero__lead {
    font-family: 'Kalameh', sans-serif;
    font-size: clamp(0.98rem, 1.55vw, 1.1rem);
    line-height: 1.9;
    color: rgba(247, 240, 228, 0.86);
    margin: 0 0 26px;
    max-width: 30rem;
}

.home-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-hero__cta .btn-ghost {
    border-color: rgba(218, 178, 93, 0.42);
    background: rgba(218, 178, 93, 0.1);
    color: var(--hero-ink);
}

.home-hero__cta .btn-ghost:hover {
    border-color: rgba(218, 178, 93, 0.65);
    background: rgba(218, 178, 93, 0.18);
}

/* ——— Body sections ——— */

.home-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px var(--home-pad) 0;
}

.home-section {
    margin-top: clamp(40px, 6vw, 64px);
    animation: home-fade-up 0.65s ease-out both;
}

.home-section:nth-of-type(1) { animation-delay: 0.04s; }
.home-section:nth-of-type(2) { animation-delay: 0.08s; }
.home-section:nth-of-type(3) { animation-delay: 0.12s; }

.home-section__head {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 8px;
}

.home-section__head .home-section__title {
    margin-bottom: 0;
}

.home-section__more {
    font-family: 'Kalameh', sans-serif;
    font-size: 0.95rem;
    color: var(--home-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.home-section__more:hover {
    border-bottom-color: rgba(218, 178, 93, 0.55);
}

.home-section__title {
    font-family: 'Kalameh', sans-serif;
    font-size: clamp(1.28rem, 2.3vw, 1.6rem);
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 8px;
    line-height: 1.4;
}

.home-section__lead {
    font-family: 'Kalameh', sans-serif;
    color: var(--text-muted);
    line-height: 1.85;
    margin: 0 0 22px;
    max-width: 36rem;
}

.home-explore-section .home-section__lead {
    text-align: center;
    margin-inline: auto;
}

/* Tests teaser — one band, not card spam */
.home-band {
    display: grid;
    gap: 18px;
    padding: 26px 0;
    border-top: 1px solid rgba(218, 178, 93, 0.2);
    border-bottom: 1px solid rgba(218, 178, 93, 0.2);
}

.home-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Explore — editorial row (desktop) / chic snap rail (mobile) */
.home-explore {
    --home-explore-inset: 0px;
    --home-explore-fade: color-mix(in srgb, var(--bg-base) 78%, transparent);
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    border-top: 1px solid rgba(218, 178, 93, 0.18);
    border-bottom: 1px solid rgba(218, 178, 93, 0.18);
    padding: 6px 0;
}

.home-explore__track {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 4px 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.home-explore__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
    max-width: 100%;
    text-decoration: none;
    font-family: 'Kalameh', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    position: relative;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    transition:
        color 0.22s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.home-explore__link:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-inline-end: 0;
    top: 50%;
    width: 1px;
    height: 14px;
    margin-top: -7px;
    background: rgba(218, 178, 93, 0.28);
}

.home-explore__link:hover {
    color: var(--home-gold);
}

.home-explore__link:focus-visible {
    outline: 2px solid var(--home-gold, #dab25d);
    outline-offset: 2px;
}

[data-theme="light"] .home-explore {
    --home-explore-fade: color-mix(in srgb, var(--bg-base) 70%, transparent);
}

[data-theme="dark"] .home-explore {
    --home-explore-fade: color-mix(in srgb, var(--bg-base) 82%, transparent);
}

/* Mobile / tablet: single-row horizontal snap + edge fade (blog chips pattern) */
@media (max-width: 900px) {
    .home-explore {
        --home-explore-inset: 6px;
        border: 1px solid color-mix(in srgb, var(--home-gold, #dab25d) 36%, var(--glass-border, rgba(218, 178, 93, 0.28)));
        border-radius: 14px;
        padding: var(--home-explore-inset);
        background:
            radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--home-gold, #dab25d) 14%, transparent), transparent 58%),
            var(--glass-bg, rgba(6, 22, 24, 0.42));
        box-shadow: var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, 0.18));
        backdrop-filter: blur(12px) saturate(1.1);
        -webkit-backdrop-filter: blur(12px) saturate(1.1);
    }

    .home-explore::before,
    .home-explore::after {
        content: "";
        position: absolute;
        top: var(--home-explore-inset);
        bottom: var(--home-explore-inset);
        width: 32px;
        z-index: 2;
        pointer-events: none;
    }

    html[dir="rtl"] .home-explore::before,
    html:not([dir="ltr"]) .home-explore::before {
        right: var(--home-explore-inset);
        background: linear-gradient(to left, var(--home-explore-fade), transparent);
    }

    html[dir="rtl"] .home-explore::after,
    html:not([dir="ltr"]) .home-explore::after {
        left: var(--home-explore-inset);
        background: linear-gradient(to right, var(--home-explore-fade), transparent);
    }

    html[dir="ltr"] .home-explore::before {
        left: var(--home-explore-inset);
        right: auto;
        background: linear-gradient(to right, var(--home-explore-fade), transparent);
    }

    html[dir="ltr"] .home-explore::after {
        right: var(--home-explore-inset);
        left: auto;
        background: linear-gradient(to left, var(--home-explore-fade), transparent);
    }

    .home-explore__track {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 2px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 24px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .home-explore__track::-webkit-scrollbar {
        display: none;
    }

    .home-explore__link {
        white-space: nowrap;
        overflow-wrap: normal;
        max-width: none;
        padding: 8px 14px;
        font-size: 0.86rem;
        color: var(--text-secondary, var(--text-primary));
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--home-gold, #dab25d) 32%, var(--glass-border, rgba(218, 178, 93, 0.28)));
        background: color-mix(in srgb, var(--glass-bg, rgba(6, 22, 24, 0.42)) 72%, var(--primary-soft, rgba(218, 178, 93, 0.16)));
        scroll-snap-align: start;
    }

    .home-explore__link:not(:last-child)::after {
        display: none;
    }

    .home-explore__link:hover {
        border-color: color-mix(in srgb, var(--home-gold, #dab25d) 62%, var(--glass-border, rgba(218, 178, 93, 0.28)));
        background: var(--primary-soft, rgba(218, 178, 93, 0.16));
        color: var(--gold-ink, var(--home-gold, #dab25d));
    }

    [data-theme="dark"] .home-explore__link {
        color: var(--text-primary);
        background: color-mix(in srgb, var(--primary-soft, rgba(218, 178, 93, 0.16)) 55%, var(--glass-bg, rgba(6, 22, 24, 0.42)));
    }

    [data-theme="dark"] .home-explore__link:hover {
        color: var(--home-gold, #dab25d);
    }
}

@media (max-width: 479px) {
    .home-explore {
        --home-explore-inset: 4px;
        border-radius: 12px;
    }

    .home-explore__track {
        gap: 6px;
        padding: 2px 10px;
        scroll-padding-inline: 20px;
    }

    .home-explore__link {
        min-height: 40px;
        padding: 7px 12px;
        font-size: 0.82rem;
    }

    .home-explore::before,
    .home-explore::after {
        width: 28px;
    }
}

/* Photo feature panels (bio / podcast / entity / book / gallery) */
.home-feature {
    margin-top: clamp(36px, 5.5vw, 56px);
}

.home-feature__panel {
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(218, 178, 93, 0.22);
    background:
        linear-gradient(165deg, rgba(218, 178, 93, 0.06), transparent 42%),
        rgba(6, 22, 24, 0.28);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .home-feature__panel {
    background:
        linear-gradient(165deg, rgba(201, 162, 55, 0.14), transparent 42%),
        rgba(250, 244, 232, 0.92);
    border-color: rgba(160, 120, 42, 0.36);
    box-shadow: 0 14px 34px rgba(55, 38, 12, 0.09);
}

[data-theme="light"] .home-feature__media {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(201, 162, 55, 0.20), transparent 55%),
        #e8dfcf;
}

.home-feature__panel--split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: stretch;
}

.home-feature__panel--flip .home-feature__body {
    order: 1;
}

.home-feature__panel--flip .home-feature__media {
    order: 2;
}

.home-feature__media {
    position: relative;
    min-width: 0;
    min-height: 240px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(218, 178, 93, 0.18), transparent 55%),
        rgba(0, 0, 0, 0.18);
}

.home-feature__media--tests {
    aspect-ratio: auto;
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vw, 28px);
}

.home-tests-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 360px;
}

.home-feature__media--tests .home-tests-mosaic img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    max-height: none;
    object-fit: contain;
    object-position: center;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 14px;
    border: 1px solid rgba(218, 178, 93, 0.28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-feature__media:not(.home-feature__media--tests) img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
    .home-feature__panel:hover .home-feature__media:not(.home-feature__media--tests) img {
        transform: scale(1.04);
    }

    .home-feature__panel:hover .home-feature__media--tests .home-tests-mosaic img {
        transform: scale(1.03);
    }
}

.home-feature__body {
    padding: clamp(22px, 3.5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.home-feature__body--intro {
    padding-bottom: 8px;
}

.home-feature__eyebrow {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--home-gold);
}

.home-feature__title {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: clamp(1.32rem, 2.6vw, 1.78rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-heading);
    overflow-wrap: anywhere;
}

.home-feature__lead {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-muted);
    overflow-wrap: anywhere;
    max-width: 36rem;
}

.home-feature__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
}

.home-feature__actions .btn-gold,
.home-feature__actions .btn-ghost {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.home-feature__strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
}

.home-feature__strip img {
    width: 100%;
    height: 84px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(218, 178, 93, 0.22);
}

/* Entity — mosaic + service cards */
.home-entity__mosaic {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0 clamp(16px, 2.8vw, 28px) 8px;
}

.home-entity__shot {
    margin: 0;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(218, 178, 93, 0.2);
    background: rgba(0, 0, 0, 0.18);
    padding: clamp(10px, 2.2vw, 16px);
    box-sizing: border-box;
}

.home-entity__shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.45s ease;
}

@media (hover: hover) and (pointer: fine) {
    .home-entity__shot:hover img {
        transform: scale(1.03);
    }
}

.home-entity__grid {
    margin: 0;
    padding: clamp(14px, 2.5vw, 24px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.home-entity__card {
    min-width: 0;
    margin: 0;
    padding: 16px 16px 14px;
    border-radius: 16px;
    background: rgba(218, 178, 93, 0.07);
    border: 1px solid rgba(218, 178, 93, 0.18);
}

.home-entity__card dt {
    margin: 0 0 6px;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--home-gold);
}

.home-entity__card dd {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.home-entity__card--cta dd {
    display: grid;
    gap: 10px;
    justify-items: start;
}

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

.home-gallery-section {
    overflow-x: clip;
}

/* Resume / activity gallery — gold/glass frames, full photo visible */
.home-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 1.4vw, 16px);
    padding: 4px clamp(16px, 2.8vw, 24px) 22px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.home-gallery__item {
    position: relative;
    margin: 0;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1;
    min-height: 140px;
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(218, 178, 93, 0.3);
    background:
        linear-gradient(180deg, rgba(218, 178, 93, 0.08), transparent 42%),
        rgba(6, 22, 24, 0.32);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.home-gallery__item::after {
    content: none;
}

.home-gallery__item img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

[data-theme="light"] .home-gallery__item {
    background:
        linear-gradient(180deg, rgba(201, 162, 55, 0.14), transparent 42%),
        rgba(250, 244, 232, 0.82);
    border-color: rgba(160, 120, 42, 0.40);
    box-shadow:
        0 10px 24px rgba(55, 38, 12, 0.10),
        inset 0 1px 0 rgba(255, 250, 240, 0.70);
}

@media (hover: hover) and (pointer: fine) {
    .home-gallery__item:hover {
        border-color: rgba(218, 178, 93, 0.55);
    }

    .home-gallery__item:hover img {
        transform: none;
    }
}

@media (max-width: 900px) {
    .home-feature__panel--split {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-feature__panel--flip .home-feature__body {
        order: 0;
    }

    .home-feature__panel--flip .home-feature__media {
        order: 0;
    }

    .home-feature__media {
        aspect-ratio: 16 / 10;
        min-height: 0;
        max-height: 280px;
    }

    .home-feature__media img {
        max-height: 280px;
    }

    /* Tall posters (e.g. about-poster) in landscape mobile frame: face/subject center */
    .home-feature__media:not(.home-feature__media--tests) img {
        object-position: center center;
    }

    .home-feature__media--tests {
        aspect-ratio: auto;
        max-height: none;
        min-height: 220px;
    }

    .home-feature__media--tests .home-tests-mosaic img {
        max-height: none;
    }

    .home-entity__mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-entity__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-mags {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .home-feature__panel {
        border-radius: 16px;
    }

    .home-feature__strip img {
        height: 68px;
    }

    .home-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Editorial list (events reuse these) */
.home-posts {
    display: flex;
    flex-direction: column;
}

.home-post {
    padding: 20px 2px 18px;
    border-bottom: 1px solid rgba(218, 178, 93, 0.16);
    transition: padding-inline-start 0.25s ease;
}

.home-post:first-child {
    border-top: 1px solid rgba(218, 178, 93, 0.16);
}

.home-post:hover {
    padding-inline-start: 6px;
}

.home-post h3 {
    margin: 0 0 6px;
    font-family: 'Kalameh', sans-serif;
    font-size: 1.12rem;
    color: var(--text-heading);
    line-height: 1.45;
}

.home-post h3 a {
    color: inherit;
    text-decoration: none;
}

.home-post h3 a:hover {
    color: var(--home-gold);
}

.home-post__meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.7;
}

.home-post__excerpt {
    color: var(--text-primary);
    line-height: 1.85;
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    max-width: 42rem;
}

.home-post__actions {
    margin-top: 12px;
}

.home-event.home-event--has-cover {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    gap: 16px 20px;
    align-items: center;
    padding-block: 16px;
}

.home-event__cover {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(218, 178, 93, 0.16);
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.04);
}

.home-event__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-event:hover .home-event__cover img {
    transform: scale(1.03);
}

.home-event__body {
    min-width: 0;
}

.home-event__type {
    color: var(--home-gold, var(--primary-color, #dab25d));
    font-weight: 700;
}

@media (max-width: 640px) {
    .home-event.home-event--has-cover {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .home-event__cover {
        max-height: 160px;
    }
}

/* Latest writings — magazine: one feature + secondary row */
.home-writings {
    display: grid;
    gap: 20px;
    margin-top: 14px;
}

.home-writing {
    margin: 0;
}

.home-writing__media {
    display: block;
    position: relative;
    overflow: hidden;
    background: rgba(6, 22, 24, 0.35);
    text-decoration: none;
}

.home-writing__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-writing__fallback {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    background:
        radial-gradient(ellipse 70% 55% at 28% 42%, rgba(218, 178, 93, 0.38), transparent 58%),
        linear-gradient(155deg, #12383c 0%, #0a2528 48%, #061618 100%);
    position: relative;
}

.home-writing__fallback::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url(/images/logo-dark-mode.webp) center / min(42%, 160px) no-repeat;
    opacity: 0.28;
    pointer-events: none;
}

.home-writing--feature {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(218, 178, 93, 0.22);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    background: #061618;
}

.home-writing--feature .home-writing__hit {
    display: block;
    position: relative;
    color: inherit;
    text-decoration: none;
    isolation: isolate;
}

.home-writing--feature .home-writing__media {
    aspect-ratio: 16 / 9;
    min-height: 220px;
}

.home-writing--feature .home-writing__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(6, 22, 24, 0.08) 0%, rgba(6, 22, 24, 0.2) 42%, rgba(6, 22, 24, 0.88) 100%),
        linear-gradient(90deg, rgba(6, 22, 24, 0.35) 0%, transparent 55%);
}

.home-writing--feature .home-writing__body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
    display: grid;
    gap: 8px;
    padding: clamp(18px, 3.5vw, 28px);
    max-width: 40rem;
}

.home-writing--feature .home-writing__meta {
    font-family: 'Kalameh', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(218, 178, 93, 0.92);
    letter-spacing: 0.01em;
}

.home-writing--feature .home-writing__title {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: clamp(1.2rem, 2.4vw, 1.55rem);
    font-weight: 700;
    line-height: 1.45;
    color: #f7f0e4;
}

.home-writing--feature .home-writing__excerpt {
    font-family: 'Kalameh', sans-serif;
    font-size: 0.96rem;
    line-height: 1.75;
    color: rgba(247, 240, 228, 0.78);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-writing--feature .home-writing__more {
    margin-top: 4px;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--home-gold);
    border-bottom: 1px solid transparent;
    justify-self: start;
    transition: border-color 0.2s ease;
}

.home-writing--feature .home-writing__hit:hover .home-writing__media img {
    transform: scale(1.04);
}

.home-writing--feature .home-writing__hit:hover .home-writing__more {
    border-bottom-color: rgba(218, 178, 93, 0.55);
}

.home-writings__secondary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.home-writing--teaser {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(218, 178, 93, 0.14);
}

.home-writing--teaser:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.home-writing--teaser .home-writing__media {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid rgba(218, 178, 93, 0.2);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.home-writing--teaser .home-writing__media img,
.home-writing--teaser .home-writing__fallback {
    min-height: 104px;
}

.home-writing--teaser .home-writing__body {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding-top: 2px;
}

.home-writing--teaser .home-writing__meta {
    font-family: 'Kalameh', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--home-gold);
    line-height: 1.5;
}

.home-writing--teaser .home-writing__title {
    margin: 0;
    font-family: 'Kalameh', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-heading);
}

.home-writing--teaser .home-writing__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.home-writing--teaser .home-writing__title a:hover {
    color: var(--home-gold);
}

.home-writing--teaser .home-writing__excerpt {
    margin: 2px 0 0;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-writing--teaser:hover .home-writing__media img {
    transform: scale(1.05);
}

[data-theme="light"] .home-writing--feature {
    background: #f7f3ea;
    border-color: rgba(196, 157, 74, 0.28);
    box-shadow: 0 14px 32px rgba(72, 52, 20, 0.08);
}

[data-theme="light"] .home-writing--teaser .home-writing__media {
    box-shadow: 0 8px 18px rgba(72, 52, 20, 0.08);
}

[data-theme="light"] .home-writing__media {
    background: #efe8d8;
}

[data-theme="light"] .home-writing__fallback {
    background:
        radial-gradient(ellipse 70% 55% at 28% 42%, rgba(218, 178, 93, 0.28), transparent 58%),
        linear-gradient(155deg, #f3eee4 0%, #ebe4d6 100%);
}

[data-theme="light"] .home-mag__cover {
    background: rgba(218, 178, 93, 0.08);
    box-shadow: 0 12px 28px rgba(72, 52, 20, 0.08);
}

@media (min-width: 720px) {
    .home-writings__secondary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 18px;
        padding-top: 4px;
        border-top: 1px solid rgba(218, 178, 93, 0.14);
    }

    .home-writing--teaser {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
        border-bottom: 0;
    }

    .home-writing--teaser .home-writing__media {
        aspect-ratio: 16 / 10;
    }

    .home-writing--teaser .home-writing__media img,
    .home-writing--teaser .home-writing__fallback {
        min-height: 0;
    }

    .home-writing--teaser .home-writing__excerpt {
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 479px) {
    .home-writing--feature .home-writing__excerpt {
        display: none;
    }

    .home-writing--teaser {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
    }

    .home-writing--teaser .home-writing__media img,
    .home-writing--teaser .home-writing__fallback {
        min-height: 88px;
    }

    .home-writing--teaser .home-writing__excerpt {
        display: none;
    }
}

/* Magazines */
.home-mags {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.home-mag {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.home-mag__cover {
    display: block;
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(218, 178, 93, 0.22);
    transition: transform 0.35s ease, border-color 0.3s ease;
}

.home-mag:hover .home-mag__cover {
    transform: translateY(-4px);
    border-color: rgba(218, 178, 93, 0.45);
}

.home-mag__cover img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center center;
    display: block;
    background: rgba(0, 0, 0, 0.18);
    transition: transform 0.45s ease;
}

.home-mag:hover .home-mag__cover img {
    transform: scale(1.04);
}

.home-mag h3 {
    font-family: 'Kalameh', sans-serif;
    font-size: 1rem;
    margin: 0 0 4px;
    color: var(--text-heading);
    line-height: 1.45;
}

.home-mag h3 a {
    color: inherit;
    text-decoration: none;
}

.home-mag h3 a:hover {
    color: var(--home-gold);
}

.home-mag__meta {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Bio / podcast bands share home-band */
.home-band--split {
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .home-band--split {
        grid-template-columns: 1.2fr auto;
        align-items: end;
        gap: 28px;
    }
}

.home-closing {
    text-align: center;
    padding: 8px 0 12px;
}

.home-closing .home-section__title {
    margin-inline: auto;
}

.home-closing .home-section__lead {
    margin-inline: auto;
}

.home-closing .home-band__actions {
    justify-content: center;
}

/* FAQ */
.home-faq details {
    padding: 16px 4px;
    border-bottom: 1px solid rgba(218, 178, 93, 0.16);
    margin: 0;
}

.home-faq details:first-of-type {
    border-top: 1px solid rgba(218, 178, 93, 0.16);
}

.home-faq summary {
    font-family: 'Kalameh', sans-serif;
    font-weight: 700;
    color: var(--text-heading);
    cursor: pointer;
    list-style: none;
    line-height: 1.65;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.home-faq summary::before {
    content: "+";
    flex: 0 0 auto;
    color: var(--home-gold);
    font-weight: 700;
    line-height: 1.65;
}

.home-faq details[open] summary::before {
    content: "−";
}

.home-faq details p {
    margin: 12px 0 4px;
    color: var(--text-primary);
    line-height: 1.9;
    font-family: 'Kalameh', sans-serif;
    max-width: 42rem;
    padding-inline-start: 1.4rem;
}

/* ——— Responsive ——— */

@media (max-width: 900px) {
    /* Mobile / tablet: full-bleed photo, text over gradient */
    .home-hero {
        display: block;
        max-width: none;
        min-height: calc(100svh - var(--site-header-offset, 72px));
        min-height: calc(100vh - var(--site-header-offset, 72px));
        padding: 0;
    }

    .home-hero__atmosphere {
        display: none;
    }

    .home-hero__media {
        position: absolute;
        inset: 0;
        z-index: 0;
        max-width: none;
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        animation: none;
    }

    .home-hero__photo {
        object-position: center 12%;
    }

    .home-hero__veil {
        background:
            linear-gradient(
                180deg,
                rgba(5, 22, 24, 0.22) 0%,
                rgba(5, 22, 24, 0.12) 30%,
                rgba(5, 22, 24, 0.72) 68%,
                rgba(5, 22, 24, 0.96) 100%
            ),
            radial-gradient(ellipse 80% 40% at 50% 100%, rgba(218, 178, 93, 0.2), transparent 70%);
    }

    .home-hero__glow {
        inset-inline-end: auto;
        inset-inline-start: -10%;
        bottom: -18%;
        width: min(70%, 560px);
        height: min(70%, 560px);
        z-index: 1;
    }

    .home-hero__content {
        position: relative;
        z-index: 2;
        width: 100%;
        min-height: calc(100svh - var(--site-header-offset, 72px));
        min-height: calc(100vh - var(--site-header-offset, 72px));
        margin: 0;
        text-align: center;
        align-items: center;
        /* Sit above bottom nav — was pinned too low so CTAs were hidden */
        justify-content: flex-end;
        padding:
            32px
            var(--home-pad)
            calc(var(--bottom-nav-offset, 83px) + clamp(20px, 4vh, 36px));
    }

    .home-hero__media,
    .home-hero__content,
    html[dir="ltr"] .home-hero,
    html[dir="ltr"] .home-hero__media,
    html[dir="ltr"] .home-hero__content {
        grid-column: auto;
        justify-self: auto;
    }

    .home-hero__headline,
    .home-hero__lead {
        margin-inline: auto;
    }

    .home-hero__cta {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: min(100%, 420px);
    }

    /* موبایل: متن روی عکس — جوهر روشن بماند */
    [data-theme="light"] .home-hero {
        --hero-ink: #f7f0e4;
    }

    [data-theme="light"] .home-hero__brand {
        color: #f7f0e4;
        text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
    }

    [data-theme="light"] .home-hero__headline {
        color: #e2bf72;
        text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
    }

    [data-theme="light"] .home-hero__lead {
        color: rgba(247, 240, 228, 0.92);
    }

    [data-theme="light"] .home-hero__cta .btn-ghost {
        color: #f7f0e4;
        background: rgba(218, 178, 93, 0.14);
        border-color: rgba(218, 178, 93, 0.48);
    }
}

@media (max-width: 767px) {
    .home-hero {
        /* Shorter stage so brand + CTAs sit higher in the first paint */
        min-height: calc(100svh - var(--site-header-offset, 64px) - 8px);
        min-height: calc(100vh - var(--site-header-offset, 64px) - 8px);
    }

    .home-hero__content {
        min-height: calc(100svh - var(--site-header-offset, 64px) - 8px);
        min-height: calc(100vh - var(--site-header-offset, 64px) - 8px);
        /* Extra lift: keep CTAs clear of the floating bottom nav */
        padding-bottom: calc(var(--bottom-nav-offset, 83px) + clamp(32px, 6vh, 52px));
        padding-top: 24px;
    }

    .home-hero__lead {
        margin-bottom: 18px;
    }

    /* One horizontal row on mobile — do not force full-width stack */
    .home-hero__cta {
        flex-wrap: wrap;
        gap: 10px;
        max-width: 100%;
    }

    .home-hero__cta .btn-gold,
    .home-hero__cta .btn-ghost {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        padding-inline: 12px;
        box-sizing: border-box;
        text-align: center;
    }

    .home-mags {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .home-section__head {
        /* Keep title + «view all» on one row (~375); allow wrap only if needed */
        flex-wrap: wrap;
        row-gap: 4px;
        column-gap: 12px;
        align-items: baseline;
    }

    .home-section__head .home-section__title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .home-section__head .home-section__more {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .home-band__actions {
        width: 100%;
    }

    .home-band__actions .btn-gold,
    .home-band__actions .btn-ghost {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    .home-hero__brand {
        font-size: 1.5rem;
    }

    .home-hero__headline {
        font-size: 1.02rem;
    }

    .home-hero__lead {
        font-size: 0.94rem;
        margin-bottom: 20px;
    }

    .home-mags {
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page,
    .home-hero__media,
    .home-hero__reveal,
    .home-section,
    .home-hero__photo,
    .home-hero__glow {
        animation: none !important;
    }

    .home-hero__reveal {
        opacity: 1;
        filter: none;
        transform: none;
        will-change: auto;
    }

    .home-hero__photo {
        transform: none;
        will-change: auto;
    }

    .home-post:hover,
    .home-event:hover .home-event__cover img,
    .home-mag:hover .home-mag__cover,
    .home-mag:hover .home-mag__cover img,
    .home-writing__media img,
    .home-writing--feature .home-writing__hit:hover .home-writing__media img,
    .home-writing--teaser:hover .home-writing__media img,
    .home-feature__panel:hover .home-feature__media img,
    .home-entity__shot:hover img,
    .home-gallery__item:hover img {
        transform: none;
        padding-inline-start: 0;
    }
}
