:root {
    /* Compliance text: IBM Plex Mono" (Google Fonts fallback), Roboto Slab" (Google Fonts fallback), IntersectionObserver` on individual `<span>` wrapped lines. Each line starts with `opacity: 0. IntersectionObserver` with `threshold: 0.2` to trigger all animations. Each timeline node gets a `data-direction="left"` or `data-direction="right"` attribute. When intersecting: Roboto Slab. This gives it a stamped voice. */
    --abyss: #060e1a;
    --deep: #0a1628;
    --pelagic: #0b2545;
    --twilight: #081c34;
    --current: #1b4965;
    --bio: #62b6cb;
    --foam: #bee9e8;
    --text: #d4e7ed;
    --salt: #eef4f7;
    --headline: "Zilla Slab", Rockwell, Georgia, serif;
    --body: "Roboto Slab", Georgia, serif;
    --mono: "IBM Plex Mono", "Courier New", monospace;
    --spine-x: 40%;
}

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

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--deep);
    color: var(--text);
    font-family: var(--body);
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.85;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)' opacity='0.9'/%3E%3C/svg%3E");
}

main {
    position: relative;
    overflow-x: hidden;
    background-color: var(--deep);
}

main::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--spine-x);
    width: 1px;
    z-index: 3;
    background: linear-gradient(to bottom, var(--current) 0%, var(--current) 44%, var(--bio) 72%, var(--foam) 100%);
    box-shadow: 0 0 4px rgba(27, 73, 101, 0.3), 0 55vh 8px rgba(98, 182, 203, 0.4);
    pointer-events: none;
}

.kelp {
    position: absolute;
    top: 92vh;
    width: 120px;
    height: 210vh;
    z-index: 1;
    overflow: visible;
    pointer-events: none;
    animation: kelp-sway 12s ease-in-out infinite alternate;
}

.kelp path { fill: none; stroke: var(--pelagic); stroke-width: 2; opacity: 0.58; }
.kelp path + path { stroke-width: 1; opacity: 0.42; }
.kelp--left { left: 2vw; }
.kelp--right { right: 2vw; animation-delay: -6s; }

@keyframes kelp-sway {
    from { transform: translateX(-12px); }
    50% { transform: translateX(5px); }
    to { transform: translateX(14px); }
}

.zone {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    margin-bottom: -2vh;
    padding: 10vh 0;
}

.zone-label {
    position: absolute;
    top: 4vh;
    left: calc(var(--spine-x) + 18px);
    z-index: 5;
    color: var(--current);
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.zone--surface {
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, var(--pelagic), var(--deep));
}

.surface-inner { width: 100%; padding: 0 8vw; }

