/* ============================================
   TNHEC.COM - Deep Ocean Glassmorphism
   ============================================ */

/* --- Custom Properties --- */
:root {
    --abyssal-blue: #0A1628;
    --hadal-navy: #0E2240;
    --frost-white: rgba(255, 255, 255, 0.06);
    --ice-edge: rgba(255, 255, 255, 0.12);
    --marble-white: #E8E4DF;
    --sediment-gray: #8A9BB0;
    --bio-teal: #00D4AA;
    --abyssal-gold: #C9A84C;
    --pressure-coral: #D4506E;
    --skeleton-base: #121E33;
    --skeleton-pulse: #1A2E4A;
    --deep-abyss: #060E1A;
    --hadal-black: #030810;

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Cormorant Garamond', serif;

    --column-width: 680px;
    --section-gap: 200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--hadal-navy);
    color: var(--marble-white);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Marble Vein Background --- */
#marble-veins-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

#marble-svg {
    width: 100%;
    height: 100%;
}

.vein-path {
    animation: vein-drift 120s linear infinite;
}

@keyframes vein-drift {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(0); }
}

/* --- Sonar Line --- */
#sonar-line {
    position: fixed;
    left: calc(50% - 340px - 30px);
    top: 0;
    width: 1px;
    height: 100vh;
    background: var(--bio-teal);
    z-index: 2;
    opacity: 0;
    animation: sonar-pulse 4s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

#sonar-line.visible {
    opacity: 1;
}

@keyframes sonar-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- Pressure Layers --- */
.pressure-layer {
    position: relative;
    z-index: 1;
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 0 20px;
}

#surface-layer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

#mesopelagic-layer {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

#bathypelagic-layer {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

#abyssal-layer {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

#hadal-zone {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

/* --- Background Depth Transitions --- */
body {
    background: linear-gradient(
        to bottom,
        var(--hadal-navy) 0%,
        var(--hadal-navy) 15%,
        var(--abyssal-blue) 40%,
        var(--deep-abyss) 70%,
        var(--hadal-black) 90%,
        var(--hadal-black) 100%
    );
    background-attachment: fixed;
}

/* --- Glass Panels --- */
.glass-panel {
    position: relative;
    background: var(--frost-white);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--ice-edge);
    border-radius: 2px;
    padding: 48px 40px;
    margin-bottom: 60px;
    box-shadow: 0 8px 32px rgba(0, 20, 50, 0.4);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow: 0 8px 32px rgba(0, 20, 50, 0.4), inset 0 0 30px rgba(0, 212, 170, 0.03);
}

/* Abyssal panels - reduced blur */
.abyssal-panel {
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-color: rgba(255, 255, 255, 0.08);
}

/* --- Corner Accents --- */
.corner-accent {
    position: absolute;
    pointer-events: none;
}

.corner-accent.top-left {
    top: -1px;
    left: -1px;
}

.corner-accent.top-right {
    top: -1px;
    right: -1px;
}

.corner-accent.bottom-left {
    bottom: -1px;
    left: -1px;
}

.corner-accent.bottom-right {
    bottom: -1px;
    right: -1px;
}

/* --- Hero Panel --- */
.hero-panel {
    text-align: center;
    padding: 80px 40px;
    width: 100%;
}

/* --- Logotype --- */
#logotype {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3.6rem, 10vw, 7.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 16px;
    background: linear-gradient(
        135deg,
        var(--marble-white) 0%,
        var(--abyssal-gold) 30%,
        var(--marble-white) 50%,
        var(--abyssal-gold) 70%,
        var(--marble-white) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: marble-shimmer 8s ease-in-out infinite;
}

@keyframes marble-shimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--sediment-gray);
    letter-spacing: 0.08em;
    margin-bottom: 60px;
}

/* --- Typography --- */
h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--marble-white);
    margin-bottom: 24px;
    line-height: 1.1;
}

p {
    margin-bottom: 16px;
    color: var(--marble-white);
}

