/* ============================================
   globaltonecare.com - Hand-Drawn Aquarium Journal + HUD Overlay
   ============================================ */

:root {
    --tanned-obsidian: #1A1209;
    --abyss-leather: #0D0A06;
    --electric-coral: #FF6B9D;
    --cyan-pulse: #00F5FF;
    --chartreuse-shock: #CCFF00;
    --violet-surge: #BF5FFF;
    --cream-linen: #F5EDE0;
    --warm-dusk: #B8A690;
    --smoke-glass: rgba(26, 18, 9, 0.65);
    --coral-haze: rgba(255, 107, 157, 0.35);
    --glow-spread: 12;
    --bg-current: #1A1209;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-current);
    color: var(--cream-linen);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Leather Texture Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(184, 166, 144, 0.06), transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(245, 237, 224, 0.04), transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(184, 166, 144, 0.05), transparent 60%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- HUD Layer --- */
.hud-layer {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

/* Corner Brackets */
.hud-corner {
    position: absolute;
    width: 40px;
    height: 40px;
}

.hud-corner-tl {
    top: 16px;
    left: 16px;
    border-top: 1px solid rgba(0, 245, 255, 0.4);
    border-left: 1px solid rgba(0, 245, 255, 0.4);
}

.hud-corner-tr {
    top: 16px;
    right: 16px;
    border-top: 1px solid rgba(0, 245, 255, 0.4);
    border-right: 1px solid rgba(0, 245, 255, 0.4);
}

.hud-corner-bl {
    bottom: 16px;
    left: 16px;
    border-bottom: 1px solid rgba(0, 245, 255, 0.4);
    border-left: 1px solid rgba(0, 245, 255, 0.4);
}

.hud-corner-br {
    bottom: 16px;
    right: 16px;
    border-bottom: 1px solid rgba(0, 245, 255, 0.4);
    border-right: 1px solid rgba(0, 245, 255, 0.4);
}

/* Scroll Depth Indicator */
.hud-depth {
    position: absolute;
    left: 20px;
    top: 80px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hud-depth-track {
    width: 2px;
    flex: 1;
    background: rgba(184, 166, 144, 0.15);
    border-radius: 1px;
    overflow: hidden;
}

.hud-depth-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--cyan-pulse), var(--electric-coral));
    border-radius: 1px;
    transition: height 0.15s ease-out;
}

.hud-depth-value {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--cyan-pulse);
    opacity: 0.8;
}

/* Zone Label */
.hud-zone-label {
    position: absolute;
    top: 20px;
    right: 24px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: var(--warm-dusk);
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

/* Crosshair Reticle */
.hud-crosshair {
    position: absolute;
    width: 60px;
    height: 60px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.crosshair-h,
.crosshair-v {
    position: absolute;
    background: rgba(255, 107, 157, 0.2);
}

.crosshair-h {
    width: 100%;
    height: 1px;
    top: 50%;
}

.crosshair-v {
    width: 1px;
    height: 100%;
    left: 50%;
}

/* --- Parallax Layers --- */
.parallax-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.parallax-bg {
    z-index: 1;
}

.parallax-fg {
    z-index: 50;
}

/* Background Fish (large, slow) */
.bg-fish {
    position: absolute;
    opacity: 0.15;
}

.bf-1 {
    top: 20%;
    right: 5%;
}

.bf-2 {
    top: 55%;
    left: 3%;
}

/* Ambient Foreground Fish (tiny, fast) */
.ambient-fish {
    position: absolute;
    opacity: 0.5;
}

.af-1 {
    top: 18%;
    left: 82%;
}

.af-2 {
    top: 48%;
    left: 8%;
}

.af-3 {
    top: 75%;
    left: 65%;
}

/* Foreground Annotations */
.fg-annotation {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--warm-dusk);
    opacity: 0.35;
}

/* --- Zones --- */
.zone {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: clamp(1.5rem, 5vw, 6rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Zone 0: The Surface --- */
.zone-surface {
    min-height: 100vh;
    position: relative;
}

.hero-fish {
    position: absolute;
    top: 15%;
    right: 8%;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.hero-fish.drawn {
    opacity: 1;
}

.surface-content {
    text-align: center;
    position: relative;
    z-index: 5;
}

.zone-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: var(--cream-linen);
}

.title-underline {
    margin: 12px auto 0;
    width: 300px;
    max-width: 80%;
    overflow: hidden;
}

.title-underline svg {
    width: 100%;
    height: auto;
}

.surface-panel {
    margin-top: 40px;
    max-width: 500px;
}

/* --- HUD Panels --- */
.hud-panel {
    background: var(--smoke-glass);
    border: 1px solid rgba(0, 245, 255, 0.4);
    border-radius: 16px;
    padding: clamp(24px, 3vw, 40px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 calc(var(--glow-spread) * 1px) var(--coral-haze);
    position: relative;
}

@supports not (backdrop-filter: blur(12px)) {
    .hud-panel {
        background: rgba(26, 18, 9, 0.92);
    }
}

/* Panel Reveal Animation */
.panel-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
}

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

/* --- Typography --- */
.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: var(--cream-linen);
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.015em;
    color: var(--cream-linen);
    max-width: 62ch;
    margin-bottom: 12px;
}

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

.panel-label {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--electric-coral);
    opacity: 0.8;
    display: block;
    margin-bottom: 8px;
}

/* --- Reef Layout --- */
.reef-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: clamp(24px, 4vw, 60px);
    max-width: 1100px;
    width: 100%;
    align-items: center;
}

