/* SSETTL.com — Deep-sea bioluminescent narrative */

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

:root {
    --void: #050A12;
    --abyss: #0B1929;
    --pressure: #122741;
    --blue: #2979FF;
    --cyan: #4EEADB;
    --phosphor: #1AFFC4;
    --silver: #B8C6D0;
    --amber: #FFAB40;

    --serif: 'Instrument Serif', 'Lora', serif;
    --sans: 'DM Sans', 'Inter', sans-serif;
    --mono: 'IBM Plex Mono', 'Space Mono', monospace;
}

html, body {
    height: 100%;
    width: 100%;
    background: var(--void);
    color: var(--silver);
    font-family: var(--sans);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Horizontal scroll container */
#horizontal-scroll {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
#horizontal-scroll::-webkit-scrollbar { display: none; }

/* Zones */
.zone {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 8vw;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 30% 70%, hsla(190, calc(40% + var(--zone-depth) * 8%), calc(10% + var(--zone-depth) * 3%), 0.55) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, hsla(218, calc(45% + var(--zone-depth) * 6%), calc(8% + var(--zone-depth) * 4%), 0.45) 0%, transparent 65%),
        var(--void);
}

#zone-surface  { background-color: #061021; }
#zone-twilight { background-color: #061829; }
#zone-midnight { background-color: #050E1C; }
#zone-abyssal  { background-color: #04111F; }
#zone-hadal    { background-color: #030A14; }
#zone-settle   { background-color: #02070D; }

.zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 100%, rgba(41, 121, 255, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Pressure lines (bathymetric contour parallax) */
.pressure-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.pressure-lines span {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(18, 39, 65, 0.55) 30%, rgba(18, 39, 65, 0.85) 50%, rgba(18, 39, 65, 0.55) 70%, transparent 100%);
    opacity: 0.4;
}
.pressure-lines.dense span { opacity: 0.55; }

/* Bathymetric columns (seamount silhouette) */
.bathymetric {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    pointer-events: none;
    z-index: 1;
}
.bathymetric.tall { height: 70%; }
.bathymetric .column {
    position: absolute;
    bottom: 0;
    left: var(--x);
    width: var(--w);
    height: var(--h);
    background: linear-gradient(180deg, rgba(18, 39, 65, 0.85), rgba(11, 25, 41, 0.95));
    border-top-left-radius: 60% 18px;
    border-top-right-radius: 60% 18px;
    border-top: 1px solid rgba(78, 234, 219, 0.12);
    box-shadow: inset 0 30px 40px -20px rgba(41, 121, 255, 0.18);
    opacity: 0.85;
}

/* Sediment drift svg */
.sediment-drift {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 30%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.07;
    animation: sedimentDrift 60s linear infinite;
}
.sediment-drift svg { width: 100%; height: 100%; display: block; }
.sediment-drift path { fill: var(--silver); }

@keyframes sedimentDrift {
    0%   { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* Content */
.zone-content {
    position: relative;
    z-index: 5;
    max-width: 620px;
    color: var(--silver);
}
.zone-content.split-left {
    max-width: 540px;
    margin-right: auto;
}
.zone-content.centered-content {
    margin: 0 auto;
    text-align: center;
}
.zone-content.quiet {
    margin: 0 auto;
    text-align: center;
    max-width: 700px;
}

.zone-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--phosphor);
    opacity: 0.7;
    margin-bottom: 28px;
    padding: 6px 12px;
    border: 1px solid rgba(26, 255, 196, 0.25);
    border-radius: 999px;
}
.amber-tag {
    color: var(--amber);
    border-color: rgba(255, 171, 64, 0.35);
}

