:root {
    --deep-canopy: #0B3D2E;
    --moss-shadow: #1A4D3A;
    --lichen-gold: #C8A951;
    --spring-cream: #F4F1E8;
    --displaced-teal: #4BD4C7;
    --pale-celadon: #E8F0E4;
    --sage-mist: #C8D8C0;
    --muted-sage: #7DA88C;
    --deep-moss: #2A3D32;
    --frosted-fern: #1A2B22;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Design vocabulary retained: (Google Fonts, Intersection Observer trigger, Intersection Observer. The upper-right anchor holds a single rotating line-illustration of a sine wave transforming into speech waveforms — an animated SVG that loops infinitely at a meditative pace. Between these two anchors, Space Grotesk provides the scholarly backbone — precise without being sterile, with moderate scale and generous letter-spacing. */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--deep-canopy);
    color: var(--sage-mist);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background-image: repeating-linear-gradient(0deg, rgba(75, 212, 199, 0.02) 0, rgba(75, 212, 199, 0.02) 3px, transparent 3px, transparent 6px);
    mix-blend-mode: screen;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 77% 12%, rgba(75, 212, 199, 0.11), transparent 18rem),
        radial-gradient(circle at 13% 70%, rgba(200, 169, 81, 0.07), transparent 22rem),
        linear-gradient(115deg, rgba(26, 77, 58, 0.36), transparent 48%);
}

main,
.tone-spectrum-bar,
.floating-element {
    position: relative;
    z-index: 2;
}

.tone-spectrum-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--deep-canopy), var(--displaced-teal), var(--lichen-gold));
    pointer-events: none;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", Inter, sans-serif;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: var(--pale-celadon);
}

p {
    max-width: 68ch;
}

.marginalia,
.panel-index,
.case-label,
.copyright,
.marquee-text {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--muted-sage);
}

.z-row {
    position: relative;
    min-height: 100vh;
    padding: clamp(2rem, 4vw, 5rem);
    background-color: var(--deep-canopy);
}

.z-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr 2fr 1fr 1fr 2fr 1fr 1fr 1fr;
    grid-auto-rows: minmax(9rem, auto);
    gap: clamp(1rem, 2vw, 2.5rem);
    width: 100%;
    max-width: 1620px;
    min-height: calc(100vh - clamp(4rem, 8vw, 10rem));
    margin: 0 auto;
}

.z-anchor,
.z-center,
.case-study,
.terminal-content {
    position: relative;
    z-index: 4;
}

.opening-grid {
    align-items: start;
}

.anchor-upper-left {
    grid-column: 1 / 5;
    grid-row: 1;
    align-self: start;
}

.anchor-upper-right {
    grid-column: 8 / 13;
    grid-row: 1 / 3;
    align-self: start;
    justify-self: end;
    text-align: right;
}

.logotype {
    margin-top: 0.55rem;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    text-shadow: 0.05em 0 rgba(75, 212, 199, 0.18), -0.035em 0 rgba(200, 169, 81, 0.11);
}

.tagline-container {
    grid-column: 4 / 10;
    grid-row: 3;
    align-self: center;
    justify-self: center;
    text-align: center;
}

.tagline {
    color: var(--pale-celadon);
    font-size: clamp(1.35rem, 2.4vw, 2.15rem);
    font-style: italic;
}

.illustration-cell {
    width: min(36vw, 430px);
}

.rotating-waveform {
    width: 100%;
    filter: drop-shadow(0 0 18px rgba(75, 212, 199, 0.16));
    animation: slow-rotate 34s linear infinite;
    transform-origin: center;
}

.axis-note {
    margin-left: auto;
}

svg path,
svg circle {
    fill: none;
    vector-effect: non-scaling-stroke;
}

.drawable-svg .waveform-path,
.floating-element svg path,
.floating-element svg circle,
.marquee-pattern path,
.axis-path {
    stroke: var(--displaced-teal);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fine-path,
.axis-path {
    opacity: 0.55;
}

.axis-path {
    stroke: var(--muted-sage);
    stroke-width: 0.7;
    stroke-dasharray: 4 10;
}

.waveform-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s var(--spring), stroke 0.5s var(--spring), filter 0.5s var(--spring);
}

