/* ============================================
   martiallaw.wiki - Y2K Futurism + Civic Dread
   Crystalline Government Terminal Aesthetic
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --deep-canopy: #0B3D2E;
    --emerald-core: #1A6B4A;
    --verdant-mid: #2E8B57;
    --mint-frost: #A8E6CF;
    --glacier-white: #E8F5E9;
    --pure-white: #FFFFFF;
    --decree-gold: #C4A962;
    --emergency-amber: #E6A817;
    --charcoal-dense: #1A2B22;
    --frost-glass: rgba(168,230,207,0.08);

    --spring-entry: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --spring-hover: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--pure-white);
    background-color: var(--deep-canopy);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HERO SECTION
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--deep-canopy);
    background-image: radial-gradient(ellipse at center, var(--emerald-core) 0%, var(--deep-canopy) 70%);
    background-size: 0% 0%;
    animation: heroGradientReveal 1200ms 200ms ease-out forwards;
}

@keyframes heroGradientReveal {
    0% { background-size: 0% 0%; }
    100% { background-size: 200% 200%; }
}

/* Crystalline Lattice Background */
.hero-lattice {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: latticeFadeIn 1200ms 200ms ease-out forwards;
    background-image:
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 80px,
            rgba(255,255,255,0.03) 80px,
            rgba(255,255,255,0.03) 81px
        ),
        repeating-linear-gradient(
            -60deg,
            transparent,
            transparent 80px,
            rgba(255,255,255,0.03) 80px,
            rgba(255,255,255,0.03) 81px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(255,255,255,0.015) 80px,
            rgba(255,255,255,0.015) 81px
        );
}

@keyframes latticeFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ---- Floating Crystals ---- */
.floating-crystal {
    position: absolute;
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    will-change: transform, opacity;
}

.crystal-1 { width: 80px; top: 8%; left: 12%; animation: crystalFloat 32s linear infinite, crystalEntry 500ms 800ms var(--spring-entry) forwards; }
.crystal-2 { width: 55px; top: 15%; right: 18%; animation: crystalFloat2 28s linear infinite, crystalEntry 500ms 950ms var(--spring-entry) forwards; }
.crystal-3 { width: 45px; top: 60%; left: 8%; animation: crystalFloat3 38s linear infinite, crystalEntry 500ms 1100ms var(--spring-entry) forwards; }
.crystal-4 { width: 35px; top: 70%; right: 10%; animation: crystalFloat 42s linear infinite, crystalEntry 500ms 1250ms var(--spring-entry) forwards; }
.crystal-5 { width: 65px; top: 25%; left: 68%; animation: crystalFloat2 25s linear infinite, crystalEntry 500ms 1400ms var(--spring-entry) forwards; }
.crystal-6 { width: 50px; top: 78%; left: 35%; animation: crystalFloat3 35s linear infinite, crystalEntry 500ms 1550ms var(--spring-entry) forwards; }
.crystal-7 { width: 40px; top: 42%; right: 25%; animation: crystalFloat 30s linear infinite, crystalEntry 500ms 1700ms var(--spring-entry) forwards; }
.crystal-8 { width: 58px; top: 50%; left: 22%; animation: crystalFloat2 45s linear infinite, crystalEntry 500ms 1850ms var(--spring-entry) forwards; }
.crystal-9 { width: 42px; top: 30%; left: 42%; animation: crystalFloat3 33s linear infinite, crystalEntry 500ms 2000ms var(--spring-entry) forwards; }
.crystal-10 { width: 52px; top: 85%; right: 35%; animation: crystalFloat 40s linear infinite, crystalEntry 500ms 2150ms var(--spring-entry) forwards; }