/* Zone title - morph animation per character */
.zone-title {
    font-family: var(--serif);
    font-size: clamp(4rem, 10vw, 12rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--cyan);
    text-shadow:
        0 0 36px rgba(78, 234, 219, 0.35),
        0 0 80px rgba(41, 121, 255, 0.25);
    margin-bottom: 32px;
}
#zone-surface .zone-title { color: var(--cyan); }
#zone-twilight .zone-title { color: var(--blue); text-shadow: 0 0 40px rgba(41, 121, 255, 0.45); }
#zone-midnight .zone-title { color: var(--cyan); }
#zone-abyssal  .zone-title { color: var(--blue); }
#zone-hadal    .zone-title { color: var(--cyan); text-shadow: 0 0 50px rgba(78, 234, 219, 0.5); }
#zone-settle   .zone-title { color: var(--phosphor); text-shadow: 0 0 30px rgba(26, 255, 196, 0.4); }

.zone-title .char {
    display: inline-block;
    transform: scale(0);
    opacity: 0;
    transition:
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.9s ease-out;
    transition-delay: calc(var(--ci, 0) * 40ms);
}
.zone.is-active .zone-title .char {
    transform: scale(1);
    opacity: 1;
}

.zone-subtitle {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--phosphor);
    opacity: 0.85;
    margin-bottom: 28px;
}

.zone-body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.75;
    color: var(--silver);
    opacity: 0.85;
    max-width: 56ch;
}
.zone-body.large {
    font-size: 19px;
    margin: 0 auto 36px;
    max-width: 60ch;
}
.zone-body.small-quiet {
    font-size: 16px;
    opacity: 0.7;
    max-width: 50ch;
    margin: 0 auto 40px;
}

/* Meta row (zone 1) */
.meta-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 24px;
    margin-top: 36px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.meta-label { color: var(--phosphor); opacity: 0.6; }
.meta-value { color: var(--silver); opacity: 0.9; }

/* Twilight side (sonar cluster + readings) */
.zone-side {
    position: relative;
    z-index: 5;
    margin-left: auto;
    width: 360px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 48px;
}
.zone-side.split-right { margin-left: auto; }

.sonar-cluster {
    position: relative;
    width: 280px;
    height: 280px;
}
.sonar-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--blue);
    opacity: 0;
    animation: sonarPulse 3.6s ease-out infinite;
}
.sonar-ring.s1 { width: 80px;  height: 80px;  animation-delay: 0s; border-color: var(--cyan); }
.sonar-ring.s2 { width: 170px; height: 170px; animation-delay: 0.9s; border-color: var(--blue); }
.sonar-ring.s3 { width: 260px; height: 260px; animation-delay: 1.8s; border-color: rgba(41, 121, 255, 0.6); }

.sonar-core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 14px; height: 14px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 30px 6px rgba(78, 234, 219, 0.55);
    animation: corePulse 2.2s ease-in-out infinite;
}

