/* ═══════════════════════════════════════════════════════════
   PuniCodex — Main Stylesheet
   Design System, Reset, Typography, Nav, Footer, Utilities
   ═══════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    /* Depth Colors */
    --void: #050505;
    --abyss: #0A0A0A;
    --deep: #0D0D0D;
    --surface: #141414;
    --surface-raised: #1A1A1A;
    --hover: #252525;
    --hover-bright: #333333;

    /* Gold System */
    --gold: #D4AF37;
    --gold-bright: #E8C547;
    --gold-dim: rgba(212, 175, 55, 0.12);
    --gold-glow: rgba(212, 175, 55, 0.35);
    --gold-glow-strong: rgba(212, 175, 55, 0.6);
    --gold-text-shadow: 0 0 40px rgba(212, 175, 55, 0.25);

    /* Accent */
    --blue: #4169E1;
    --blue-glow: rgba(65, 105, 225, 0.3);

    /* Text */
    --text-primary: #F0F0F0;
    --text-secondary: #A0A0A0;
    --text-dim: #555555;
    --text-faint: #333333;

    /* Spacing */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;
    --space-7: 96px;
    --space-8: 128px;
    --space-9: 160px;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Animation */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-dramatic: cubic-bezier(0.87, 0, 0.13, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 600ms;
    --duration-dramatic: 1200ms;

    /* Layout */
    --container-max: 1440px;
    --nav-height: 72px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
}

/* ─── Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--void);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

/* GPU layer promotion for animated elements */
.hero-content, .hero-canvas, .psi-icon, .scroll-indicator {
    will-change: transform;
    transform: translateZ(0);
}

button {
    font-family: inherit;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}



/* ─── Typography ─── */
.display-xl {
    font-family: var(--font-display);
    font-size: clamp(52px, 9vw, 120px);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--gold);
}

.display-lg {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: -0.01em;
    color: var(--gold);
}

.display-md {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 52px);
    font-weight: 600;
    line-height: 1.1;
    color: var(--gold);
}

.heading-lg {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--gold);
}

.heading-md {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: var(--gold);
}

.body-lg {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.body-md {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.body-sm {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

.label {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ─── Container ─── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }
}

/* ─── Navigation ─── */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1010;
    transition: background var(--duration-slow) var(--ease-smooth),
                backdrop-filter var(--duration-slow) var(--ease-smooth),
                border-color var(--duration-slow) var(--ease-smooth);
    border-bottom: 1px solid transparent;
}

.main-nav.scrolled {
    background: rgba(5, 5, 5, 0.95);
    border-bottom-color: var(--gold-dim);
}

.nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .nav-inner {
        padding: 0 var(--space-3);
    }
}

.nav-wordmark {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
    position: relative;
}

.nav-wordmark img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 62vw;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-link {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    transition: color var(--duration-fast) var(--ease-smooth);
    position: relative;
    padding: 4px 0;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--duration-normal) var(--ease-smooth), left var(--duration-normal) var(--ease-smooth);
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* ─── More Dropdown ─── */
.nav-more {
    position: relative;
}

.nav-more-toggle {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    white-space: nowrap;
}

.nav-more-toggle:hover,
.nav-more-toggle[aria-expanded="true"] {
    border-color: var(--gold);
    color: var(--gold);
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--surface-raised);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all var(--duration-fast) var(--ease-smooth);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 1011;
}

.nav-more:hover .nav-more-menu,
.nav-more-toggle[aria-expanded="true"] + .nav-more-menu,
.nav-more-menu:focus-within {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.nav-more-menu .nav-link {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.nav-more-menu .nav-link:hover {
    background: var(--gold-dim);
}

.nav-more-menu .nav-link::after {
    display: none;
}

.nav-cta {
    padding: 10px 22px;
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--gold);
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: translateX(-101%);
    transition: transform var(--duration-normal) var(--ease-enter);
}

.nav-cta:hover::before {
    transform: translateX(0);
}

.nav-cta:hover {
    color: var(--void);
}

.nav-cta span {
    position: relative;
    z-index: 1;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 20px;
    z-index: 1003;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transition: all var(--duration-normal) var(--ease-smooth);
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: calc(100vh - var(--nav-height));
    background: rgba(5, 5, 5, 0.98);
    z-index: 1009;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-3);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-smooth);
    overflow-y: auto;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

body.menu-open {
    overflow: hidden;
}

.mobile-menu > a {
    font-family: var(--font-display);
    font-size: clamp(24px, 6vw, 32px);
    color: var(--text-primary);
    transition: color var(--duration-fast) var(--ease-smooth);
    letter-spacing: 0.05em;
    flex-shrink: 0;
    padding: 0.5rem 0;
}

