/* =============================================
   polytical.club — Evolved-Minimal Coastal
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --fog-gray: #c8cfd6;
    --driftwood-sand: #d9cbb8;
    --tide-ink: #1b2838;
    --shoreline-blue: #5b8a9a;
    --weathered-white: #f0ece4;
    --barnacle: #6b5e50;
    --storm-charcoal: #2e3640;
    --sea-glass: #8fbcb0;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-accent: 'DM Sans', Helvetica, Arial, sans-serif;

    --text-margin-left: clamp(2rem, 8vw, 12rem);
    --text-max-width: 680px;
    --section-spacing: clamp(6rem, 12vh, 10rem);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--tide-ink);
    background-color: var(--fog-gray);
    overflow-x: hidden;
    position: relative;
}

/* --- Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    background-repeat: repeat;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

body.storm-active #grain-overlay {
    opacity: 0.07;
}

/* --- Fixed Navigation --- */
#fixed-nav {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#fixed-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.nav-domain {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--tide-ink);
    text-decoration: none;
    cursor: default;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 33.333vh;
    overflow: hidden;
}

.hero-content {
    margin-left: var(--text-margin-left);
    position: relative;
    z-index: 2;
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--tide-ink);
    opacity: 0;
    filter: blur(12px);
    transition: opacity 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hero-title.revealed {
    opacity: 1;
    filter: blur(0);
}

#hero-tagline {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--shoreline-blue);
    margin-top: 0.75rem;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hero-tagline.revealed {
    opacity: 1;
    filter: blur(0);
}

/* --- Section Backgrounds --- */
.section-fog {
    background-color: var(--fog-gray);
}

.section-sand {
    background-color: var(--driftwood-sand);
}

.section-warm {
    background-color: var(--weathered-white);
}

.section-storm {
    background-color: var(--storm-charcoal);
    transition: background-color 200ms ease;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    width: 100%;
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
    z-index: 2;
}

.section-inner {
    margin-left: var(--text-margin-left);
    max-width: var(--text-max-width);
    padding-right: 1.5rem;
}

/* --- Section Labels --- */
.section-label {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--barnacle);
    display: block;
    margin-bottom: 1.5rem;
}

.section-label-storm {
    color: var(--sea-glass);
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--tide-ink);
    margin-bottom: 2rem;
}

.section-heading-storm {
    color: var(--weathered-white);
}

/* --- Section Body --- */
.section-body p {
    margin-bottom: 1.5em;
    max-width: var(--text-max-width);
}

.section-body p:last-child {
    margin-bottom: 0;
}

.section-body-storm {
    color: var(--weathered-white);
}

/* --- Links --- */
.section-body a {
    color: var(--tide-ink);
    text-decoration: underline;
    text-decoration-color: var(--shoreline-blue);
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color 200ms ease, text-decoration-thickness 200ms ease;
}

.section-body a:hover {
    color: var(--shoreline-blue);
    text-decoration-thickness: 2px;
}

.section-body a:visited {
    text-decoration-color: var(--barnacle);
}

/* --- Section Dividers --- */
.section-divider {
    width: 0%;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--shoreline-blue) 20%, var(--shoreline-blue) 50%, transparent 80%);
    margin-bottom: 2.5rem;
    transition: width 600ms ease-out;
}

.section-divider.animate {
    width: 60%;
}

.section-divider-storm {
    background: linear-gradient(to right, transparent 0%, var(--sea-glass) 20%, var(--sea-glass) 50%, transparent 80%);
}

/* --- Pull Quote --- */
.pull-quote-section {
    position: relative;
    width: 100%;
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
    z-index: 2;
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.4;
    color: var(--shoreline-blue);
    max-width: 900px;
    margin-left: var(--text-margin-left);
    padding-right: 2rem;
}

/* --- Full-bleed Images --- */
.full-bleed-image {
    position: relative;
    width: 100%;
    z-index: 2;
    overflow: hidden;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        135deg,
        var(--fog-gray) 0%,
        var(--driftwood-sand) 30%,
        var(--shoreline-blue) 60%,
        var(--storm-charcoal) 100%
    );
    filter: saturate(0.7);
    position: relative;
}

.image-placeholder-2 {
    background: linear-gradient(
        -45deg,
        var(--driftwood-sand) 0%,
        var(--barnacle) 25%,
        var(--shoreline-blue) 55%,
        var(--fog-gray) 100%
    );
}

.image-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    mix-blend-mode: multiply;
    opacity: 0.15;
}

/* --- Blur-Focus Animation --- */
.blur-child {
    opacity: 0.3;
    filter: blur(6px);
    transition: opacity 900ms ease-out, filter 900ms ease-out;
}

.blur-child.focused {
    opacity: 1;
    filter: blur(0);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.footer-inner {
    margin-left: var(--text-margin-left);
    max-width: var(--text-max-width);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-domain {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--barnacle);
}

.footer-year {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    color: var(--barnacle);
    opacity: 0.6;
}

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

    .blur-child {
        opacity: 1;
        filter: none;
    }

    #hero-title,
    #hero-tagline {
        opacity: 1;
        filter: none;
    }

    #particle-canvas {
        display: none;
    }
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    :root {
        --text-margin-left: 1.5rem;
    }

    .pull-quote {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .section-inner {
        padding-right: 1.5rem;
    }
}