@keyframes sonarPulse {
    0%   { opacity: 0.6; transform: translate(-50%, -50%) scale(0.5); }
    70%  { opacity: 0.15; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}
@keyframes corePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
    50%      { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.depth-readings {
    list-style: none;
    width: 320px;
    border-top: 1px solid rgba(26, 255, 196, 0.18);
}
.depth-readings li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(26, 255, 196, 0.14);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.depth-readings span { color: var(--phosphor); opacity: 0.7; }
.depth-readings b { color: var(--silver); font-weight: 500; }

/* Quote block (zone 3) */
.quote-block {
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid rgba(78, 234, 219, 0.2);
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}
.quote-block p {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    line-height: 1.5;
    color: var(--cyan);
    margin-bottom: 12px;
}
.quote-block span {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--phosphor);
    opacity: 0.7;
}

/* Layer readout (zone 4) */
.layer-readout {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 460px;
}
.layer {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(26, 255, 196, 0.15);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.layer i {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 8px var(--blue);
}
.layer:nth-child(1) i { background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor); }
.layer:nth-child(2) i { background: var(--cyan);     box-shadow: 0 0 8px var(--cyan); }
.layer:nth-child(3) i { background: var(--blue);     box-shadow: 0 0 8px var(--blue); }
.layer:nth-child(4) i { background: #1c4a7a;         box-shadow: 0 0 6px #1c4a7a; }
.layer:nth-child(5) i { background: #6a4d2a;         box-shadow: 0 0 6px #6a4d2a; }
.layer span { color: var(--silver); opacity: 0.85; }
.layer b { color: var(--phosphor); font-weight: 400; }

/* Bathymetric chart svg (zone 4) */
.bathy-chart {
    width: 380px;
    height: 340px;
    overflow: visible;
}
.bathy-chart .contours path {
    fill: none;
    stroke: var(--blue);
    stroke-width: 1;
    opacity: 0.45;
    stroke-dasharray: 240 1;
    animation: contourDraw 12s ease-in-out infinite alternate;
}
.bathy-chart .contours path:nth-child(odd) { stroke: var(--cyan); opacity: 0.5; }
.bathy-chart .markers circle {
    fill: var(--cyan);
    filter: drop-shadow(0 0 6px var(--cyan));
}
.bathy-chart .markers text {
    fill: var(--phosphor);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
}
@keyframes contourDraw {
    0%   { stroke-dashoffset: 240; }
    100% { stroke-dashoffset: 0; }
}

/* Anglerfish moment (zone 5) */
.anglerfish {
    position: relative;
    width: 200px;
    height: 240px;
    margin: 36px auto 0;
    cursor: pointer;
}
.anglerfish svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.lure-line {
    fill: none;
    stroke: var(--amber);
    stroke-width: 1.2;
    stroke-linecap: round;
    opacity: 0.55;
    filter: drop-shadow(0 0 3px var(--amber));
}
.lure-bulb {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow:
        0 0 22px 6px rgba(255, 171, 64, 0.7),
        0 0 60px 18px rgba(255, 171, 64, 0.35),
        0 0 120px 40px rgba(255, 171, 64, 0.15);
    animation: anglerPulse 2.6s ease-in-out infinite;
}
.lure-glow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 171, 64, 0.18) 0%, transparent 60%);
    pointer-events: none;
}
@keyframes anglerPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1;   transform: translateX(-50%) scale(1.2); }
}

.anglerfish-message {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 360px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.anglerfish.revealed .anglerfish-message {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.anglerfish-message p {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    line-height: 1.45;
    color: var(--amber);
    text-shadow: 0 0 24px rgba(255, 171, 64, 0.4);
    margin-bottom: 10px;
}
.anglerfish-message span {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--phosphor);
    opacity: 0.8;
}

/* Quiet final zone */
.quiet-title {
    font-size: clamp(3rem, 7vw, 7rem);
}
.signoff {
    margin-top: 60px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--phosphor);
    opacity: 0.4;
}

/* Particles */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    filter: blur(0.5px);
}
.particle::after {
    content: '';
    position: absolute;
    inset: -200%;
    border-radius: 50%;
    background: radial-gradient(circle, currentColor 0%, transparent 60%);
    opacity: 0.3;
}
@keyframes drift {
    0%   { transform: translate(0, 0); opacity: 0; }
    10%  { opacity: var(--max-op, 0.5); }
    50%  { transform: translate(var(--dx, 30px), -50vh); }
    90%  { opacity: var(--max-op, 0.5); }
    100% { transform: translate(calc(var(--dx, 30px) * 0.5), -100vh); opacity: 0; }
}

/* Depth gauge (persistent UI, bottom of viewport) */
.depth-gauge {
    position: fixed;
    left: 32px;
    right: 32px;
    bottom: 24px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 24px;
    pointer-events: none;
}
.gauge-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(26, 255, 196, 0.0), rgba(26, 255, 196, 0.5), rgba(26, 255, 196, 0.0));
    position: relative;
    animation: gaugePulse 3.2s ease-in-out infinite;
}
.gauge-marker {
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--phosphor);
    box-shadow: 0 0 16px var(--phosphor);
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes gaugePulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
.gauge-readout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.gauge-zone { font-size: 10px; color: var(--phosphor); opacity: 0.7; margin-bottom: 4px; }
.gauge-depth { font-size: 13px; color: var(--cyan); }

