/* ============================================================
   renai.day — Chrome-Metallic Seapunk Descent
   Colors: #0a0a0f, #c0c8d4, #1a2535, #2e8b7a, #6b7d8f, #3d4f5c, #0d1a28, #a8b8c8
   Fonts: Barlow Condensed, IBM Plex Mono (primary body typeface**:), Space Grotesk
   Palette: chrome-metallic and abyss
   IBM Plex Mono as primary body copy at 14px: with generous 1.8 line-height. -- not at surface.
   The page's most important text lives here -- not at surface contrast.
   Card flip reveals an entirely different design system -- the contrast reinforces the dive metaphor.
   IBM Plex Mono" (Google Fonts) loaded via link tag. IntersectionObserver used for cards.
   As the user scrolls past each card, create a sensation of information -- cards open as you scroll past them. IntersectionObserver`.
   Rare in this design portfolio. Combined with Barlow Condensed's authority the chrome palette reinforces the metaphor.
   Body text at 15px with generous leading.
   ============================================================ */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
    --abyss-black:     #0a0a0f;
    --chrome:          #c0c8d4;
    --deep-navy:       #1a2535;
    --teal:            #2e8b7a;
    --oxidized-silver: #6b7d8f;
    --industrial:      #3d4f5c;
    --deepwater:       #0d1a28;
    --light-chrome:    #a8b8c8;

    --font-condensed: 'Barlow Condensed', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-ui: 'Space Grotesk', sans-serif;
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background-color: var(--abyss-black);
    color: var(--chrome);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: crosshair;
}

/* ── DEPTH INDICATOR ────────────────────────────────────────── */
#depth-indicator {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#depth-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#depth-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--teal);
    letter-spacing: 0.1em;
    writing-mode: horizontal-tb;
}

#depth-bar-container {
    width: 3px;
    height: 200px;
    background: var(--deep-navy);
    border: 1px solid var(--industrial);
    position: relative;
    overflow: hidden;
}

#depth-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, var(--chrome), var(--teal));
    height: 0%;
    transition: height 0.3s ease;
}

/* ── DEPTH ZONES (SECTIONS) ─────────────────────────────────── */
.depth-zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Collage background layers */
.zone-collage {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.collage-layer {
    position: absolute;
    inset: 0;
}

/* Grid overlay */
.layer-grid {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 79px,
            rgba(61, 79, 92, 0.25) 80px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 79px,
            rgba(61, 79, 92, 0.25) 80px
        );
    mix-blend-mode: overlay;
}

/* Scan line overlay */
.layer-scan {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    mix-blend-mode: multiply;
}

/* Noise/static */
.layer-noise {
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    mix-blend-mode: screen;
}

/* Halftone */
.layer-halftone {
    background-image: radial-gradient(circle, rgba(168, 184, 200, 0.08) 1px, transparent 1px);
    background-size: 12px 12px;
    mix-blend-mode: screen;
}

/* Rust/oxidation */
.layer-rust {
    background: radial-gradient(ellipse at 20% 80%, rgba(46, 139, 122, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(107, 125, 143, 0.1) 0%, transparent 50%);
    mix-blend-mode: screen;
}

/* Oxidize deep */
.layer-oxidize {
    background: radial-gradient(ellipse at 50% 100%, rgba(46, 139, 122, 0.06) 0%, transparent 70%),
                linear-gradient(180deg, rgba(26, 37, 53, 0) 0%, rgba(13, 26, 40, 0.6) 100%);
}

/* Abyss deep layer */
.layer-abyss {
    background: linear-gradient(180deg, rgba(13, 26, 40, 0.2) 0%, rgba(10, 10, 15, 0.9) 100%);
}

/* ── ZONE 0: SURFACE ────────────────────────────────────────── */
#surface-zone {
    background-color: var(--deepwater);
    background-image:
        /* Chrome city grid — large scale */
        repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(192, 200, 212, 0.06) 60px),
        repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(192, 200, 212, 0.06) 60px),
        /* Diagonal tension lines */
        repeating-linear-gradient(135deg, transparent, transparent 119px, rgba(61, 79, 92, 0.12) 120px),
        /* Deepwater base gradient */
        linear-gradient(160deg, #0d1a28 0%, #1a2535 40%, #0a0a0f 100%);
    min-height: 110vh;
}