@keyframes crystalEntry {
    0% { opacity: 0; transform: scale(0.5) rotate(-15deg); }
    70% { opacity: 1; transform: scale(1.08) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes crystalFloat {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(3deg); }
    50% { transform: translateY(5px) rotate(-2deg); }
    75% { transform: translateY(-8px) rotate(1.5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes crystalFloat2 {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    33% { transform: translateX(10px) translateY(-12px) rotate(-3deg); }
    66% { transform: translateX(-8px) translateY(8px) rotate(2deg); }
    100% { transform: translateX(0) translateY(0) rotate(0deg); }
}

@keyframes crystalFloat3 {
    0% { transform: translateY(0) translateX(0) rotate(0deg); }
    20% { transform: translateY(-10px) translateX(5px) rotate(2deg); }
    40% { transform: translateY(3px) translateX(-8px) rotate(-1deg); }
    60% { transform: translateY(-7px) translateX(3px) rotate(1.5deg); }
    80% { transform: translateY(5px) translateX(-3px) rotate(-2deg); }
    100% { transform: translateY(0) translateX(0) rotate(0deg); }
}

/* ---- Title Panel (Frosted Glass) ---- */
#title-panel {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 3rem 4rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168,230,207,0.2);
    border-radius: 2px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    animation: titlePanelReveal 400ms 1800ms ease-out forwards;
    max-width: 90vw;
}

@keyframes titlePanelReveal {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

#hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6.5rem);
    color: var(--pure-white);
    line-height: 1.1;
    letter-spacing: 0.01em;
    min-height: 1.2em;
}

.title-cursor {
    display: inline-block;
    width: 3px;
    height: 0.8em;
    background: var(--mint-frost);
    margin-left: 4px;
    animation: cursorBlink 600ms ease-in-out infinite;
    vertical-align: baseline;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--glacier-white);
    margin-top: 1rem;
    letter-spacing: 0.02em;
    opacity: 0;
}

.subtitle-visible {
    animation: subtitleFadeIn 600ms ease-out forwards;
}

@keyframes subtitleFadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 0.85; transform: translateY(0); }
}

/* ---- Scroll Indicator ---- */
#scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    animation: scrollIndicatorIn 600ms 3500ms ease-out forwards;
}

#scroll-indicator svg {
    width: 24px;
    height: 36px;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollIndicatorIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(4px); }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
#content {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
}

/* ---- Content Sections ---- */
.content-section {
    margin-bottom: 2rem;
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
}

.section-header h2 {
    font-family: 'Caveat', cursive;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--pure-white);
    line-height: 1.2;
}

.crystal-cluster svg {
    width: 36px;
    height: 28px;
    flex-shrink: 0;
}

/* ---- Decree Panels ---- */
.decree-panel {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(168,230,207,0.25);
    border-radius: 2px;
    box-shadow: inset 0 0 30px rgba(168,230,207,0.03);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    transition: background 200ms ease, box-shadow 300ms ease, border-color 200ms ease;
}

.decree-panel:hover {
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 0 30px rgba(168,230,207,0.08);
    border-color: rgba(168,230,207,0.4);
}

/* Corner Accents */
.corner-accent {
    position: absolute;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    border: 1px solid var(--decree-gold);
    opacity: 0.6;
    transition: transform 300ms var(--spring-hover);
}

.corner-accent.top-left {
    top: -4px;
    left: -4px;
}

.corner-accent.bottom-right {
    bottom: -4px;
    right: -4px;
}

.decree-panel:hover .corner-accent {
    transform: rotate(90deg);
}

/* Vertical Accent Bar */
.vertical-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--decree-gold), transparent);
    border-radius: 1px;
}

.vertical-accent.warning-accent {
    background: linear-gradient(to bottom, var(--emergency-amber), transparent);
}

/* Panel Content */
.panel-content {
    position: relative;
    z-index: 2;
}

.panel-content h3 {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--pure-white);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.panel-content h4 {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--glacier-white);
    margin-bottom: 0.5rem;
}

.panel-content p {
    color: var(--pure-white);
    margin-bottom: 1rem;
    line-height: 1.72;
}

.panel-content p:last-child {
    margin-bottom: 0;
}

/* Classification Labels */
.classification-label {
    display: inline-block;
    font-family: 'Overpass Mono', monospace;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--decree-gold);
    margin-bottom: 0.75rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(196,169,98,0.2);
    border-radius: 1px;
}

.classification-label.warning {
    color: var(--emergency-amber);
    border-color: rgba(230,168,23,0.3);
}

/* Date Labels */
.date-label {
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mint-frost);
}

