/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cream: #f5ece3;
    --dark-brown: #5c3d2e;
    --darkest: #3a2519;
    --copper: #b87333;
    --mid-brown: #7a5641;
    --near-black: #2c1810;
    --light-clay: #e8d5c4;
    --warm-brown: #4d3326;
    --shadow-dark: rgba(44, 24, 16, 0.3);
    --shadow-light: rgba(245, 236, 227, 0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    background: var(--cream);
    color: var(--dark-brown);
    overflow-x: hidden;
    line-height: 1.6;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* === SECTIONS === */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    overflow: hidden;
}

.section-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    width: 100%;
    text-align: center;
}

.diagonal-divider {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 120px;
    background: inherit;
    clip-path: polygon(0 0, 100% 60px, 100% 100%, 0 100%);
    z-index: 1;
}

/* === SECTION BACKGROUNDS === */
.section-origin {
    background: var(--cream);
}

.section-field {
    background: var(--light-clay);
}

.section-resonance {
    background: var(--cream);
}

.section-interface {
    background: var(--light-clay);
}

.section-dissolution {
    background: var(--warm-brown);
    color: var(--cream);
}

/* === TYPOGRAPHY === */
.display-heading {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.1;
    letter-spacing: 0.06em;
    color: var(--darkest);
    margin-bottom: 1rem;
}

.display-heading .dot {
    color: var(--copper);
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--mid-brown);
    letter-spacing: 0.04em;
    margin-bottom: 3rem;
}

.section-heading {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.04em;
    color: inherit;
    margin-bottom: 3rem;
}

.section-dissolution .section-heading {
    color: var(--light-clay);
}

/* === MONOPOLE POINT === */
.monopole-point {
    width: 16px;
    height: 16px;
    background: var(--copper);
    border-radius: 50%;
    margin: 0 auto 2rem;
    box-shadow:
        0 0 20px rgba(184, 115, 51, 0.4),
        0 0 60px rgba(184, 115, 51, 0.2);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(184, 115, 51, 0.4), 0 0 60px rgba(184, 115, 51, 0.2); }
    50% { transform: scale(1.3); box-shadow: 0 0 40px rgba(184, 115, 51, 0.6), 0 0 100px rgba(184, 115, 51, 0.3); }
}

/* === WAVE PATHS === */
.wave-container {
    width: 100%;
    height: 120px;
    margin-top: 2rem;
}

.wave-container svg, .closing-wave svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.wave-1 { stroke: var(--copper); opacity: 0.8; }
.wave-2 { stroke: var(--mid-brown); opacity: 0.5; }
.wave-3 { stroke: var(--dark-brown); opacity: 0.3; }
.closing-wave-1 { stroke: var(--light-clay); opacity: 0.6; }
.closing-wave-2 { stroke: var(--copper); opacity: 0.4; }

/* === SCROLL INDICATOR === */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scroll-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mid-brown);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--copper);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* === NEOMORPHIC CARDS === */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.neo-card {
    background: var(--light-clay);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow:
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.neo-card:hover {
    transform: translateY(-4px);
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
}

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

.card-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--darkest);
}

.card-text {
    font-size: 0.85rem;
    color: var(--mid-brown);
    line-height: 1.7;
}

/* === RESONANCE === */
.resonance-display {
    width: 100%;
    height: 200px;
    margin-bottom: 3rem;
    border-radius: 16px;
    overflow: hidden;
    background: var(--light-clay);
    box-shadow:
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

#resonance-canvas {
    width: 100%;
    height: 100%;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.neo-stat {
    background: var(--cream);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 2rem;
    color: var(--copper);
}

.stat-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mid-brown);
    margin-top: 0.25rem;
}

/* === TERMINAL === */
.terminal-block {
    background: var(--near-black);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -4px -4px 12px var(--shadow-light);
}

.terminal-header {
    background: var(--darkest);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--copper);
    opacity: 0.7;
}

.terminal-dot:nth-child(2) { opacity: 0.5; }
.terminal-dot:nth-child(3) { opacity: 0.3; }

.terminal-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--mid-brown);
    margin-left: auto;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 2;
    color: var(--light-clay);
}

.terminal-line .prompt {
    color: var(--copper);
}

.terminal-line .cmd {
    color: var(--cream);
}

.terminal-line.output {
    color: var(--mid-brown);
    padding-left: 1.2rem;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--copper);
}

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

/* === DISSOLUTION === */
.closing-text {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--light-clay);
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.closing-wave {
    width: 100%;
    height: 200px;
    margin-bottom: 3rem;
}

.footer-mark {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1rem;
    font-family: 'Space Mono', monospace;
}

.mono-mark {
    font-size: 1.2rem;
    color: var(--copper);
    letter-spacing: 0.1em;
}

.year {
    font-size: 0.7rem;
    color: var(--mid-brown);
    letter-spacing: 0.2em;
}

/* === LEATHER GRAIN TEXTURE === */
.section::after {
    content: '';
    position: absolute;
    inset: 0;
    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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .section {
        padding: 4rem 1.5rem;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        gap: 1.5rem;
    }

    .terminal-body {
        font-size: 0.7rem;
    }
}
