/* ============================================
   alth.ing — Styles
   Icelandic Parliamentary Heritage
   ============================================ */

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

:root {
    --vellum-cream: #f5ede0;
    --volcanic-charcoal: #2a2024;
    --twilight-amber: #e8a347;
    --saga-red: #b8503a;
    --ink-dark: #2c1e1a;
    --thyme-green: #6b8f5e;
    --avens-white: #ede5d4;
    --hotspring-blue: #5a8fa0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.72;
    color: var(--ink-dark);
    background-color: var(--vellum-cream);
    overflow-x: hidden;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.section-heading {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--ink-dark);
    margin-bottom: 1.5rem;
}

.section-heading-light {
    color: var(--twilight-amber);
}

p {
    max-width: 65ch;
    margin-bottom: 1.25rem;
}

em {
    font-style: italic;
}

/* --- Navigation --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(42, 32, 36, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-wordmark {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--vellum-cream);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: letter-spacing 400ms ease;
}

.nav-wordmark:hover {
    letter-spacing: 0.12em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--avens-white);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 300ms ease, color 300ms ease;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--twilight-amber);
}

/* --- Section 1: Hero (The Law Rock) --- */
.section-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #e8a347 0%, #b8503a 45%, #2a2024 100%);
    overflow: hidden;
}

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

.hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--vellum-cream);
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--avens-white);
    opacity: 0.85;
}

/* Corner ornaments */
.corner-ornament {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: 2;
    animation: cornerFadeIn 600ms ease-out forwards;
    opacity: 0;
    transform: scale(0.8);
}

.corner-tl { top: 2rem; left: 2rem; animation-delay: 100ms; }
.corner-tr { top: 2rem; right: 2rem; animation-delay: 200ms; }
.corner-bl { bottom: 2rem; left: 2rem; animation-delay: 300ms; }
.corner-br { bottom: 2rem; right: 2rem; animation-delay: 400ms; }

@keyframes cornerFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll chevron */
.scroll-chevron {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: chevronPulse 2.5s infinite ease-in-out;
    cursor: pointer;
}

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

/* --- Section 2: The Assembly Fields --- */
.section-assembly {
    position: relative;
    background-color: var(--vellum-cream);
    padding: 6rem 2rem;
    overflow: hidden;
}

.section-divider {
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0.6;
}

.assembly-layout {
    display: flex;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.assembly-text {
    flex: 0 0 60%;
    padding-left: clamp(1rem, 5vw, 120px);
}

.assembly-illustrations {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2.5rem;
    padding-right: 1rem;
}

.illustration-item {
    text-align: center;
}

.illustration-item svg {
    width: 80px;
    height: 80px;
}

.illustration-label {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--saga-red);
    margin-top: 0.5rem;
}

/* --- Section 3: The Lawspeaker's Recitation --- */
.section-lawspeaker {
    position: relative;
    background-color: var(--volcanic-charcoal);
    color: var(--avens-white);
    padding: 8rem 2rem;
    overflow: hidden;
    transition: background-color 500ms ease;
}

.knotwork-border {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    opacity: 0.4;
}

.knotwork-left {
    left: 0;
}

.knotwork-left svg {
    width: 40px;
    height: 100%;
}

.knotwork-right {
    right: 0;
}

.knotwork-right svg {
    width: 40px;
    height: 100%;
}

.lawspeaker-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.lawspeaker-content p {
    color: var(--avens-white);
    line-height: 1.72;
}

/* --- Section 4: The Booth Quarter --- */
.section-booths {
    position: relative;
    background-color: var(--vellum-cream);
    padding: 6rem 2rem;
    text-align: center;
    overflow: hidden;
}

.booths-intro {
    max-width: 600px;
    margin: 0 auto 3rem;
    color: var(--ink-dark);
    opacity: 0.85;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.icon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.icon-container {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--avens-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: border-radius 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 300ms ease;
    cursor: pointer;
}

.icon-container:hover {
    border-radius: 20%;
    background: #f0e6d2;
}

.icon-container:hover .icon-svg line,
.icon-container:hover .icon-svg path,
.icon-container:hover .icon-svg circle,
.icon-container:hover .icon-svg ellipse,
.icon-container:hover .icon-svg polyline {
    stroke: var(--twilight-amber);
    transition: stroke 300ms ease;
}

.icon-container:hover .wreath-path {
    opacity: 1;
    stroke: var(--saga-red);
}

.icon-wreath {
    position: absolute;
    top: -8px;
    left: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    pointer-events: none;
}

.icon-wreath svg {
    width: 100%;
    height: 100%;
}

.wreath-path {
    opacity: 0;
    transition: opacity 400ms ease;
}

.icon-svg {
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 2;
}

.icon-svg line,
.icon-svg path,
.icon-svg circle,
.icon-svg ellipse,
.icon-svg polyline {
    transition: stroke 300ms ease;
}

.icon-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink-dark);
    margin-bottom: 0.5rem;
}

.icon-desc {
    font-size: 0.9rem;
    color: var(--ink-dark);
    opacity: 0.75;
    max-width: 240px;
    margin: 0 auto;
    line-height: 1.55;
}

/* --- Section 5: The Closing Verse --- */
.section-closing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--volcanic-charcoal) 0%, #3a2520 40%, var(--twilight-amber) 100%);
    padding: 6rem 2rem;
    overflow: hidden;
}

.closing-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    text-align: center;
}

.closing-quote {
    margin-bottom: 3rem;
}

.closing-quote p {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    line-height: 1.35;
    color: var(--vellum-cream);
    max-width: none;
}

.closing-quote cite {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    font-style: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--avens-white);
    opacity: 0.7;
    margin-top: 1.5rem;
}

.closing-text {
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: var(--avens-white);
    opacity: 0.85;
    line-height: 1.72;
    max-width: 60ch;
    margin: 0 auto;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--ink-dark);
    padding: 2rem;
    text-align: center;
}

.footer-divider {
    max-width: 300px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.footer-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--avens-white);
    opacity: 0.5;
}

/* --- Scroll Reveal Animations --- */
.reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

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

/* Stagger icon cells */
.icon-cell {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.icon-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Background Transition Zones --- */
.section-transition-enter {
    position: relative;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0.5rem 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
    }

    .assembly-layout {
        flex-direction: column;
    }

    .assembly-text {
        flex: 1;
        padding-left: 0;
    }

    .assembly-illustrations {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 1.5rem;
        padding-right: 0;
    }

    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }

    .corner-ornament {
        width: 50px;
        height: 50px;
    }

    .corner-tl { top: 1rem; left: 1rem; }
    .corner-tr { top: 1rem; right: 1rem; }
    .corner-bl { bottom: 1rem; left: 1rem; }
    .corner-br { bottom: 1rem; right: 1rem; }

    .knotwork-border {
        display: none;
    }

    .section-assembly,
    .section-booths {
        padding: 4rem 1.5rem;
    }

    .section-lawspeaker {
        padding: 5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .icon-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1rem;
    }

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