.surface-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110vh;
}

.surface-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 40px;
}

.domain-mark {
    margin-bottom: 40px;
}

.depth-marker-text {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--teal);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

#domain-name {
    font-family: var(--font-condensed);
    font-size: clamp(72px, 10vw, 140px);
    font-weight: 700;
    color: var(--chrome);
    letter-spacing: -0.01em;
    line-height: 0.95;
    text-transform: lowercase;
}

.surface-tagline {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--oxidized-silver);
    letter-spacing: 0.05em;
    margin-top: 16px;
    text-transform: lowercase;
}

.surface-coords {
    display: flex;
    gap: 32px;
    margin-bottom: 60px;
}

.coord-item {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--industrial);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.surface-grid {
    display: flex;
    gap: 64px;
    border-top: 1px solid var(--industrial);
    padding-top: 32px;
    margin-bottom: 48px;
}

.surface-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-value {
    font-family: var(--font-condensed);
    font-size: 48px;
    font-weight: 700;
    color: var(--chrome);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--industrial);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-cue {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    opacity: 0.7;
    animation: pulse-down 2s ease-in-out infinite;
}

.scroll-cue-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--teal);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

@keyframes pulse-down {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50%       { opacity: 0.9; transform: translateY(6px); }
}

/* ── ZONE 1: DESCENT ────────────────────────────────────────── */
#descent-zone {
    background: linear-gradient(180deg, #0d1a28 0%, #1a2535 60%, #0d1a28 100%);
    min-height: 120vh;
    padding: 0;
}

.descent-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    padding: 80px 60px;
}

.descent-header {
    margin-bottom: 60px;
}

.zone-title {
    font-family: var(--font-condensed);
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 700;
    color: var(--chrome);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

/* Asymmetric grid */
.asymmetric-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

.grid-col { }

.text-block {
    margin-bottom: 40px;
    padding-left: 20px;
    border-left: 2px solid var(--industrial);
}

.block-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--teal);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.body-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--light-chrome);
    line-height: 1.8;
}

/* Data readout terminal */
.data-readout {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--industrial);
    padding: 20px;
    margin-bottom: 32px;
}

.readout-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(61, 79, 92, 0.3);
    gap: 16px;
}

.readout-line:last-child {
    border-bottom: none;
}

.readout-key {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--industrial);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.readout-val {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--chrome);
    letter-spacing: 0.05em;
}

.readout-val.teal { color: var(--teal); }

/* Sonar display */
.sonar-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sonar-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--industrial);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.sonar-blip {
    animation: sonar-fade 3s ease-in-out infinite;
}

.blip-1 { animation-delay: 0s; }
.blip-2 { animation-delay: 0.8s; }
.blip-3 { animation-delay: 1.6s; }

@keyframes sonar-fade {
    0%, 100% { opacity: 0.2; r: 2; }
    50%       { opacity: 0.9; r: 4; }
}

#sonar-sweep {
    transform-origin: 100px 100px;
    animation: sonar-sweep 4s linear infinite;
}

@keyframes sonar-sweep {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── ZONE 2: PRESSURE / CARD FLIP ───────────────────────────── */
#pressure-zone {
    background: linear-gradient(180deg, #0d1a28 0%, #0a0a0f 100%);
    min-height: 120vh;
}

.pressure-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    padding: 80px 60px;
}

.pressure-header {
    margin-bottom: 60px;
}

.zone-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--industrial);
    letter-spacing: 0.1em;
    margin-top: 12px;
}

