/* ==========================================
   polytical.club — Styles
   Post-corporate optimism, serif-revival
   ========================================== */

/* CSS Custom Properties */
:root {
    --civic-blue: #2b4c7e;
    --coral-dialogue: #e07a5f;
    --sunlit-gold: #f2cc8f;
    --parchment-white: #faf3e8;
    --graphite-ink: #2d3142;
    --fog-gray: #b8c0cc;

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-caption: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--parchment-white);
    color: var(--graphite-ink);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Gradient Background */
.ambient-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2b4c7e, #e07a5f, #f2cc8f);
    opacity: 0.08;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

/* Grid Dots Background */
.grid-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--fog-gray) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   Chamber 1: The Forum (Hero)
   ========================================== */
.chamber {
    position: relative;
    z-index: 1;
}

.chamber-forum {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

@media (max-width: 600px) {
    .chamber-forum {
        padding: 48px 24px;
    }
}

.forum-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Wordmark */
.wordmark-container {
    position: relative;
    margin-bottom: 48px;
}

.wordmark-svg {
    width: 100%;
    max-width: 700px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.wordmark-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 110px;
    font-weight: 700;
    letter-spacing: -0.02em;
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    animation: wordmarkDraw 2.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.wordmark-fill {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    color: var(--civic-blue);
    margin-top: -85px;
    position: relative;
    opacity: 0;
    animation: wordmarkFadeIn 0.8s ease-out 2s forwards;
}

@media (max-width: 600px) {
    .wordmark-fill {
        margin-top: -50px;
    }
}

@keyframes wordmarkDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes wordmarkFadeIn {
    to {
        opacity: 1;
    }
}

/* Forum Tagline */
.forum-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.72;
    color: var(--graphite-ink);
    max-width: 38em;
    margin: 32px auto 0;
    opacity: 0;
    animation: fadeUp 1s ease-out 2.6s forwards;
}

.forum-tagline .highlight {
    color: var(--coral-dialogue);
    font-weight: 600;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Dividers
   ========================================== */
.divider {
    width: 100%;
    padding: 52px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.divider svg {
    width: 100%;
    height: 24px;
    display: block;
}

.divider-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.divider-path.animated {
    animation: drawDivider 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawDivider {
    to {
        stroke-dashoffset: 0;
    }
}

/* ==========================================
   Chamber 2: The Facets (Portfolio Grid)
   ========================================== */
.chamber-facets {
    padding: 0 80px 80px;
}

@media (max-width: 600px) {
    .chamber-facets {
        padding: 0 24px 48px;
    }
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: -0.02em;
    color: var(--civic-blue);
    text-align: center;
    margin-bottom: 64px;
}

/* Facet Grid */
.facet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1080px) {
    .facet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .facet-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual Facet Cards */
.facet {
    position: relative;
    background: rgba(250, 243, 232, 0.6);
    border: 1px solid rgba(184, 192, 204, 0.3);
    padding: 32px 28px 28px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.facet.visible {
    animation: facetReveal 0.6s ease-out forwards;
}

@keyframes facetReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Facet aspect ratio variations */
.facet-landscape {
    grid-row: span 1;
}

.facet-portrait {
    grid-row: span 1;
}

.facet-panoramic {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .facet-panoramic {
        grid-column: span 1;
    }
}

.facet-square {
    grid-row: span 1;
}

/* Facet Hover */
.facet:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(43, 76, 126, 0.08);
}

.facet:hover .facet-illustration .circuit-path {
    stroke: var(--coral-dialogue);
    transition: stroke 0.4s ease-out;
}

.facet:hover .facet-corner::before,
.facet:hover .facet-corner::after {
    width: 20px;
    height: 20px;
}

/* Corner Accents */
.facet-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
}

.facet-corner::before,
.facet-corner::after {
    content: '';
    position: absolute;
    background-color: var(--civic-blue);
    transition: width 0.3s ease-out, height 0.3s ease-out;
}

.facet-corner-tl { top: 8px; left: 8px; }
.facet-corner-tl::before { top: 0; left: 0; width: 16px; height: 1.5px; }
.facet-corner-tl::after { top: 0; left: 0; width: 1.5px; height: 16px; }

.facet-corner-tr { top: 8px; right: 8px; }
.facet-corner-tr::before { top: 0; right: 0; width: 16px; height: 1.5px; }
.facet-corner-tr::after { top: 0; right: 0; width: 1.5px; height: 16px; }

.facet-corner-bl { bottom: 8px; left: 8px; }
.facet-corner-bl::before { bottom: 0; left: 0; width: 16px; height: 1.5px; }
.facet-corner-bl::after { bottom: 0; left: 0; width: 1.5px; height: 16px; }

.facet-corner-br { bottom: 8px; right: 8px; }
.facet-corner-br::before { bottom: 0; right: 0; width: 16px; height: 1.5px; }
.facet-corner-br::after { bottom: 0; right: 0; width: 1.5px; height: 16px; }

/* Corner draw animation */
.facet-corner::before,
.facet-corner::after {
    opacity: 0;
}

.facet.visible .facet-corner::before,
.facet.visible .facet-corner::after {
    animation: cornerDraw 0.4s ease-out 0.4s forwards;
}

@keyframes cornerDraw {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Facet Illustration */
.facet-illustration {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    display: block;
}

.circuit-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke 0.4s ease-out;
}

.facet.visible .circuit-path {
    animation: circuitDraw 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes circuitDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Circuit Nodes */
.circuit-node {
    opacity: 0;
}

.facet.visible .circuit-node {
    animation: nodePulse 0.5s ease-out 1.2s forwards;
}

@keyframes nodePulse {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    60% {
        transform: scale(1.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Facet Typography */
.facet-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--graphite-ink);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.facet-description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    color: rgba(45, 49, 66, 0.7);
    line-height: 1.6;
}

/* ==========================================
   Chamber 3: The Commons (Closing)
   ========================================== */
.chamber-commons {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

@media (max-width: 600px) {
    .chamber-commons {
        padding: 48px 24px;
    }
}

.commons-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(24px);
}

.commons-content.visible {
    animation: fadeUp 1s ease-out forwards;
}

.commons-statement {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--civic-blue);
    line-height: 1.55;
    max-width: 28em;
    margin: 0 auto 48px;
    border: none;
    padding: 0;
}

.commons-email {
    display: inline-block;
    position: relative;
    font-family: var(--font-caption);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--coral-dialogue);
    text-decoration: none;
}

.email-underline {
    display: block;
    width: 0;
    height: 1.5px;
    background: var(--coral-dialogue);
    margin-top: 4px;
    transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.commons-email:hover .email-underline {
    width: 100%;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 1080px) {
    .chamber-forum {
        padding: 64px 48px;
    }
    .chamber-facets {
        padding: 0 48px 64px;
    }
}

@media (max-width: 600px) {
    .wordmark-svg {
        max-width: 100%;
    }

    .section-heading {
        margin-bottom: 40px;
    }

    .facet {
        padding: 24px 20px 20px;
    }

    .facet-grid {
        gap: 24px;
    }
}

/* Selection styling */
::selection {
    background-color: rgba(224, 122, 95, 0.2);
    color: var(--graphite-ink);
}
