:root {
    --void-midnight: #0a0e1f;
    --dawn-approach: #0e1329;
    --moonlit-fog: #c8d6e5;
    --dusk-silver: #8899aa;
    --circuit-teal: #5bb8c4;
    --ink-blush: #9b6b8a;
    --twilight-ink: #4a5d73;
    --deep-rule: #0e1a3d;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-midnight);
    color: var(--dusk-silver);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent calc(20% - 1px), rgba(91, 184, 196, 0.12) calc(20% - 1px), rgba(91, 184, 196, 0.12) 20%),
        repeating-linear-gradient(0deg, transparent, transparent calc(25% - 1px), rgba(91, 184, 196, 0.12) calc(25% - 1px), rgba(91, 184, 196, 0.12) 25%);
    background-position: 4px 3px;
    background-size: 100% 100%;
}

.circuit-traces {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.pulse-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--circuit-teal);
    opacity: 0.25;
    animation: pulse-shrink 4s ease-in-out infinite;
}

.pulse-dot:nth-child(2) { animation-delay: -0.7s; }
.pulse-dot:nth-child(3) { animation-delay: -1.4s; }
.pulse-dot:nth-child(4) { animation-delay: -2.1s; }
.pulse-dot:nth-child(5) { animation-delay: -2.8s; }
.pulse-dot:nth-child(6) { animation-delay: -3.5s; }

@keyframes pulse-shrink {
    0%, 100% { transform: scale(0.85); }
    50% { transform: scale(1.15); }
}

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 38%;
    padding-right: 10%;
}

.site-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    color: var(--moonlit-fog);
    opacity: 0;
    transform: translateY(12px);
    animation: title-fade 1.4s ease-out 0.6s forwards;
}

@keyframes title-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-family: 'Kalam', cursive;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--twilight-ink);
    margin-top: 0.5rem;
    min-height: 1.4em;
    position: relative;
}

.subtitle::before {
    content: '|';
    position: absolute;
    left: -0.6em;
    animation: blink-cursor 1s step-end infinite;
    color: var(--circuit-teal);
    opacity: 0;
}

.subtitle.typing::before {
    opacity: 1;
}

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

.content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin-left: 38%;
    padding: 0 2rem 6rem;
}

.section {
    margin-bottom: clamp(4rem, 8vw, 7rem);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

.section-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    color: var(--moonlit-fog);
    margin-bottom: 1rem;
}

.section p {
    margin-bottom: 1.2rem;
}

.annotation {
    font-family: 'Kalam', cursive;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--twilight-ink);
    position: absolute;
    left: -120px;
    width: 100px;
    text-align: right;
    margin-top: 0.5rem;
}

.section {
    position: relative;
}

.breath-mark {
    width: 60px;
    height: 1px;
    background: var(--deep-rule);
    opacity: 0.2;
    margin-top: 2rem;
    animation: breath-draw 1.2s ease-out forwards;
    transform-origin: right;
    transform: scaleX(0);
}

.section.visible .breath-mark {
    transform: scaleX(1);
}

.enso-large {
    position: relative;
    z-index: 1;
    width: 280px;
    height: 280px;
    margin-left: calc(38% - 300px);
    opacity: 0.15;
    margin-bottom: 3rem;
}

.enso-path-large {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: enso-draw 3s ease-out 3s forwards;
}

@keyframes enso-draw {
    to { stroke-dashoffset: 0; }
}

.enso-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.enso-button.visible {
    opacity: 1;
}

.enso-button:hover svg path {
    stroke: var(--ink-blush);
}

#enso-scroll-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.1s linear;
}

/* Ink splatter accents */
.section:nth-child(3)::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -30px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--circuit-teal);
    opacity: 0.08;
    box-shadow:
        8px 5px 0 3px rgba(91, 184, 196, 0.12),
        -4px 8px 0 1px rgba(91, 184, 196, 0.1);
}

@media (max-width: 768px) {
    .hero {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .content {
        margin-left: 0;
        padding: 0 2rem 4rem;
    }

    .annotation {
        position: relative;
        left: 0;
        text-align: left;
        width: auto;
        margin-bottom: 0.5rem;
    }

    .enso-large {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}
