/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #d4af37 #0a0a0f;
}

body {
    background: #0a0a0f;
    color: #c8c0b0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: #d4af37;
    color: #0a0a0f;
}

/* ===== GRADIENT MESH ===== */
.gradient-mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        conic-gradient(from 45deg at 30% 40%, rgba(212,175,55,0.1), #1a1a22, #0a0a0f, rgba(200,169,80,0.05)),
        radial-gradient(ellipse at 70% 60%, rgba(212,175,55,0.08), transparent 60%);
    background-size: 200% 200%;
    animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100px 100px; }
}

/* ===== FILIGREE DIVIDER ===== */
.filigree-divider {
    width: 100%;
    height: 30px;
    overflow: hidden;
}
.filigree-divider svg {
    width: 100%;
    height: 100%;
}

/* ===== THE FOYER ===== */
.foyer {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.foyer-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.compass-rose {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.compass-rose.visible {
    opacity: 1;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    letter-spacing: 0.02em;
    color: #c8c0b0;
    overflow: hidden;
}

.title-main .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-20px);
}
.title-main .letter.drop {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.title-club {
    font-style: italic;
    color: #d4af37;
    opacity: 0;
}
.title-club.visible {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    color: #8a7e6a;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.subtitle.visible {
    opacity: 1;
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    letter-spacing: 0.02em;
    color: #d4af37;
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

/* ===== THE GRAND TABLE ===== */
.grand-table {
    position: relative;
    padding: 80px 5vw;
    background: #0a0a0f;
    overflow: hidden;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.perspective-card {
    position: relative;
    background: #1a1a22;
    border-top: 4px solid #d4af37;
    padding: 28px 24px;
    border-radius: 2px;
    transform: translateY(30px) rotate(var(--rotate, 0deg));
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
}
.perspective-card.in-view {
    transform: translateY(0) rotate(var(--rotate, 0deg));
    opacity: 1;
}
.perspective-card:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 0 8px 32px rgba(212,175,55,0.15);
    border-top-width: 6px;
}

.card-suit {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 16px;
    color: #8a7e6a;
    transition: color 0.2s ease;
}
.perspective-card:hover .card-suit {
    color: #ffd700;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #c8c0b0;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.card-attribution {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #d4af37;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-body {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: #c8c0b0;
    line-height: 1.7;
}

/* ===== THE DEBATE RING ===== */
.debate-ring {
    position: relative;
    padding: 80px 5vw;
    background: #0a0a0f;
    overflow: hidden;
}

.debate-arena {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.debate-arena.in-view {
    transform: scale(1);
    opacity: 1;
}

.debate-card {
    position: relative;
    background: #1a1a22;
    border-top: 4px solid #d4af37;
    padding: 28px 24px;
    border-radius: 2px;
    flex: 1;
    max-width: 380px;
}
.debate-card--for {
    transform: rotate(-5deg);
    border-left: 3px solid #1a6b4a;
}
.debate-card--against {
    transform: rotate(5deg);
    border-left: 3px solid #8b1a2b;
}

.debate-line {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
}
.debate-line path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}
.debate-arena.in-view .debate-line path {
    stroke-dashoffset: 0;
}

/* ===== THE LIBRARY ===== */
.library {
    position: relative;
    padding: 80px 5vw;
    background: #0a0a0f;
    overflow: hidden;
}

.library-grid {
    columns: 3;
    column-gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.reference-card {
    break-inside: avoid;
    margin-bottom: 16px;
    padding: 20px;
    background: #141418;
    border-left: 2px solid #8a7e6a;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.reference-card.in-view {
    opacity: 1;
}

.ref-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #c8a950;
    margin-bottom: 4px;
}

.ref-author {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: #8a7e6a;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ref-excerpt {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #8a7e6a;
    font-style: italic;
}

/* ===== THE VESTIBULE ===== */
.vestibule {
    padding: 80px 5vw;
    background: #0a0a0f;
    text-align: center;
}

.vestibule-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.motto {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 2rem;
    color: #d4af37;
    line-height: 1.4;
}

.motto-underline {
    width: 0;
    height: 2px;
    background: #d4af37;
    transition: width 0.8s ease;
}
.motto-underline.drawn {
    width: 200px;
}

.footer-compass {
    opacity: 0.5;
    margin: 8px 0;
}

.room-directory {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.room-directory-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a7e6a;
    margin-bottom: 4px;
}

.room-directory a {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: #c8c0b0;
    text-decoration: none;
    transition: color 0.2s ease;
}
.room-directory a:hover {
    color: #d4af37;
}

.copyright {
    font-size: 0.75rem;
    color: #8a7e6a;
    margin-top: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    .debate-arena {
        flex-direction: column;
        gap: 20px;
    }
    .debate-card--for,
    .debate-card--against {
        transform: rotate(0deg);
        max-width: 100%;
    }
    .debate-line {
        transform: rotate(90deg);
        width: 60px;
        height: 40px;
    }
    .library-grid {
        columns: 1;
    }
    .motto {
        font-size: 1.4rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .library-grid {
        columns: 2;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
