/* ========================================
   voting.wiki - Cottagecore Civic Design
   ======================================== */

/* Root Variables */
:root {
    /* Colors */
    --ink-black: #0A0A0A;
    --parchment-cream: #FFF8F0;
    --hedgerow-green: #2D5F3A;
    --rosehip-red: #C23B22;
    --bramble-brown: #6B4F3A;
    --ballot-white: #FEFCF7;
    --slate-charcoal: #1E1E1E;
    --pressed-lavender: #7B6D8E;
    --ticker-bg: #F5EDE0;

    /* Typography */
    --font-serif-display: 'Playfair Display', serif;
    --font-sans-main: 'Space Grotesk', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-hand: 'Caveat', cursive;

    /* Spacing */
    --gap-main: 16px;
    --gap-outer: 24px;
    --border-width: 2px;
    --gutter: 16px;
}

/* Global Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans-main);
    background-color: var(--parchment-cream);
    color: var(--ink-black);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* Paper Texture Overlay */
.page-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100" height="100" fill="%23FFF8F0" filter="url(%23noise)" opacity="0.04"/></svg>');
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
}

/* ========================================
   HERO MODULE
   ======================================== */

.hero-module {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background-color: var(--parchment-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-outer);
    overflow: hidden;
    z-index: 10;
}

.hero-container {
    max-width: 900px;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

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

.hero-title {
    font-family: var(--font-sans-main);
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink-black);
    margin-bottom: 1.5rem;
    white-space: nowrap;
}