.mobile-menu > a:hover {
    color: var(--gold);
}

/* Grouped mobile menu */
.mobile-menu-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: var(--space-3);
}

.mobile-menu-section:last-child {
    border-bottom: none;
}

.mobile-menu-title {
    display: block;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-2);
}

.mobile-menu-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
}

.mobile-menu-group a {
    font-family: var(--font-display);
    font-size: clamp(18px, 4.5vw, 24px);
    color: var(--text-primary);
    transition: color var(--duration-fast) var(--ease-smooth);
    letter-spacing: 0.03em;
    padding: 0.35rem 0;
}

.mobile-menu-group a:hover,
.mobile-menu-group a.active {
    color: var(--gold);
}

@media (min-width: 480px) {
    .mobile-menu {
        padding: var(--space-5) var(--space-4);
    }

    .mobile-menu-group {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ─── Footer ─── */
.site-footer {
    position: relative;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(65, 105, 225, 0.04) 0%, transparent 50%),
        var(--void);
    padding: var(--space-7) 0 var(--space-4);
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 0 480px;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-bright) 50%, var(--gold) 80%, transparent 100%);
    opacity: 0.6;
}

.site-footer::after {
    content: '';
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 240px;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.75fr 1fr 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    position: relative;
    z-index: 1;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-wordmark {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
    width: fit-content;
}

.footer-wordmark img {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
}

.footer-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 300px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.footer-heading {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-2);
}

.footer-column a {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 7px 0;
    transition: color var(--duration-fast) var(--ease-smooth), transform var(--duration-fast) var(--ease-smooth);
    position: relative;
    width: fit-content;
}

.footer-column a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--duration-normal) var(--ease-smooth);
}

.footer-column a:hover {
    color: var(--gold);
    transform: translateX(4px);
}

.footer-column a:hover::after {
    width: 100%;
}

.footer-bottom {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(212, 175, 55, 0.08);
}

.footer-bottom p {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-5);
    }

    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }

    .footer-tagline {
        max-width: 420px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: var(--space-6) 0 var(--space-4);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-column {
        align-items: center;
    }

    .footer-column a {
        padding: 8px 0;
    }

    .footer-column a:hover {
        transform: none;
    }

    .footer-column a::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-column a:hover::after {
        width: 100%;
    }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 16px 36px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: var(--radius-md);
    transition: color var(--duration-normal) var(--ease-smooth), border-color var(--duration-normal) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--gold);
    color: var(--void);
    border-color: var(--gold);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold-bright);
    transform: translateX(-101%);
    transition: transform var(--duration-normal) var(--ease-enter);
}

.btn-primary:hover::before {
    transform: translateX(0);
}

.btn-primary:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 40px var(--gold-glow), 0 0 80px var(--gold-dim);
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: translateX(-101%);
    transition: transform var(--duration-normal) var(--ease-enter);
}

.btn-outline:hover::before {
    transform: translateX(0);
}

.btn-outline:hover {
    color: var(--void);
    box-shadow: 0 0 30px var(--gold-glow);
}

.btn-outline span {
    position: relative;
    z-index: 1;
}

.btn-lg {
    padding: 20px 52px;
    font-size: 16px;
}

/* ─── Section Headers ─── */
.section-header {
    text-align: center;
    margin-bottom: var(--space-7);
}

.section-header .section-eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-3);
    opacity: 0.8;
}

.section-header .section-title {
    margin-bottom: var(--space-3);
}

.section-header .section-subtitle {
    max-width: 640px;
    margin: 0 auto;
}

/* ─── Archetype Cards ─── */
.archetype-card {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    transition: border-color var(--duration-slow) var(--ease-smooth), transform var(--duration-slow) var(--ease-smooth), background var(--duration-slow) var(--ease-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
}

.archetype-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 0 0 transparent;
    transition: box-shadow var(--duration-slow) var(--ease-smooth);
    pointer-events: none;
}

.archetype-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(212,175,55,0) 0%, rgba(212,175,55,0.1) 50%, rgba(212,175,55,0) 100%);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-smooth);
    pointer-events: none;
    z-index: 0;
}

.archetype-card:hover::before {
    box-shadow: 0 0 60px var(--gold-glow), 0 0 120px var(--gold-dim);
}

.archetype-card:hover::after {
    opacity: 1;
}

.archetype-card:hover {
    border-color: rgba(212, 175, 55, 0.25);
    transform: translateY(-6px) scale(1.02);
    background: rgba(20, 20, 20, 0.8);
}