.waveform-path.visible {
    stroke-dashoffset: 0;
}

@keyframes slow-rotate {
    to { transform: rotate(360deg); }
}

.z-diagonal-1 {
    position: relative;
    min-height: 160vh;
    padding: clamp(3rem, 5vw, 6rem);
    background:
        linear-gradient(140deg, transparent 17%, rgba(125, 168, 140, 0.06) 17.1%, rgba(125, 168, 140, 0.06) 17.4%, transparent 17.5%),
        var(--deep-canopy);
}

.diagonal-rule {
    position: absolute;
    top: 14%;
    right: 14%;
    bottom: 12%;
    left: 16%;
    border-top: 1px solid rgba(125, 168, 140, 0.25);
    transform: skewY(-23deg);
    transform-origin: top right;
}

.drift-panel {
    position: absolute;
    width: clamp(260px, 28vw, 420px);
    padding: clamp(1.4rem, 2.5vw, 2.35rem);
    border: 1px solid var(--muted-sage);
    background: rgba(26, 77, 58, 0.4);
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(232, 240, 228, 0.035);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translate3d(0, 48px, 0);
    transition: opacity 0.8s var(--spring), transform 0.8s var(--spring), border-color 0.4s var(--spring), box-shadow 0.4s var(--spring);
}

.drift-panel.visible {
    opacity: 1;
    transform: translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0);
}

.drift-panel-1 {
    top: 10%;
    right: 12%;
    transition-delay: 0.2s;
}

.drift-panel-2 {
    top: 40%;
    left: 17%;
    transition-delay: 0.4s;
}

.drift-panel-3 {
    right: 18%;
    bottom: 11%;
    transition-delay: 0.6s;
}

.drift-panel:hover,
.case-study:hover {
    border-color: var(--lichen-gold);
    box-shadow: 0 2.5rem 5rem rgba(0, 0, 0, 0.22), 0.05rem 0 rgba(75, 212, 199, 0.5), -0.05rem 0 rgba(200, 169, 81, 0.35);
}

.panel-title {
    margin: 0.65rem 0 1rem;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
}

.panel-text {
    color: var(--sage-mist);
}

.z-row-2 {
    display: flex;
    min-height: 38vh;
    align-items: center;
    padding-right: 0;
    padding-left: 0;
    background: var(--frosted-fern);
}

.marquee-band {
    position: relative;
    width: 100%;
    height: clamp(9rem, 18vw, 13rem);
    overflow: hidden;
    background: var(--frosted-fern);
    border-top: 1px solid rgba(125, 168, 140, 0.18);
    border-bottom: 1px solid rgba(125, 168, 140, 0.18);
}

.marquee-inner {
    display: flex;
    width: max-content;
    height: 100%;
    align-items: center;
    animation: marquee-scroll 20s linear infinite;
}

.marquee-pattern {
    width: 400px;
    height: 90px;
    flex: 0 0 auto;
    opacity: 0.78;
}

.marquee-text {
    position: absolute;
    right: clamp(1.5rem, 5vw, 5rem);
    bottom: 1.2rem;
    max-width: none;
    color: var(--pale-celadon);
    text-align: right;
}

@keyframes marquee-scroll {
    to { transform: translateX(-400px); }
}

.z-row-3 {
    overflow: hidden;
    background: var(--deep-canopy);
}

.spring-emergence-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transform: scale(0.985);
    background-image: radial-gradient(circle, rgba(125, 168, 140, 0.08) 0 2px, transparent 2.2px);
    background-size: 60px 60px;
    transition: opacity 1.2s var(--spring), transform 1.2s var(--spring), background-size 1.8s var(--spring);
}

.spring-emergence-grid.visible {
    opacity: 1;
    transform: scale(1);
    background-size: 60px 60px;
}