.reef-layout-reverse {
    grid-template-columns: 2fr 3fr;
}

.reef-panel {
    max-width: 100%;
}

.reef-fish-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-fish {
    max-width: 100%;
    height: auto;
}

/* --- Stitch Lines (leather panel dividers) --- */
.stitch-line {
    position: absolute;
    top: 0;
    left: clamp(24px, 5vw, 80px);
    right: clamp(24px, 5vw, 80px);
    height: 0;
    border-top: 1px dashed rgba(184, 166, 144, 0.15);
}

.stitch-line-deep {
    border-top-color: rgba(184, 166, 144, 0.08);
}

/* --- Zone Deep --- */
.zone-deep {
    min-height: 120vh;
    background: linear-gradient(to bottom, transparent, var(--abyss-leather));
    padding-bottom: 15vh;
}

.deep-illustration {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.reef-scene {
    width: 100%;
    height: auto;
}

.deep-callouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 4vw, 60px);
    max-width: 900px;
    width: 100%;
    margin-top: 40px;
}

.deep-callout {
    background: var(--smoke-glass);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    padding: clamp(20px, 3vw, 32px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.callout-line {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 1px;
    height: 30px;
    border-left: 1px dotted rgba(0, 245, 255, 0.3);
}

/* --- Zone Abyss --- */
.zone-abyss {
    background: var(--abyss-leather);
    min-height: 100vh;
}

.abyss-content {
    text-align: center;
    max-width: 700px;
}

.abyss-title {
    margin-bottom: 32px;
}

.abyss-panel {
    text-align: left;
    margin-bottom: 40px;
}

.abyss-fish {
    margin-top: 20px;
}

/* Neon pulse in deep zones */
.zone-abyss .hud-panel {
    border-color: rgba(0, 245, 255, 0.3);
    animation: neonPulse 4s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 107, 157, 0.25); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 157, 0.45); }
}

/* --- Colophon --- */
.zone-colophon {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 60px;
    background: var(--abyss-leather);
    text-align: center;
}

.colophon-rule {
    border: none;
    border-top: 1px solid var(--electric-coral);
    max-width: 120px;
    margin: 0 auto 24px;
    opacity: 0.5;
}

.colophon-domain {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: var(--warm-dusk);
}

.colophon-year {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--warm-dusk);
    opacity: 0.4;
    display: block;
    margin-top: 8px;
}

/* --- Fish SVG Stroke Draw --- */
.fish-stroke {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.8s ease-out;
}

.fish-draw.drawn .fish-stroke {
    stroke-dashoffset: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .reef-layout,
    .reef-layout-reverse {
        grid-template-columns: 1fr;
    }

    .reef-layout-reverse .reef-fish-col {
        order: -1;
    }

    .deep-callouts {
        grid-template-columns: 1fr;
    }

    .hero-fish {
        top: 8%;
        right: 2%;
        width: 250px;
        height: auto;
    }

    .hud-depth {
        display: none;
    }

    .hud-zone-label {
        top: auto;
        bottom: 20px;
        right: 20px;
    }

    .hud-crosshair {
        display: none;
    }

    .parallax-fg,
    .parallax-bg {
        display: none;
    }
}

@media (max-width: 480px) {
    .zone {
        padding: clamp(1rem, 4vw, 2rem);
    }

    .hud-corner {
        width: 24px;
        height: 24px;
    }

    .zone-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .fish-stroke {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        transition: none;
    }

    .panel-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .zone-abyss .hud-panel {
        animation: none;
    }

    .hud-crosshair {
        display: none;
    }

    .hud-depth-fill {
        transition: none;
    }
}