.data-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    color: var(--sediment-gray);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.accent-teal {
    color: var(--bio-teal);
}

.accent-gold {
    color: var(--abyssal-gold);
}

.accent-coral {
    color: var(--pressure-coral);
}

/* --- Pull Quotes --- */
.pull-quote-container {
    margin-bottom: 60px;
    padding: 20px 0;
}

.pull-quote {
    border: none;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 0;
}

.pull-quote:hover {
    border-color: transparent;
    box-shadow: none;
}

.pull-quote p {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--marble-white);
    line-height: 1.5;
    margin-bottom: 12px;
}

.pull-quote cite {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--sediment-gray);
    font-style: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Skeleton Loading --- */
.skeleton-block {
    border-radius: 2px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-pulse) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: marble-pulse 2.5s ease-in-out infinite;
}

@keyframes marble-pulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-title {
    height: 48px;
    width: 60%;
    margin-bottom: 24px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 12px;
}

.skeleton-text.short {
    width: 70%;
}

.skeleton-quote {
    height: 60px;
    width: 80%;
    margin: 0 auto;
}

.skeleton-viz {
    height: 200px;
    width: 100%;
    margin-top: 16px;
}

.skeleton-viz.large {
    height: 350px;
}

/* Skeleton to content transition */
.panel-content,
.quote-content,
.hadal-text {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.panel-content.visible,
.quote-content.visible,
.hadal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none;
}

.skeleton-panel.revealed .skeleton-block {
    display: none;
}

.skeleton-panel.revealed .panel-content,
.skeleton-panel.revealed .quote-content,
.skeleton-panel.revealed .hadal-text {
    display: block;
}

/* --- Visualizations --- */
.viz-container {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
}

.viz-container.large {
    margin: 40px 0;
}

.data-viz {
    width: 100%;
    max-width: 600px;
}

canvas {
    max-width: 100%;
}

/* Gauge label */
.gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.gauge-value {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.8rem;
    color: var(--bio-teal);
    letter-spacing: 0.04em;
    line-height: 1;
}

.gauge-unit {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--sediment-gray);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* --- Metrics Row --- */
.metric-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.metric {
    text-align: center;
    flex: 1;
}

.metric-value {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.metric-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--sediment-gray);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* --- Marble Dividers --- */
.marble-divider {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    animation: divider-drift 200s linear infinite;
}

@keyframes divider-drift {
    0% { transform: translateX(0); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

/* --- Hadal Zone --- */
#hadal-zone {
    position: relative;
}

.hadal-content {
    text-align: center;
    position: relative;
}

.hadal-statement {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--marble-white);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto 20px;
}

.hadal-attribution {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sediment-gray);
}

.hadal-glow {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: var(--bio-teal);
    opacity: 0.4;
    box-shadow: 0 0 20px var(--bio-teal), 0 0 60px var(--bio-teal);
    animation: hadal-glow-pulse 4s ease-in-out infinite;
}

@keyframes hadal-glow-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* --- Sankey SVG Styles --- */
#sankey-viz .sankey-band {
    fill: var(--bio-teal);
    opacity: 0.15;
    transition: opacity 0.3s ease;
}

#sankey-viz .sankey-band:hover {
    opacity: 0.3;
}

#sankey-viz .sankey-node {
    fill: var(--bio-teal);
}

#sankey-viz .sankey-node-gold {
    fill: var(--abyssal-gold);
}

#sankey-viz .sankey-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    fill: var(--sediment-gray);
    letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 740px) {
    :root {
        --column-width: 100%;
        --section-gap: 120px;
    }

    .glass-panel {
        padding: 32px 24px;
    }

    .hero-panel {
        padding: 60px 24px;
    }

    #sonar-line {
        left: 12px;
    }

    .metric-row {
        flex-direction: column;
        gap: 16px;
    }

    .pull-quote p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 24px 16px;
    }

    .hero-panel {
        padding: 40px 16px;
    }

    #logotype {
        letter-spacing: 0.06em;
    }
}
