/* myth.css — uses site-wide CSS variables from theme.css */

.series-page.myth-page-root {
    --page-accent: #c08642;
    --myth-gold: #c08642;
    --myth-sage: #8fa188;
    --myth-radius: var(--radius, 22px);
}

/* ─── Scroll progress bar ─────────────────────────────────── */
.myth-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--myth-gold), var(--myth-sage));
    border-radius: 0 2px 2px 0;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* ─── Hero ────────────────────────────────────────────────── */
.myth-hero {
    --paper: #f4efe5;
    --paper-soft: rgba(244, 239, 229, 0.74);
    --paper-faint: rgba(244, 239, 229, 0.5);
    --line: rgba(244, 239, 229, 0.18);
    position: relative;
    display: grid;
    align-items: end;
    min-height: min(760px, calc(100svh - 118px));
    overflow: hidden;
    margin-bottom: 32px;
    padding: clamp(22px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 40px;
    background: #191108;
    color: var(--paper);
    isolation: isolate;
    box-shadow:
        0 38px 96px rgba(0, 0, 0, 0.52),
        0 12px 30px rgba(0, 0, 0, 0.28);
}

.myth-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 68% 38%, rgba(192, 134, 66, 0.18), transparent 62%),
        radial-gradient(ellipse 60% 80% at 20% 80%, rgba(143, 161, 136, 0.12), transparent 58%),
        linear-gradient(135deg, #110d07 0%, #1e1710 38%, #0e0b06 100%);
    transform: scale(1.02);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.myth-hero__img-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.myth-hero__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
    opacity: 1;
    filter: saturate(0.72) contrast(1.1);
    transform: scale(1.04);
    transition: transform 12s ease-out;
    will-change: transform;
}

.myth-hero.is-loaded .myth-hero__img-wrap img {
    transform: scale(1.0);
}

.myth-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(17, 13, 7, 0.1) 10%, rgba(17, 13, 7, 0.3) 40%, rgba(17, 13, 7, 0.1) 100%),
        linear-gradient(120deg, rgba(17, 13, 7, 0.72) 0%, rgba(17, 13, 7, 0.2) 48%, rgba(17, 13, 7, 0.06) 72%);
    pointer-events: none;
}

.myth-hero__copy {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 18px;
    max-width: min(640px, 100%);
}

.myth-hero__eyebrow {
    margin: 0;
    color: var(--myth-gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.myth-hero__title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(3.4rem, 8vw, 6.8rem);
    font-weight: 600;
    line-height: 0.92;
    letter-spacing: 0;
}

.myth-hero__lede {
    margin: 0;
    max-width: 38ch;
    color: rgba(244, 239, 229, 0.82);
    font-size: clamp(0.98rem, 1.6vw, 1.12rem);
}

.myth-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.myth-hero__chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(244, 239, 229, 0.22);
    border-radius: 999px;
    background: rgba(15, 12, 7, 0.32);
    color: rgba(244, 239, 229, 0.82);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ─── Section header ──────────────────────────────────────── */
.myth-section-head {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
    padding-top: 6px;
}

.myth-section-kicker {
    margin: 0;
    color: var(--myth-gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.myth-section-title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 600;
    line-height: 0.96;
    letter-spacing: 0;
    color: var(--paper);
}

/* ─── Bento grid ──────────────────────────────────────────── */
.myth-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 0;
}

/* ─── Tilt wrappers ─────────────────────────────────────────
   Grid placement + box-shadow + 3D transform all live here.
   The actual .myth-card inside keeps overflow:hidden intact —
   never apply rotateX/Y directly to an overflow:hidden element
   or the browser stops clipping children to border-radius.     */
.myth-tilt-wrap {
    /* display:block — card defines its own height, wrapper follows */
    position: relative;
    border-radius: 32px;  /* match card so box-shadow follows the shape */
    box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.36),
        0 10px 22px rgba(0, 0, 0, 0.2);
    will-change: transform;
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s ease;
    /* Ensure child card fills wrapper width */
    font-size: 0; /* collapse any inline-gap */
}