/* Sonar nav trigger (top-right) */
.sonar-nav-trigger {
    position: fixed;
    top: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(78, 234, 219, 0.4);
    background: rgba(11, 25, 41, 0.6);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    z-index: 90;
    cursor: pointer;
    transition: transform 0.4s ease-out, border-color 0.3s, box-shadow 0.3s;
}
.sonar-nav-trigger svg { width: 100%; height: 100%; }
.sonar-nav-trigger circle { fill: var(--cyan); }
.sonar-nav-trigger circle.ping {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 1;
    opacity: 0.6;
    transform-origin: center;
    animation: navPing 2.4s ease-out infinite;
}
.sonar-nav-trigger circle.ping-2 { animation-delay: 1.2s; }
.sonar-nav-trigger:hover {
    transform: scale(1.05);
    border-color: var(--cyan);
    box-shadow: 0 0 0 0 rgba(78, 234, 219, 0.4);
    animation: navHoverPing 1.5s ease-out infinite;
}
@keyframes navPing {
    0%   { transform: scale(0.5); opacity: 0.7; }
    100% { transform: scale(1.3); opacity: 0; }
}
@keyframes navHoverPing {
    0%   { box-shadow: 0 0 0 0    rgba(78, 234, 219, 0.4); }
    100% { box-shadow: 0 0 0 40px rgba(78, 234, 219, 0); }
}

/* Radial menu */
.radial-menu {
    position: fixed;
    inset: 0;
    z-index: 95;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}
.radial-menu.open {
    pointer-events: auto;
    opacity: 1;
}
.radial-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(5, 10, 18, 0.85) 0%, rgba(5, 10, 18, 0.5) 60%, transparent 100%);
    backdrop-filter: blur(6px);
}
.radial-arcs {
    position: absolute;
    top: 56px;
    right: 56px;
    width: 600px;
    height: 600px;
}
.radial-arc {
    position: absolute;
    top: 0;
    right: 0;
    transform-origin: top right;
    transform: rotate(calc(var(--i) * 14deg + 100deg)) translateY(-160px) translateX(80px);
    background: rgba(11, 25, 41, 0.85);
    border: 1px solid rgba(78, 234, 219, 0.3);
    border-radius: 999px;
    padding: 12px 22px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    transition:
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.4s ease-out,
        background 0.3s,
        border-color 0.3s;
    transition-delay: calc(var(--i) * 70ms);
}
.radial-menu.open .radial-arc {
    opacity: 1;
    transform: rotate(calc(var(--i) * 14deg + 100deg)) translateY(-220px) translateX(80px);
}
.radial-arc:hover {
    background: rgba(41, 121, 255, 0.25);
    border-color: var(--cyan);
    color: var(--phosphor);
}
.radial-arc span { display: block; }

.radial-sweep {
    position: absolute;
    top: 56px;
    right: 56px;
    width: 600px;
    height: 600px;
    pointer-events: none;
    background: conic-gradient(from 90deg at top right, transparent 0deg, rgba(78, 234, 219, 0.18) 60deg, transparent 90deg);
    transform-origin: top right;
    opacity: 0;
    transform: rotate(0deg);
}
.radial-menu.open .radial-sweep {
    opacity: 1;
    animation: sonarSweep 2.2s ease-out;
}
@keyframes sonarSweep {
    0%   { transform: rotate(-90deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: rotate(180deg); opacity: 0; }
}

/* Active zone highlighting */
.zone.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(78, 234, 219, 0.02) 100%);
    z-index: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .zone { padding: 60px 6vw; }
    .zone-content { max-width: 100%; }
    .zone-side { width: 100%; gap: 28px; }
    .sonar-cluster { width: 220px; height: 220px; }
    .depth-readings { width: 100%; }
    .bathy-chart { width: 100%; height: 280px; }
    .radial-arcs, .radial-sweep { width: 420px; height: 420px; }
    .radial-menu.open .radial-arc {
        transform: rotate(calc(var(--i) * 14deg + 110deg)) translateY(-160px) translateX(40px);
    }
    .depth-gauge { left: 16px; right: 16px; }
    .gauge-readout .gauge-zone { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .particle, .sonar-ring, .sonar-core, .lure-bulb, .sediment-drift, .gauge-line, .sonar-nav-trigger circle.ping {
        animation: none !important;
    }
    .zone-title .char { transform: scale(1); opacity: 1; transition: none; }
}
