/* ============================================================
   globaltonecheck.com - Ocean-Deep Design System
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --abyssal-navy: #0B1D3A;
    --twilight-indigo: #132E54;
    --mid-ocean-teal: #1E4D6E;
    --surface-cerulean: #7FB8D8;
    --foam-white: #E6EEF5;
    --bioluminescent-cyan: #00D4FF;
    --kelp-amber: #D4A855;
    --hadal-black: #060E1A;
    --mist-gray-blue: #C8D6E0;
    --deep-slate: #1A2F4A;
    --mid-ocean-teal-70: rgba(91, 139, 168, 0.7);

    --font-display: 'Source Serif 4', 'Georgia', serif;
    --font-body: 'Libre Franklin', 'Helvetica Neue', Helvetica, sans-serif;

    --ease-fade: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--hadal-black);
    color: var(--mist-gray-blue);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Main Container --- */
.ocean-descent {
    scroll-snap-type: y proximity;
    width: 100%;
}

/* --- Depth Gauge (Fixed Left Side) --- */
.depth-gauge {
    position: fixed;
    left: 3vw;
    top: 0;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 0;
}

.depth-tick {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(-50%);
}

.tick-line {
    display: block;
    width: 16px;
    height: 1px;
    background-color: #5B8BA8;
    opacity: 0.4;
}

.tick-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5B8BA8;
    opacity: 0.4;
    white-space: nowrap;
}

/* --- Tidal Sections (General) --- */
.tidal-section {
    position: relative;
    width: 100%;
    scroll-snap-align: start;
    overflow: hidden;
}

/* --- Opening Sequence --- */
.opening-sequence {
    height: 100vh;
    min-height: 100vh;
    background-color: var(--abyssal-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.opening-horizon {
    position: absolute;
    top: 61.8%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(127, 184, 216, 0.12) 20%,
        rgba(127, 184, 216, 0.2) 50%,
        rgba(127, 184, 216, 0.12) 80%,
        transparent 100%
    );
}

.site-title {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 7vw;
    letter-spacing: 0.12em;
    color: var(--foam-white);
    text-align: center;
    position: relative;
    z-index: 2;
}

.site-title .char {
    display: inline-block;
    opacity: 0;
}

.site-title .char.revealed {
    opacity: 1;
    transition: opacity 400ms var(--ease-fade);
}

/* --- Thermocline Transitions --- */
.thermocline {
    height: 30vh;
    width: 100%;
}

/* --- Ebb Mode Sections --- */
.ebb-mode {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(6rem, 12vh, 10rem) 1.5rem;
    position: relative;
}

.ebb-content {
    max-width: 680px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.section-headline {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4vw + 0.5rem, 3.5rem);
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--foam-white);
    margin-bottom: 2rem;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--mist-gray-blue);
    margin-bottom: 1.5rem;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* --- Kelp Amber Rule --- */
.kelp-amber-rule {
    border: none;
    height: 1px;
    background-color: var(--kelp-amber);
    width: 80px;
    margin: 2.5rem 0;
    opacity: 0.8;
}

/* --- Wave Contour Lines --- */
.wave-contours {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.wave-line {
    fill: none;
    stroke: var(--mid-ocean-teal);
    stroke-width: 1;
    stroke-opacity: 0.3;
    opacity: 0;
    transition: opacity 600ms var(--ease-fade);
}

.wave-line.visible {
    opacity: 1;
}

/* --- Horizon Dividers --- */
.horizon-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 3;
    pointer-events: none;
}

/* --- Flow Mode Sections --- */
.flow-mode {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.flow-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.flow-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(6, 14, 26, 0.4) 0%,
        transparent 30%,
        transparent 70%,
        rgba(6, 14, 26, 0.4) 100%
    );
    z-index: 2;
}

/* Oceanic gradient backgrounds for flow sections */
.ocean-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #0B1D3A 0%,
        #132E54 30%,
        #1E4D6E 50%,
        #132E54 70%,
        #0B1D3A 100%
    );
    opacity: 0.6;
}

.deep-ocean-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #060E1A 0%,
        #0B1D3A 25%,
        #132E54 50%,
        #0B1D3A 75%,
        #060E1A 100%
    );
    opacity: 0.5;
}