.myth-tilt-wrap--feature { grid-column: span 7; }
.myth-tilt-wrap--tall    { grid-column: span 5; }
.myth-tilt-wrap--wide    { grid-column: 1 / -1; }

.myth-tilt-wrap:hover {
    box-shadow:
        0 38px 90px rgba(0, 0, 0, 0.46),
        0 14px 30px rgba(0, 0, 0, 0.26);
}

/* ─── Cards ───────────────────────────────────────────────── */
.myth-card {
    position: relative;
    display: grid;
    overflow: hidden;     /* safe — no 3D transform on this element */
    width: 100%;          /* fill wrapper width */
    min-height: 420px;    /* fallback; specific variants override below */
    font-size: 1rem;      /* reset font-size from wrapper's 0 */
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--panel, rgba(0,0,0,0.78));
    transition: border-color 0.28s ease;
}

/* Card shimmer highlight */
.myth-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 0 0 1px rgba(0, 0, 0, 0.18) inset;
    pointer-events: none;
    transition: box-shadow 0.28s ease;
}

.myth-card:hover {
    border-color: var(--line-strong, rgba(255,255,255,0.28));
}

.myth-card:hover::after {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 0 0 1px rgba(0, 0, 0, 0.22) inset;
}

.myth-card--feature {
    min-height: 680px;
    grid-template-rows: minmax(0, 1fr) auto;
}

.myth-card--tall {
    min-height: 680px;
    grid-template-rows: minmax(0, 1fr) auto;
}

.myth-card--wide {
    min-height: 360px;
    grid-template-columns: minmax(0, 0.58fr) minmax(300px, 0.42fr);
}


/* ─── Card media ──────────────────────────────────────────── */
.myth-card__media {
    position: relative;
    overflow: hidden;
    margin: 0;
    background: rgba(17, 13, 7, 0.9);
}

.myth-card--feature .myth-card__media,
.myth-card--tall .myth-card__media {
    aspect-ratio: auto;
    min-height: 0;
}

.myth-card--wide .myth-card__media {
    min-height: 360px;
}

.myth-card__media img {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.9;
    filter: saturate(0.88) contrast(1.05);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    will-change: transform;
}

.myth-card--feature .myth-card__media img {
    object-position: center 44%;
}

.myth-card--tall .myth-card__media img {
    object-position: center 36%;
}

.myth-card--wide .myth-card__media img {
    object-position: center 58%;
}

.myth-card:hover .myth-card__media img {
    opacity: 1;
    transform: scale(1.04);
}

.myth-card__media::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

/* ─── Card copy ───────────────────────────────────────────── */
.myth-card__copy {
    display: grid;
    align-content: end;
    gap: 10px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(10, 8, 5, 0) 0%, rgba(10, 8, 5, 0.78) 100%),
        rgba(16, 13, 9, 0.7);
}

.myth-card--wide .myth-card__copy {
    align-content: center;
    border-left: 1px solid var(--line);
    background: rgba(14, 11, 7, 0.88);
}

.myth-card__copy-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.myth-card--feature .myth-card__copy-label { color: rgba(255,255,255,0.44); }
.myth-card--tall .myth-card__copy-label    { color: rgba(143, 161, 136, 0.82); }
.myth-card--wide .myth-card__copy-label    { color: rgba(192, 134, 66, 0.88); }