/* Card flip grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Individual flip card */
.flip-card {
    perspective: 1000px;
    height: 240px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-card-inner,
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 24px;
    border: 1px solid var(--industrial);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flip-card-front {
    background: var(--deepwater);
    align-items: flex-start;
}

.flip-card-back {
    background: var(--deep-navy);
    border-color: var(--teal);
    transform: rotateY(180deg);
}

.card-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--teal);
    letter-spacing: 0.2em;
}

.card-front-label {
    font-family: var(--font-condensed);
    font-size: 20px;
    font-weight: 700;
    color: var(--chrome);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex: 1;
}

.card-front-pattern {
    margin-top: auto;
    opacity: 0.7;
}

.card-back-category {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--teal);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.card-back-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--light-chrome);
    line-height: 1.7;
    flex: 1;
}

.card-back-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--industrial);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: auto;
    border-top: 1px solid var(--industrial);
    padding-top: 8px;
}

/* ── ZONE 3: DEEP ───────────────────────────────────────────── */
#deep-zone {
    background: linear-gradient(180deg, #0a0a0f 0%, #050507 100%);
    min-height: 120vh;
}

.deep-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    padding: 80px 60px;
}

.deep-header {
    margin-bottom: 60px;
}

.zone-title.compressed {
    font-size: clamp(32px, 4vw, 56px);
    color: var(--oxidized-silver);
    letter-spacing: 0.12em;
}

.deep-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

/* Transmission blocks */
.transmission-block {
    margin-bottom: 32px;
    padding: 20px;
    border-left: 2px solid var(--industrial);
    background: rgba(13, 26, 40, 0.4);
}

.transmission-block.dimmed { opacity: 0.6; }
.transmission-block.very-dimmed { opacity: 0.3; }

.trans-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--teal);
    letter-spacing: 0.2em;
    margin-bottom: 10px;
}

.trans-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--oxidized-silver);
    line-height: 1.9;
    font-style: italic;
}

/* Depth chart */
.depth-chart {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 200px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--industrial);
    padding-bottom: 8px;
}

.chart-axis-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0 8px 0 0;
}

.chart-axis-y span {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--industrial);
    letter-spacing: 0.05em;
}

.chart-bars {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    height: 100%;
    flex: 1;
}

.chart-bar {
    flex: 1;
    background: var(--industrial);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 4px;
    align-items: center;
    min-height: 4px;
    transition: height 1s ease;
    position: relative;
}

.chart-bar.teal-bar { background: var(--teal); opacity: 0.7; }

.bar-label {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--abyss-black);
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    padding-top: 4px;
}

/* Structural diagram */
.structural-diagram {
    border: 1px solid var(--deep-navy);
    padding: 16px;
    background: rgba(10, 10, 15, 0.6);
}

.bio-dot {
    animation: bio-pulse 2.5s ease-in-out infinite;
}

.bio-dot:nth-child(odd)  { animation-delay: 0s; }
.bio-dot:nth-child(even) { animation-delay: 1.2s; }

@keyframes bio-pulse {
    0%, 100% { opacity: 0.3; }
    50%       { opacity: 1; }
}

/* ── ZONE 4: ABYSS ──────────────────────────────────────────── */
#abyss-zone {
    background-color: var(--abyss-black);
    min-height: 110vh;
    background-image: radial-gradient(ellipse at 50% 30%, rgba(46, 139, 122, 0.04) 0%, transparent 70%);
}

.abyss-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    padding: 80px 60px;
    min-height: 110vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.abyss-header {
    margin-bottom: 40px;
}

.zone-title.abyss-title {
    font-family: var(--font-condensed);
    font-size: clamp(60px, 12vw, 180px);
    font-weight: 900;
    color: var(--deep-navy);
    letter-spacing: 0.2em;
    line-height: 1;
    text-transform: uppercase;
}

.depth-marker-text.dim { color: var(--industrial); }

