/* Reset and Root Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: #0b1d0f;
    color: #e8f0e4;
    line-height: 1.85;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    overflow-x: hidden;
    position: relative;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Typography Hierarchy */
h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    margin-bottom: 1.5em;
    margin-top: 1em;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.06em;
    color: #e8f0e4;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #52b788;
    margin-bottom: 1em;
}

p {
    margin-bottom: 1.5em;
    line-height: 1.85;
}

code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #6b8f71;
}

/* Link Styles */
a {
    color: #2d6a4f;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
    color: #52b788;
    text-decoration-thickness: 2px;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding-left: 15%;
    background: #0b1d0f;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    animation: heroFadeIn 1.2s ease-out forwards;
}

.hero-title {
    color: #e8f0e4;
    margin-bottom: 0.5em;
    letter-spacing: -0.02em;
    font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 1.1;
}

.hero-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.1rem;
    color: #e8f0e4;
    opacity: 0.7;
    font-weight: 400;
    max-width: 400px;
    line-height: 1.65;
    animation: taglineFadeIn 1.8s ease-out forwards;
    animation-delay: 1.2s;
}

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

@keyframes taglineFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* Aurora Background */
.aurora-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, #0b1d0f 0%, #1b4332 25%, #2d6a4f 45%, #52b788 60%, #95d5b2 72%, #52b788 85%, #1b4332 100%);
    background-size: 100% 200%;
    animation: auroraFlow 20s ease-in-out infinite;
    z-index: 1;
    filter: url(#auroraNoiseFilter);
    opacity: 0.8;
}

@keyframes auroraFlow {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 0% 100%;
    }
}

/* Particle System */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #52b788;
    border-radius: 50%;
    opacity: 0.3;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% {
        transform: translate(0, 0);
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translate(var(--drift-x, 50px), var(--drift-y, -100vh));
        opacity: 0.1;
    }
}

/* Content Layout */
.content-wrapper {
    position: relative;
    z-index: 5;
    background-color: #0b1d0f;
}

.content-section {
    padding: 6rem 0;
    border-bottom: 1px solid rgba(45, 106, 79, 0.1);
}

.content-section:last-of-type {
    border-bottom: none;
}

.content-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
}

/* Wide Column */
.wide-column {
    grid-column: 1;
    margin-left: 15%;
    margin-right: 15%;
    max-width: 600px;
}

.wide-column h2 {
    color: #e8f0e4;
    margin-bottom: 1.5em;
}

.wide-column p {
    color: #e8f0e4;
}

/* Narrow Sideboard */
.narrow-sideboard {
    grid-column: 1;
    margin-left: auto;
    margin-right: 10%;
    width: 200px;
    font-size: 0.9rem;
    color: #6b8f71;
}

.narrow-sideboard h3 {
    color: #52b788;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8em;
}

.narrow-sideboard ul {
    list-style: none;
    margin-bottom: 1em;
}

.narrow-sideboard li {
    padding-left: 1em;
    margin-bottom: 0.5em;
    position: relative;
}

.narrow-sideboard li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2d6a4f;
}

.annotation-note {
    font-size: 0.8rem;
    color: #6b8f71;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid rgba(107, 143, 113, 0.3);
    font-family: 'IBM Plex Mono', monospace;
}

/* Full-Width Interruptions */
.full-width-interruption {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 8rem 4rem;
    background-color: #0b1d0f;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    border-top: 1px solid rgba(45, 106, 79, 0.15);
    border-bottom: 1px solid rgba(45, 106, 79, 0.15);
}

.interruption-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.interruption-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
    color: #e8f0e4;
    letter-spacing: 0.06em;
    line-height: 1.3;
    position: relative;
    z-index: 11;
    margin: 2rem 0;
}

.interruption-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
    color: #95d5b2;
    letter-spacing: 0.06em;
    line-height: 1.3;
    margin-bottom: 3rem;
    position: relative;
    z-index: 11;
}

/* Aurora Animation in Interruptions */
.aurora-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(45, 106, 79, 0.3) 20%,
        rgba(82, 183, 136, 0.4) 40%,
        rgba(149, 213, 178, 0.3) 60%,
        rgba(82, 183, 136, 0.3) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: auroraShift 3s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes auroraShift {
    0%, 100% {
        background-position: 0% 0%;
        opacity: 0.2;
    }
    50% {
        background-position: 100% 0%;
        opacity: 0.4;
    }
}

/* Tree Rings */
.tree-rings {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
    filter: drop-shadow(0 0 20px rgba(82, 183, 136, 0.2));
}

.tree-ring {
    position: absolute;
    border: 1px solid rgba(82, 183, 136, 0.15);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ringPulse 8s ease-in-out infinite;
}

@keyframes ringPulse {
    0% {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.25;
    }
    100% {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Fern Dividers */
.fern-divider {
    width: 100%;
    max-width: 400px;
    height: 80px;
    display: block;
    margin: 2rem auto;
    animation: fernDraw 1.5s ease-in-out forwards;
}

.fern-divider path {
    animation: fernStroke 1.5s ease-in-out forwards;
}

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

@keyframes fernStroke {
    from {
        stroke-dashoffset: 200;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.final-fern {
    animation: fernDraw 1.5s ease-in-out forwards, fernReverseStroke 1.5s ease-in-out forwards;
}

@keyframes fernReverseStroke {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -200;
    }
}

/* Closing Statement */
.closing-statement {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #95d5b2;
    letter-spacing: 0.02em;
    line-height: 1.6;
    margin-top: 2em;
}

/* Footer */
.footer {
    padding: 3rem 4rem;
    text-align: center;
    color: #6b8f71;
    font-size: 0.9rem;
    border-top: 1px solid rgba(45, 106, 79, 0.15);
    font-family: 'IBM Plex Mono', monospace;
}

/* Zoom Focus Animation for Elements */
.zoom-focus {
    animation: zoomFocusEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoomFocusEnter {
    from {
        opacity: 0;
        transform: scale(1.06);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Stagger animation for multiple elements */
.content-section > .content-row > div:nth-child(1) {
    animation-delay: 0ms;
}

.content-section > .content-row > div:nth-child(2) {
    animation-delay: 120ms;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-row {
        grid-template-columns: 1fr;
        padding: 0 2rem;
    }

    .wide-column {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    .narrow-sideboard {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        margin-top: 2rem;
    }

    .hero {
        padding-left: 2rem;
    }

    .full-width-interruption {
        padding: 4rem 2rem;
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .hero {
        height: auto;
        min-height: 70vh;
        padding: 2rem;
        padding-left: 2rem;
    }

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

    .hero-tagline {
        font-size: 0.95rem;
    }

    .content-section {
        padding: 3rem 0;
    }

    .full-width-interruption {
        padding: 2rem 1rem;
    }

    .interruption-text,
    .interruption-heading {
        font-size: clamp(1.2rem, 3vw, 2rem);
    }

    .footer {
        padding: 2rem 1rem;
    }
}

/* Will-change optimizations */
.aurora-container {
    will-change: background-position;
}

.particle {
    will-change: transform;
}

.aurora-animation {
    will-change: background-position;
}

/* Selection Styling */
::selection {
    background-color: rgba(82, 183, 136, 0.3);
    color: #e8f0e4;
}

::-moz-selection {
    background-color: rgba(82, 183, 136, 0.3);
    color: #e8f0e4;
}