.myth-card__copy h2 {
    max-width: 15ch;
    margin: 0;
    color: var(--paper, #ffffff);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: 0;
}

.myth-card__copy span {
    display: block;
    max-width: 44ch;
    color: rgba(244, 239, 229, 0.72);
    font-size: 0.94rem;
    line-height: 1.5;
}

/* ─── Card button ─────────────────────────────────────────── */
.myth-card__button {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-top: 8px;
    padding: 0 16px;
    border: 1px solid rgba(244, 239, 229, 0.22);
    border-radius: 999px;
    background: rgba(244, 239, 229, 0.06);
    color: rgba(244, 239, 229, 0.88);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition:
        border-color 0.22s ease,
        background 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease;
}

.myth-card__button::after {
    content: "";
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.22s ease;
}

.myth-card__button:hover,
.myth-card__button:focus-visible {
    border-color: rgba(244, 239, 229, 0.44);
    background: rgba(244, 239, 229, 0.12);
    color: #fff;
    transform: translateY(-2px);
}

.myth-card__button:hover::after {
    transform: rotate(45deg) translate(2px, -2px);
}

/* ─── Scroll-reveal animation ─────────────────────────────── */
.myth-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.68s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.myth-reveal:nth-child(2) { transition-delay: 0.08s; }
.myth-reveal:nth-child(3) { transition-delay: 0.16s; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 920px) {
    .myth-hero {
        min-height: 72svh;
        border-radius: 30px;
    }

    /* Wrappers collapse to full width */
    .myth-tilt-wrap,
    .myth-tilt-wrap--feature,
    .myth-tilt-wrap--tall,
    .myth-tilt-wrap--wide {
        grid-column: 1 / -1;
        min-height: 0;
    }

    /* Cards reflow to single column */
    .myth-card,
    .myth-card--feature,
    .myth-card--tall,
    .myth-card--wide {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(280px, 1fr) auto;
    }

    .myth-card--wide .myth-card__copy {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 560px) {
    .myth-hero {
        border-radius: 24px;
        padding: 18px;
        min-height: 68svh;
    }

    .myth-tilt-wrap {
        border-radius: 24px;
    }

    .myth-card,
    .myth-card--feature,
    .myth-card--tall,
    .myth-card--wide {
        grid-template-rows: minmax(260px, 42vh) auto;
        border-radius: 24px;
    }

    .myth-card__copy {
        padding: 18px;
    }

    .myth-card__copy h2 {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .myth-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .myth-tilt-wrap {
        transition: box-shadow 0.2s ease;
    }

    .myth-card__media img,
    .myth-hero__bg {
        transition: none;
    }
}

/* ─── Light mode overrides ────────────────────────────────── */
html[data-theme="light"] .myth-tilt-wrap {
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.1),
        0 4px 14px rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .myth-tilt-wrap:hover {
    box-shadow:
        0 20px 52px rgba(0, 0, 0, 0.14),
        0 8px 20px rgba(0, 0, 0, 0.09);
}

/* Card base */
html[data-theme="light"] .myth-card {
    background: #f7f4ef;
}

html[data-theme="light"] .myth-card::after {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

html[data-theme="light"] .myth-card:hover::after {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 0 0 1px rgba(0, 0, 0, 0.12) inset;
}

/* Media: lighter background + brighter image */
html[data-theme="light"] .myth-card__media {
    background: #e8e2d8;
}

html[data-theme="light"] .myth-card__media img {
    opacity: 1;
    filter: saturate(0.95) contrast(1.02) brightness(1.04);
}

/* Overlay gradient flips to white-to-transparent */
html[data-theme="light"] .myth-card__media::after {
    background: linear-gradient(180deg, transparent, rgba(247, 244, 239, 0.55));
}

/* Copy area: warm white background with dark text */
html[data-theme="light"] .myth-card__copy {
    background:
        linear-gradient(180deg, rgba(247, 244, 239, 0) 0%, rgba(247, 244, 239, 0.95) 100%),
        rgba(247, 244, 239, 0.9);
}

html[data-theme="light"] .myth-card--wide .myth-card__copy {
    background: rgba(247, 244, 239, 0.97);
    border-left-color: rgba(0, 0, 0, 0.1);
}

/* Labels */
html[data-theme="light"] .myth-card--feature .myth-card__copy-label {
    color: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .myth-card--tall .myth-card__copy-label {
    color: rgba(80, 105, 74, 0.9);
}

html[data-theme="light"] .myth-card--wide .myth-card__copy-label {
    color: rgba(148, 88, 22, 0.9);
}

/* Body text */
html[data-theme="light"] .myth-card__copy span {
    color: rgba(30, 26, 20, 0.72);
}

/* Button: dark on light */
html[data-theme="light"] .myth-card__button {
    border-color: rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.82);
}

html[data-theme="light"] .myth-card__button:hover,
html[data-theme="light"] .myth-card__button:focus-visible {
    border-color: rgba(0, 0, 0, 0.32);
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}