/* ---- Panel Row Layouts ---- */
.panel-row {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-row.twin {
    grid-template-columns: 1fr 1fr;
}

.panel-row.trio {
    grid-template-columns: 1fr 1fr 1fr;
}

.panel-row.feature-sidebar {
    grid-template-columns: 2fr 1fr;
}

.panel-row .decree-panel {
    margin-bottom: 0;
}

/* Full-width panels */
.decree-panel.full-width {
    padding-left: 3rem;
}

/* ---- Pull Quote Panels ---- */
.pull-quote-panel {
    position: relative;
    overflow: hidden;
}

.pull-quote-panel blockquote {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--glacier-white);
    line-height: 1.5;
    position: relative;
    z-index: 2;
    padding: 1rem 0;
}

.hexagonal-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.hexagonal-watermark svg {
    width: 100%;
    height: auto;
}

/* ---- Warning Panel ---- */
.warning-panel {
    border-color: rgba(230,168,23,0.25);
}

.warning-panel:hover {
    border-color: rgba(230,168,23,0.4);
}

/* ---- Sidebar Panel ---- */
.sidebar-panel {
    background: rgba(255,255,255,0.03);
}

/* ---- Crystal List ---- */
.crystal-list {
    list-style: none;
    padding: 0;
}

.crystal-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    color: var(--glacier-white);
    font-size: 0.95rem;
    line-height: 1.5;
    border-bottom: 1px solid rgba(168,230,207,0.08);
}

.crystal-list li:last-child {
    border-bottom: none;
}

.list-crystal {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: rgba(168,230,207,0.15);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    margin-top: 0.35rem;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--mint-frost);
    opacity: 0.3;
}

.timeline-event {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 2rem;
}

.timeline-event:last-child {
    padding-bottom: 0;
}

.timeline-obelisk {
    position: absolute;
    left: -12px;
    top: 0;
}

.timeline-obelisk svg {
    width: 12px;
    height: 40px;
}

.timeline-obelisk-pulse {
    animation: obeliskPulse 2s ease-in-out 1;
}

@keyframes obeliskPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timeline-content {
    padding-top: 0.25rem;
}

.timeline-content h4 {
    margin-top: 0.25rem;
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
    margin: 3rem 0;
    text-align: center;
    opacity: 0;
}

.section-divider svg {
    width: 100%;
    max-width: 800px;
    height: 20px;
}

.section-divider.visible {
    animation: dividerGlow 800ms ease-out forwards;
}

@keyframes dividerGlow {
    0% { opacity: 0; }
    50% { opacity: 1; filter: brightness(1.5); }
    100% { opacity: 0.7; filter: brightness(1); }
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal-panel {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--spring-entry), transform 600ms var(--spring-entry);
}

.reveal-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Border flash on entry */
.decree-panel.reveal-panel.visible {
    animation: borderFlash 600ms ease-out;
}

@keyframes borderFlash {
    0% { border-color: rgba(168,230,207,0.25); }
    40% { border-color: rgba(168,230,207,0.5); }
    100% { border-color: rgba(168,230,207,0.25); }
}

/* Row stagger */
.panel-row .decree-panel:nth-child(2) {
    transition-delay: 120ms;
}

.panel-row .decree-panel:nth-child(3) {
    transition-delay: 240ms;
}

/* ============================================
   FOOTER
   ============================================ */
#site-footer {
    position: relative;
    background: var(--charcoal-dense);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    overflow: hidden;
}

.footer-crystals {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.footer-crystal-band {
    width: 100%;
    height: 80px;
}

.footer-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-domain {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--mint-frost);
    margin-bottom: 0.5rem;
}

.footer-note {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.03em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .panel-row.twin,
    .panel-row.trio,
    .panel-row.feature-sidebar {
        grid-template-columns: 1fr;
    }

    .floating-crystal.crystal-6,
    .floating-crystal.crystal-7,
    .floating-crystal.crystal-8,
    .floating-crystal.crystal-9,
    .floating-crystal.crystal-10 {
        display: none;
    }

    #title-panel {
        padding: 2rem 1.5rem;
        max-width: 90vw;
    }

    .decree-panel {
        padding: 1.5rem;
    }

    .decree-panel.full-width {
        padding-left: 2rem;
    }

    #content {
        padding: 3rem 1rem 1rem;
    }

    .section-header {
        padding-left: 0;
    }

    .crystal-cluster svg {
        width: 28px;
        height: 22px;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-event {
        padding-left: 2rem;
    }
}

@media (max-width: 480px) {
    #title-panel {
        padding: 1.5rem 1rem;
    }

    .decree-panel {
        padding: 1.25rem;
    }

    .section-header h2 {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
}