.abyss-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #060E1A 0%,
        #091628 30%,
        #0B1D3A 50%,
        #091628 70%,
        #060E1A 100%
    );
    opacity: 0.4;
}

.flow-text {
    position: relative;
    z-index: 5;
    max-width: 600px;
    padding: 0 clamp(2rem, 5vw, 6rem);
}

.flow-text-lower-left {
    align-self: flex-end;
    margin-bottom: 15vh;
}

.flow-text-upper-right {
    align-self: flex-start;
    margin-top: 15vh;
    margin-left: auto;
    text-align: right;
}

.display-statement {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.25;
    color: var(--surface-cerulean);
    opacity: 0.9;
}

/* --- Bioluminescent Particles --- */
.bioluminescent-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.bio-particle {
    position: absolute;
    bottom: 10%;
    border-radius: 50%;
    background-color: var(--bioluminescent-cyan);
    animation: bioFloat linear infinite;
}

@keyframes bioFloat {
    0% {
        transform: translateY(20px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(20px);
    }
}

/* --- Terminal Horizon --- */
.terminal-horizon {
    height: 100vh;
    min-height: 100vh;
    background-color: var(--hadal-black);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.terminal-horizon-line {
    position: absolute;
    top: 38.2%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(127, 184, 216, 0.15) 20%,
        rgba(127, 184, 216, 0.25) 50%,
        rgba(127, 184, 216, 0.15) 80%,
        transparent 100%
    );
}

.terminal-contact {
    position: absolute;
    top: 38.2%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.contact-link {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--foam-white);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 400ms var(--ease-fade);
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--bioluminescent-cyan);
    transition: width 400ms var(--ease-fade);
}

.contact-link:hover {
    color: var(--bioluminescent-cyan);
}

.contact-link:hover::after {
    width: 100%;
}

.terminal-date {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.kelp-amber-date {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kelp-amber);
    opacity: 0.7;
}

/* --- Fade Reveal System --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms var(--ease-fade), transform 800ms var(--ease-fade);
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-headline.fade-reveal {
    transition-duration: 1000ms;
}

.display-statement {
    transition: opacity 1000ms var(--ease-fade), transform 1000ms var(--ease-fade);
}

/* Flow mode images/backgrounds fade from dimmed state */
.flow-mode .flow-background {
    opacity: 0.3;
    transition: opacity 1500ms var(--ease-fade);
}

.flow-mode.in-view .flow-background {
    opacity: 1;
}

/* --- Text Links in Body Copy --- */
.body-text a {
    color: var(--bioluminescent-cyan);
    text-decoration: none;
    position: relative;
}

.body-text a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--bioluminescent-cyan);
    transition: width 400ms var(--ease-fade);
}

.body-text a:hover::after {
    width: 100%;
}

/* --- Utility Text --- */
.utility-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5B8BA8;
    opacity: 0.7;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .site-title {
        font-size: 10vw;
        letter-spacing: 0.08em;
    }

    .depth-gauge {
        left: 2vw;
    }

    .tick-label {
        font-size: 8px;
    }

    .tick-line {
        width: 10px;
    }

    .ebb-mode {
        padding: clamp(3rem, 8vh, 6rem) 1.25rem;
    }

    .ebb-content {
        max-width: 100%;
    }

    .body-text {
        font-size: 1rem;
    }

    .section-headline {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .display-statement {
        font-size: clamp(1.75rem, 7vw, 3rem);
    }

    .flow-text {
        padding: 0 1.5rem;
        max-width: 100%;
    }

    .flow-text-upper-right {
        margin-left: 0;
        text-align: left;
    }

    .terminal-contact {
        padding: 0 1rem;
    }

    .contact-link {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 12vw;
        letter-spacing: 0.06em;
    }

    .depth-gauge {
        display: none;
    }

    .thermocline {
        height: 20vh;
    }

    .flow-mode {
        min-height: 80vh;
        height: 80vh;
    }
}

/* --- Selection Color --- */
::selection {
    background-color: var(--mid-ocean-teal);
    color: var(--foam-white);
}

/* --- Scrollbar Styling (WebKit) --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--hadal-black);
}

::-webkit-scrollbar-thumb {
    background: var(--mid-ocean-teal);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-cerulean);
}