.hero-divider {
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-divider svg {
    width: 100%;
    max-width: 600px;
}

.divider-line {
    opacity: 0;
    animation: drawLine 1.2s ease-in-out 1s forwards;
}

@keyframes drawLine {
    from {
        stroke-dasharray: 500;
        stroke-dashoffset: 500;
        opacity: 1;
    }
    to {
        stroke-dasharray: 500;
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.divider-ornament {
    opacity: 0;
    animation: fadeIn 0.6s ease-in 2s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-tagline {
    font-family: var(--font-serif-display);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 400;
    font-style: italic;
    color: var(--hedgerow-green);
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 2.5s forwards;
}

.hero-illustration {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
    opacity: 0;
    animation: fadeInScale 1.2s ease-out 2s forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ballot-illustration {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.hero-scroll-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-black);
    opacity: 0;
    animation: fadeInFloat 0.8s ease-out 3.2s forwards;
}

@keyframes fadeInFloat {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-scroll-prompt svg {
    animation: bobbing 1.5s ease-in-out infinite;
}

@keyframes bobbing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ========================================
   TICKER STRIP
   ======================================== */

.ticker-strip {
    width: 100%;
    background-color: var(--ticker-bg);
    border-top: 1px solid var(--ink-black);
    border-bottom: 1px solid var(--ink-black);
    padding: 1rem 0;
    overflow: hidden;
    z-index: 9;
}

.ticker-content {
    overflow: hidden;
    white-space: nowrap;
}

.ticker-text {
    display: inline-flex;
    animation: tickerScroll 45s linear infinite;
}

.ticker-text span {
    display: inline;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-black);
    padding-right: 4rem;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========================================
   CONTENT GRID (BENTO LAYOUT)
   ======================================== */

.content-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap-main);
    padding: var(--gap-outer);
    max-width: 1400px;
    margin: 0 auto;
    z-index: 5;
    position: relative;
}

/* Bento Module Base Styles */
.bento-module {
    border: var(--border-width) solid var(--ink-black);
    padding: 1.5rem;
    background-color: var(--ballot-white);
    position: relative;
    transition: all 0.3s ease;
    opacity: 0;
    animation: moduleAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.bento-module[data-module="01"] { animation-delay: 0.1s; }
.bento-module[data-module="02"] { animation-delay: 0.19s; }
.bento-module[data-module="03"] { animation-delay: 0.27s; }
.bento-module[data-module="04"] { animation-delay: 0.35s; }
.bento-module[data-module="05"] { animation-delay: 0.43s; }
.bento-module[data-module="06"] { animation-delay: 0.52s; }

.bento-module:hover {
    border-color: var(--hedgerow-green);
    box-shadow: inset 0 0 0 1px var(--hedgerow-green);
}

.bento-module h2 {
    font-family: var(--font-sans-main);
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.bento-module p {
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 65ch;
    margin-bottom: 1rem;
}

.module-folio {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--bramble-brown);
    text-transform: uppercase;
}

.module-corner-ornament {
    position: absolute;
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
}

.module-corner-ornament.tl {
    top: 0.75rem;
    left: 0.75rem;
}

.module-corner-ornament.br {
    bottom: 0.75rem;
    right: 0.75rem;
}

.bento-module:hover .module-corner-ornament svg {
    stroke: var(--hedgerow-green);
    transform: scale(1.2);
}

/* Feature Module Specific */
.feature-module {
    border-top: var(--border-width) solid var(--ink-black);
    border-right: var(--border-width) solid var(--ink-black);
    border-bottom: var(--border-width) solid var(--ink-black);
    border-left: 3px solid var(--hedgerow-green);
}

.feature-border-left {
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: repeating-linear-gradient(to bottom, var(--hedgerow-green) 0, var(--hedgerow-green) 20px, transparent 20px, transparent 40px);
}

.feature-border-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1.5rem;
    height: 1px;
    background: repeating-linear-gradient(to right, var(--hedgerow-green) 0, var(--hedgerow-green) 20px, transparent 20px, transparent 40px);
}

.feature-content {
    margin-top: 2rem;
}

.drop-cap {
    font-family: var(--font-serif-display);
    font-size: 4em;
    font-style: italic;
    color: var(--hedgerow-green);
    float: left;
    line-height: 0.85;
    margin-right: 8px;
    margin-top: -2px;
}

.feature-intro {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.feature-content p + p {
    margin-top: 1.2rem;
}

/* ========================================
   SIDEBAR ALMANAC
   ======================================== */

.sidebar-almanac {
    border: var(--border-width) solid var(--ink-black);
    padding: 1.5rem;
    background-color: var(--ballot-white);
    position: sticky;
    top: var(--gap-outer);
    height: fit-content;
    opacity: 0;
    animation: moduleAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.almanac-header {
    font-family: var(--font-serif-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--pressed-lavender);
}

.almanac-timeline {
    margin-bottom: 2rem;
}

.timeline-node {
    margin-bottom: 1.5rem;
    transform: rotate(-1deg);
}

.timeline-date {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--rosehip-red);
    margin-bottom: 0.4rem;
    letter-spacing: 0.1em;
}

.timeline-note {
    font-family: var(--font-hand);
    font-size: 14px;
    line-height: 1.5;
    color: var(--bramble-brown);
    margin: 0;
}

.almanac-fact-box {
    border: 1px dotted var(--hedgerow-green);
    padding: 1rem;
    background-color: var(--parchment-cream);
    margin-top: 1.5rem;
}

.fact-header {
    font-family: var(--font-serif-display);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.fact-text {
    font-size: 0.9rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--bramble-brown);
    margin: 0;
}

/* ========================================
   FOOTER
   ======================================== */

.page-footer {
    background-color: var(--slate-charcoal);
    color: var(--parchment-cream);
    padding: var(--gap-outer);
    text-align: center;
    margin-top: var(--gap-outer);
    z-index: 5;
    position: relative;
}

.footer-divider {
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.footer-divider svg {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
}

.wheat-motif {
    opacity: 0;
    animation: fadeIn 0.6s ease-in 0.3s forwards;
}

.footer-text {
    font-family: var(--font-serif-display);
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    line-height: 1.6;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    :root {
        --gap-main: 12px;
        --gap-outer: 16px;
        --gutter: 12px;
    }

    .hero-module {
        padding: var(--gap-outer);
    }

    .hero-title {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .hero-tagline {
        font-size: clamp(1rem, 2.5vw, 1.5rem);
    }

    .content-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: var(--gap-main);
        padding: var(--gap-outer);
    }

    .bento-module {
        grid-column: span 12 !important;
    }

    .feature-module {
        grid-row: auto !important;
    }

    .sidebar-almanac {
        grid-column: span 12 !important;
        grid-row: auto !important;
        position: static;
    }

    .feature-border-left,
    .feature-border-bottom {
        display: none;
    }

    .ticker-text span {
        font-size: 11px;
        padding-right: 2rem;
    }

    .module-folio {
        font-size: 9px;
    }

    .hero-illustration {
        max-width: 150px;
    }

    .drop-cap {
        font-size: 3em;
        margin-right: 4px;
    }
}

@media (max-width: 480px) {
    :root {
        --gap-main: 8px;
        --gap-outer: 12px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .bento-module h2 {
        font-size: 1.1rem;
    }

    .bento-module p {
        font-size: 0.9rem;
    }

    .feature-intro {
        font-size: 1rem;
    }

    .drop-cap {
        font-size: 2.5em;
    }

    .hero-scroll-prompt {
        font-size: 11px;
    }
}

/* ========================================
   ACCESSIBILITY & UTILITIES
   ======================================== */

.svg-filters {
    display: none;
}

a {
    color: var(--hedgerow-green);
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--rosehip-red);
}

/* Scroll Indicator (optional) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--parchment-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--hedgerow-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rosehip-red);
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }

    .page-texture {
        display: none;
    }

    .hero-module {
        min-height: auto;
        page-break-after: always;
    }

    .bento-module,
    .sidebar-almanac {
        page-break-inside: avoid;
    }
}