.case-grid {
    grid-template-rows: minmax(16rem, auto) minmax(9rem, auto) minmax(16rem, auto);
    align-items: center;
}

.case-study {
    padding: clamp(1.6rem, 3vw, 3rem);
    border: 1px solid var(--muted-sage);
    background: rgba(26, 77, 58, 0.28);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(38px);
    transition: opacity 0.8s var(--spring), transform 0.8s var(--spring), border-color 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.4s var(--spring);
}

.case-study.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-a {
    grid-column: 1 / 5;
    grid-row: 1;
}

.case-b {
    grid-column: 8 / 13;
    grid-row: 2;
}

.case-c {
    grid-column: 2 / 7;
    grid-row: 3;
}

.case-title {
    margin: 0.7rem 0 1.25rem;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.case-waveform {
    width: 100%;
    min-height: 120px;
    margin-bottom: 1.2rem;
}

.before-path {
    stroke: var(--muted-sage);
    opacity: 0.72;
}

.after-path {
    stroke: var(--displaced-teal);
    filter: drop-shadow(0 0 10px rgba(75, 212, 199, 0.24));
}

.case-text {
    color: var(--sage-mist);
}

.z-row-terminal {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 52%, rgba(26, 77, 58, 0.56), transparent 28rem),
        var(--deep-canopy);
    text-align: center;
}

.terminal-content {
    max-width: 980px;
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 1.5s var(--spring), transform 1.5s var(--spring);
}

.terminal-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-label,
.copyright {
    margin-right: auto;
    margin-left: auto;
}

.terminal-statement {
    margin: 1rem auto 2rem;
    font-size: clamp(2.4rem, 6vw, 5.25rem);
}

.copyright {
    color: var(--muted-sage);
}

.floating-element {
    position: fixed;
    z-index: 3;
    width: clamp(52px, 8vw, 96px);
    height: clamp(52px, 8vw, 96px);
    pointer-events: none;
    opacity: 0.58;
    color: var(--displaced-teal);
    transition: transform 0.7s var(--spring), opacity 0.7s var(--spring);
    will-change: transform;
}

.floating-element svg {
    width: 100%;
    height: 100%;
}

.floating-element svg path,
.floating-element svg circle {
    stroke: currentColor;
    stroke-width: 1.2;
}

.floating-ear {
    top: 16%;
    left: 5%;
}

.floating-globe {
    top: 31%;
    right: 7%;
    color: var(--muted-sage);
}

.floating-frond {
    right: 13%;
    bottom: 12%;
    color: var(--lichen-gold);
}

.floating-glyph {
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 1;
    text-shadow: 0.055em 0 rgba(75, 212, 199, 0.36), -0.05em 0 rgba(200, 169, 81, 0.2);
}

.glyph-one {
    left: 11%;
    bottom: 24%;
    color: var(--pale-celadon);
    opacity: 0.25;
}

.glyph-two {
    top: 60%;
    right: 20%;
    color: var(--spring-cream);
    opacity: 0.22;
}

@media (max-width: 980px) {
    .z-row {
        padding: 2rem;
    }

    .z-grid {
        display: block;
        min-height: auto;
    }

    .anchor-upper-left,
    .anchor-upper-right,
    .tagline-container,
    .case-study {
        width: 100%;
        margin-bottom: 3rem;
        text-align: left;
    }

    .illustration-cell {
        width: min(100%, 420px);
        margin-left: auto;
    }

    .tagline-container {
        padding-top: 18vh;
        text-align: center;
    }

    .z-diagonal-1 {
        min-height: auto;
        padding: 2rem;
    }

    .diagonal-rule {
        display: none;
    }

    .drift-panel {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        margin: 0 0 2rem;
    }

    .case-grid {
        display: block;
    }

    .marquee-text {
        left: 1rem;
        right: 1rem;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .z-row,
    .z-diagonal-1 {
        padding: 1.25rem;
    }

    .floating-element {
        opacity: 0.28;
    }
}