.archetype-card .card-portrait {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-3);
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.3);
    overflow: hidden;
    position: relative;
    transition: all var(--duration-slow) var(--ease-smooth);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.archetype-card:hover .card-portrait {
    transform: scale(1.08);
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

.archetype-card .card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%;
    transition: transform var(--duration-slow) var(--ease-smooth);
    display: block;
}

.archetype-card:hover .card-portrait img {
    transform: scale(1.1);
}

.archetype-card .card-name {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.archetype-card .card-greek {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.card-greek .card-script-name {
    display: block;
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.archetype-card .card-domain {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(8px);
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    z-index: 1;
}

.archetype-card:hover .card-domain {
    opacity: 1;
    transform: translateY(0);
}

.archetype-card .card-badge {
    display: inline-block;
    margin-top: var(--space-2);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.archetype-card .card-badge.tier-1 {
    color: var(--gold);
    border-color: rgba(212, 175, 55, 0.15);
}

.archetype-card .card-badge.tier-2 {
    color: var(--text-secondary);
}

.archetype-card .card-badge.dual-tier {
    color: var(--blue);
    border-color: rgba(65, 105, 225, 0.15);
}

.archetype-card .card-badge.awaiting {
    color: var(--text-dim);
}

/* Unbuilt archetype styling */
.archetype-card.unbuilt {
    opacity: 0.4;
    cursor: default;
    filter: grayscale(0.6);
}

.archetype-card.unbuilt:hover {
    transform: none;
    border-color: rgba(212, 175, 55, 0.08);
    background: rgba(20, 20, 20, 0.6);
}

.archetype-card.unbuilt:hover::before {
    box-shadow: none;
}

.archetype-card.unbuilt:hover::after {
    opacity: 0;
}

.archetype-card.unbuilt:hover .card-portrait {
    transform: none;
    border-color: rgba(212, 175, 55, 0.3);
}

/* Card loading skeleton */
.card-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Native scroll reveal — triggered by IntersectionObserver adding .revealed */
.reveal-up, .reveal-scale, .reveal-fade {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-up { opacity: 0; transform: translateY(40px); }
.reveal-up.revealed { opacity: 1; transform: translateY(0); }

.reveal-scale { opacity: 0; transform: scale(0.92); }
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

.reveal-fade { opacity: 0; }
.reveal-fade.revealed { opacity: 1; }

/* Stagger children within [data-stagger] containers */
[data-stagger] .reveal-up { transition-delay: calc(var(--stagger-index, 0) * 60ms); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal-up, .reveal-scale, .reveal-fade {
        opacity: 1;
        transform: none;
        transition: none;
    }
}



/* ─── Toast ─── */
.px-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(20, 20, 20, 0.98);
    color: var(--gold);
    padding: 16px 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gold-dim);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 10000;
    transition: transform 500ms var(--ease-enter), opacity 500ms var(--ease-enter);
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.gold-text { color: var(--gold); }
.dim-text { color: var(--text-dim); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.mb-8 { margin-bottom: var(--space-8); }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }

.hidden { display: none !important; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* ─── Selection ─── */
::selection {
    background: var(--gold);
    color: var(--void);
}

/* ─── Ambient Particles Container ─── */
.ambient-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ambient-particles canvas {
    width: 100%;
    height: 100%;
}

/* ─── Glow Effects ─── */
.glow-gold {
    box-shadow: 0 0 40px var(--gold-glow), 0 0 80px var(--gold-dim);
}

.glow-text {
    text-shadow: 0 0 40px var(--gold-glow), 0 0 80px var(--gold-dim);
}

/* ─── Section Divider ─── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.15), transparent);
    margin: 0 auto;
    max-width: 600px;
}

/* ═══════════════════════════════════════════════════════════
   Performance: content-visibility for off-screen sections
   ═══════════════════════════════════════════════════════════ */

/* Sections below the fold — skip layout/paint until visible */
.section-pantheon,
.section-tiers,
.section-origin,
.section-codex,
.section-cta,
.site-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

/* Pantheon grid cards — each card is independently cullable */
.archetype-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-canvas,
    .ambient-particles canvas {
        display: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   Hero Background — completely static, zero animation
   ═══════════════════════════════════════════════════════════ */

.hero-canvas {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(212,175,55,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(65,105,225,0.03) 0%, transparent 60%);
    opacity: 0.5;
}


/* ─── Minimal Custom Cursor ─── */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
    will-change: transform;
}
.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1.5px solid var(--gold);
    mix-blend-mode: normal;
}

/* Keyboard focus indicator — covers the brand image links
   (.nav-wordmark/.footer-wordmark) and every other focusable. */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