.abyss-message {
    margin: 40px 0;
}

.abyss-text {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--oxidized-silver);
    line-height: 2.4;
    display: block;
}

.abyss-text.fade-1 { opacity: 0.6; }
.abyss-text.fade-2 { opacity: 0.3; }
.abyss-text.fade-3 {
    opacity: 0.15;
    font-size: 20px;
    color: var(--teal);
}

/* Terminal block */
.terminal-block {
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--industrial);
    padding: 24px;
    max-width: 560px;
    font-family: var(--font-mono);
}

.terminal-header {
    display: flex;
    gap: 4px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--deep-navy);
    margin-bottom: 16px;
}

.term-prompt {
    font-size: 12px;
    color: var(--teal);
    font-weight: 500;
}

.term-separator {
    font-size: 12px;
    color: var(--industrial);
}

.term-path {
    font-size: 12px;
    color: var(--oxidized-silver);
}

.term-line {
    font-size: 12px;
    color: var(--chrome);
    padding: 2px 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.term-cursor { color: var(--teal); font-size: 14px; }

.term-cmd {
    color: var(--light-chrome);
}

.term-response {
    color: var(--industrial);
    padding-left: 20px;
}

.teal-text { color: var(--teal); }

.blink-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── ABYSS FOOTER ───────────────────────────────────────────── */
.abyss-footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid var(--deep-navy);
}

.footer-line {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 8px;
}

.footer-item {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--industrial);
    letter-spacing: 0.1em;
}

.footer-item.teal-text { color: var(--teal); }

.footer-sep {
    color: var(--deep-navy);
}

.footer-coords {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--deep-navy);
    letter-spacing: 0.1em;
}

/* ── SCROLL TRANSITION EFFECTS ──────────────────────────────── */
.depth-zone {
    opacity: 1;
    transition: background-color 0.5s ease;
}

/* Zone-specific transitions as scroll progresses */
#descent-zone .descent-content {
    position: relative;
}

#deep-zone .deep-content {
    position: relative;
}

/* Text compression effect at depth */
#deep-zone .zone-title {
    letter-spacing: 0.12em;
    color: var(--oxidized-silver);
}

#abyss-zone .zone-title {
    letter-spacing: 0.3em;
    text-shadow: 0 0 60px rgba(46, 139, 122, 0.05);
}

/* ── INTERSECTION OBSERVER REVEAL STATES ────────────────────── */
.flip-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.flip-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Each card has a stagger delay via nth-child */
.flip-card:nth-child(1) { transition-delay: 0.0s; }
.flip-card:nth-child(2) { transition-delay: 0.1s; }
.flip-card:nth-child(3) { transition-delay: 0.2s; }
.flip-card:nth-child(4) { transition-delay: 0.3s; }
.flip-card:nth-child(5) { transition-delay: 0.4s; }
.flip-card:nth-child(6) { transition-delay: 0.5s; }

/* Transmission blocks reveal */
.transmission-block {
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.transmission-block.revealed {
    transform: translateX(0);
}

.transmission-block.dimmed.revealed  { opacity: 0.6; }
.transmission-block.very-dimmed.revealed { opacity: 0.3; }
.transmission-block:not(.dimmed):not(.very-dimmed).revealed { opacity: 1; }

/* ── TYPOGRAPHY UTILITY ─────────────────────────────────────── */
.teal { color: var(--teal) !important; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .surface-content,
    .descent-content,
    .pressure-content,
    .deep-content,
    .abyss-content {
        padding: 60px 32px;
    }

    .asymmetric-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .surface-grid {
        gap: 32px;
    }

    #depth-indicator {
        right: 12px;
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .surface-coords {
        flex-direction: column;
        gap: 8px;
    }

    .surface-grid {
        flex-direction: column;
        gap: 16px;
    }

    .footer-line {
        flex-direction: column;
        align-items: flex-start;
    }
}