.wordmark-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4vh;
    color: var(--current);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.wordmark {
    color: var(--salt);
    font-family: var(--headline);
    font-size: clamp(3.5rem, 12vw, 9rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: rotate(-2deg);
    text-shadow: 0 0 24px rgba(98, 182, 203, 0.14);
}

.wordmark span { color: var(--bio); }

.wordmark-tag {
    max-width: 520px;
    margin-top: 6vh;
    color: var(--text);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    letter-spacing: 0.02em;
}

.zone--thermocline {
    min-height: 115vh;
    padding: 14vh 0 12vh;
    background: linear-gradient(to bottom, var(--pelagic), var(--deep));
}

.node {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    margin: 10vh 0;
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.node--left { justify-content: flex-end; padding-right: calc(100% - var(--spine-x) + 40px); transform: translateX(-60px); }
.node--right { justify-content: flex-start; padding-left: calc(var(--spine-x) + 40px); transform: translateX(60px); }
.node.is-visible { opacity: 1; transform: translateX(0); }

.node-body {
    max-width: 520px;
    padding: 28px 32px;
    background: rgba(6, 14, 26, 0.46);
}

.node--left .node-body { border-left: 3px solid var(--bio); text-align: right; }
.node--right .node-body { border-right: 3px solid var(--foam); text-align: left; }

.node-index {
    display: block;
    margin-bottom: 14px;
    color: var(--bio);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.node--right .node-index { color: var(--foam); }

.node h2 {
    margin-bottom: 18px;
    color: var(--salt);
    font-family: var(--headline);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.07;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.node p { color: var(--text); }

.node-dot {
    position: absolute;
    left: var(--spine-x);
    top: 50%;
    z-index: 6;
    width: 8px;
    height: 8px;
    border: 2px solid var(--bio);
    border-radius: 50%;
    background: var(--deep);
    transform: translate(-50%, -50%);
    transition: background-color 400ms ease, box-shadow 400ms ease;
}

.node.is-visible .node-dot,
.work-band.is-visible .node-dot { background: var(--bio); box-shadow: 0 0 8px rgba(98, 182, 203, 0.5); }

.node-connector {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 40px;
    height: 1px;
    background: var(--current);
}

.node--left .node-connector { left: var(--spine-x); transform: translateX(-40px); }
.node--right .node-connector { left: var(--spine-x); }

.zone--twilight {
    padding: 10vh 0 8vh;
    background: var(--twilight);
}

.work-band {
    position: relative;
    z-index: 4;
    min-height: 80vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-band.is-visible { opacity: 1; transform: translateY(0); }
.work-band[data-direction="left"] { padding: 6vh calc(100% - var(--spine-x) + 56px) 6vh 8vw; }
.work-band[data-direction="right"] { padding: 6vh 8vw 6vh calc(var(--spine-x) + 56px); }
.node-dot--band { left: var(--spine-x); }

.work-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 18px;
    color: var(--bio);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.work-meta span:first-child { color: var(--salt); }
.work-meta span:last-child { color: var(--current); }

.work-band h3 {
    margin-bottom: 26px;
    color: var(--salt);
    font-family: var(--headline);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.work-line {
    display: block;
    width: 70vw;
    max-width: 70%;
    height: 4px;
    margin-bottom: 18px;
}

.work-line line {
    stroke: var(--current);
    stroke-width: 1;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-band.is-visible .work-line line { stroke-dashoffset: 0; }

.work-band p {
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    opacity: 0.68;
}

.zone--midnight {
    min-height: 115vh;
    padding: 16vh 0 14vh;
    background: linear-gradient(to bottom, var(--twilight), var(--abyss));
}

.philosophy {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 6vw;
}

.philosophy p {
    color: var(--salt);
    font-family: var(--headline);
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    line-height: 1.45;
    letter-spacing: 0.02em;
}

.line {
    display: block;
    margin-bottom: 0.35em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: calc(var(--line-index) * 120ms);
}

.line:nth-child(even) { color: var(--text); }
.line.is-visible { opacity: 1; transform: translateY(0); }

.zone--trench {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abyss);
}

.trench-inner { position: relative; z-index: 5; text-align: center; }

.spine-terminus {
    width: 14px;
    height: 14px;
    margin: 0 auto 5vh;
    border-radius: 50%;
    background: var(--bio);
    animation: trench-pulse 3s ease-in-out infinite;
}

@keyframes trench-pulse {
    0%, 100% { box-shadow: 0 0 4px #62b6cb, 0 0 12px rgba(98, 182, 203, 0.3); background: #62b6cb; }
    50% { box-shadow: 0 0 8px #bee9e8, 0 0 24px rgba(190, 233, 232, 0.4); background: #bee9e8; }
}

.trench-email {
    color: var(--salt);
    font-family: var(--mono);
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-bottom: 1px solid var(--current);
    transition: color 300ms ease, border-color 300ms ease, letter-spacing 400ms ease;
}

.trench-email:hover { color: var(--foam); border-color: var(--foam); letter-spacing: 0.08em; }

.depth-indicator {
    position: fixed;
    top: 50%;
    right: 28px;
    z-index: 50;
    width: 2px;
    height: 60px;
    overflow: hidden;
    background: rgba(27, 73, 101, 0.35);
    transform: translateY(-50%);
}

.depth-indicator-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--bio);
    box-shadow: 0 0 6px rgba(98, 182, 203, 0.55);
}

@media (max-width: 1024px) {
    .kelp { display: none; }
}

@media (max-width: 768px) {
    :root { --spine-x: 24px; }
    .zone-label { left: 48px; }
    .surface-inner { padding: 0 24px 0 48px; }
    .wordmark-meta { flex-direction: column; gap: 6px; }
    .wordmark { font-size: clamp(2.8rem, 14vw, 5rem); }
    .node--left,
    .node--right { justify-content: flex-start; padding-left: 48px; padding-right: 24px; transform: translateX(-40px); }
    .node--left .node-body,
    .node--right .node-body { text-align: left; border-right: none; border-left: 3px solid var(--bio); }
    .node--right .node-body { border-left-color: var(--foam); }
    .node--left .node-connector,
    .node--right .node-connector { left: var(--spine-x); width: 16px; transform: none; }
    .work-band[data-direction="left"],
    .work-band[data-direction="right"] { padding-left: 48px; padding-right: 24px; }
    .work-line { max-width: 82%; width: 82%; }
    .philosophy { padding: 0 24px 0 48px; }
    .depth-indicator { display: none; }
}

@media (max-width: 480px) {
    .wordmark { font-size: clamp(2.2rem, 15vw, 4rem); }
    .node h2,
    .work-band h3 { font-size: clamp(1.45rem, 8vw, 2.4rem); }
    .node-body { padding: 22px 20px; }
}
