/* ========================================
   lump.dev — styles.css
   Ocean-Deep Dark-Academia Aesthetic
   ======================================== */

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

:root {
    /* Ocean-Deep Palette */
    --abyss: #0a1628;
    --bathyal: #0f2136;
    --mesopelagic: #162d45;
    --bioluminescent: #3ecfcf;
    --phosphor: #e8a84c;
    --vellum: #c4d6e0;
    --ink-wash: #7a9bb0;
    --aurora-green: #4ddfb0;
    --deep-coral: #d4625a;
    --hadal-floor: #060f1c;
    --code-bg: rgba(10, 30, 50, 0.6);
    --code-border: #1e4a6e;

    /* Animation Timing */
    --ease-ocean: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--abyss);
    color: var(--vellum);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Navigation --- */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(to bottom, rgba(10, 22, 40, 0.9) 0%, rgba(10, 22, 40, 0) 100%);
    pointer-events: none;
}

#top-nav .wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--vellum);
    letter-spacing: 0.04em;
    pointer-events: auto;
}

#top-nav .nav-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--ink-wash);
    text-decoration: none;
    letter-spacing: 0.06em;
    pointer-events: auto;
    transition: color 0.4s var(--ease-ocean);
}

#top-nav .nav-link:hover {
    color: var(--bioluminescent);
}

/* --- Fathom Meter --- */
#fathom-meter {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

#fathom-track {
    width: 3px;
    height: 140px;
    background: rgba(122, 155, 176, 0.15);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

#fathom-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--bioluminescent), var(--aurora-green));
    border-radius: 2px;
    transition: height 0.3s var(--ease-ocean);
}

#fathom-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.65rem;
    color: var(--ink-wash);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* --- Ocean Layers (Sections) --- */
.ocean-layer {
    position: relative;
    overflow: hidden;
}

/* --- LAYER 1: Surface — Hero --- */
#surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--mesopelagic) 0%, var(--bathyal) 100%);
}

.watercolor-wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wash-surface {
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(62, 207, 207, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 70% 60%, rgba(77, 223, 176, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 120% 100% at 50% 50%, rgba(22, 45, 69, 0.3) 0%, transparent 80%);
    filter: url(#watercolor-soft);
}

/* Aurora Ribbons */
.aurora-ribbons {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora-ribbon {
    position: absolute;
    width: 200%;
    height: 80px;
    opacity: 0.12;
    filter: blur(40px);
    border-radius: 50%;
}

.aurora-1 {
    top: 20%;
    left: -50%;
    background: linear-gradient(90deg, transparent 0%, var(--bioluminescent) 30%, var(--aurora-green) 60%, transparent 100%);
    animation: aurora-drift-1 45s ease-in-out infinite;
}

.aurora-2 {
    top: 35%;
    left: -30%;
    background: linear-gradient(90deg, transparent 0%, var(--aurora-green) 25%, var(--bioluminescent) 55%, transparent 100%);
    animation: aurora-drift-2 52s ease-in-out infinite;
    opacity: 0.08;
}

.aurora-3 {
    top: 50%;
    left: -40%;
    background: linear-gradient(90deg, transparent 0%, var(--bioluminescent) 40%, rgba(62, 207, 207, 0.3) 70%, transparent 100%);
    animation: aurora-drift-3 60s ease-in-out infinite;
    opacity: 0.06;
}

@keyframes aurora-drift-1 {
    0%, 100% { transform: translateX(-10%) translateY(0) scaleY(1); }
    33% { transform: translateX(5%) translateY(-15px) scaleY(1.3); }
    66% { transform: translateX(-5%) translateY(10px) scaleY(0.8); }
}

@keyframes aurora-drift-2 {
    0%, 100% { transform: translateX(0%) translateY(0) scaleY(1); }
    40% { transform: translateX(-8%) translateY(12px) scaleY(1.2); }
    70% { transform: translateX(6%) translateY(-8px) scaleY(0.9); }
}

@keyframes aurora-drift-3 {
    0%, 100% { transform: translateX(-5%) translateY(0) scaleY(1); }
    50% { transform: translateX(8%) translateY(-10px) scaleY(1.15); }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--vellum);
    letter-spacing: 0.04em;
    margin-bottom: 0.4em;
    opacity: 0;
    transform: translateY(30px);
    animation: surface-emerge 1.2s var(--ease-ocean) 0.3s forwards;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: var(--ink-wash);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(20px);
    animation: surface-emerge 1.2s var(--ease-ocean) 0.7s forwards;
}

@keyframes surface-emerge {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Watercolor Dividers --- */
.watercolor-divider {
    height: 120px;
    position: relative;
    filter: url(#watercolor-filter);
    overflow: hidden;
}

.divider-1 {
    background: linear-gradient(180deg,
        var(--bathyal) 0%,
        rgba(62, 207, 207, 0.08) 30%,
        rgba(30, 74, 110, 0.15) 50%,
        rgba(62, 207, 207, 0.05) 70%,
        var(--bathyal) 100%
    );
}

.divider-2 {
    background: linear-gradient(180deg,
        var(--bathyal) 0%,
        rgba(232, 168, 76, 0.06) 25%,
        rgba(30, 74, 110, 0.12) 50%,
        rgba(62, 207, 207, 0.06) 75%,
        var(--abyss) 100%
    );
}

.divider-3 {
    background: linear-gradient(180deg,
        var(--abyss) 0%,
        rgba(77, 223, 176, 0.04) 30%,
        rgba(10, 22, 40, 0.2) 50%,
        rgba(212, 98, 90, 0.04) 70%,
        var(--abyss) 100%
    );
}

/* --- LAYER 2: Twilight Zone --- */
#twilight {
    min-height: 150vh;
    padding: 8rem 2rem 6rem;
    background: linear-gradient(180deg, var(--bathyal) 0%, var(--bathyal) 50%, var(--abyss) 100%);
}

/* Reading Column (F-Pattern) */
.reading-column {
    max-width: 680px;
    margin-left: 120px;
    position: relative;
}

@media (max-width: 1000px) {
    .reading-column {
        margin-left: auto;
        margin-right: auto;
        padding: 0 1rem;
    }
}

/* Section Headings */
.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--vellum);
    letter-spacing: 0.04em;
    margin-bottom: 3rem;
    text-transform: none;
}

/* Specimen Cards */
.specimen-card {
    position: relative;
    background: rgba(15, 33, 54, 0.6);
    border: 1px solid rgba(30, 74, 110, 0.3);
    border-radius: 2px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    overflow: hidden;
    transition: border-color 0.6s var(--ease-ocean);
}

.specimen-card:hover {
    border-color: rgba(62, 207, 207, 0.25);
}

.specimen-stain {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 160px;
    height: 160px;
    background: radial-gradient(ellipse at center, rgba(62, 207, 207, 0.04) 0%, rgba(22, 45, 69, 0.02) 50%, transparent 70%);
    filter: url(#watercolor-soft);
    pointer-events: none;
}

.specimen-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.35rem;
    color: var(--phosphor);
    letter-spacing: 0.03em;
    margin-bottom: 1.2rem;
}

.specimen-description {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    color: var(--vellum);
    margin-bottom: 1.5rem;
}

.specimen-description em {
    font-style: italic;
    color: var(--bioluminescent);
}

.specimen-code {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--bioluminescent);
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 0.8rem 1.2rem;
    border-radius: 2px;
    font-feature-settings: "liga" 1;
    overflow-x: auto;
}

/* Marginal Notes */
.marginal-note {
    position: absolute;
    right: -280px;
    width: 220px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--ink-wash);
    line-height: 1.6;
}

.marginal-note .margin-icon {
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.marginal-note p {
    margin: 0;
}

.marginal-note em {
    font-style: normal;
    color: var(--vellum);
}

/* Position marginal notes alongside their cards */
.specimen-card:nth-of-type(1) ~ .marginal-note:nth-of-type(1) {
    top: auto;
}

@media (max-width: 1200px) {
    .marginal-note {
        position: relative;
        right: auto;
        width: 100%;
        margin-bottom: 2.5rem;
        padding-left: 1.5rem;
        border-left: 2px solid rgba(122, 155, 176, 0.2);
    }

    .marginal-note .margin-icon {
        display: inline-block;
        vertical-align: middle;
        margin-right: 0.5rem;
        margin-bottom: 0;
    }
}

/* --- LAYER 3: Midnight Zone --- */
#midnight {
    min-height: 150vh;
    padding: 6rem 2rem 6rem;
    background: linear-gradient(180deg, var(--abyss) 0%, var(--abyss) 80%, #080e1e 100%);
}

.text-block {
    margin-bottom: 3rem;
}

.text-block p {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    line-height: 1.75;
    color: var(--vellum);
}

/* Code Specimens */
.code-specimen {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 2px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.code-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.75rem;
    color: var(--ink-wash);
    padding: 0.6rem 1.2rem;
    background: rgba(10, 22, 40, 0.5);
    border-bottom: 1px solid rgba(30, 74, 110, 0.2);
    letter-spacing: 0.04em;
}

.code-specimen pre {
    padding: 1.5rem 1.2rem;
    overflow-x: auto;
}

.code-specimen code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--vellum);
    font-feature-settings: "liga" 1;
}

/* Watercolor Thumbnails */
.watercolor-thumbnail {
    width: 100%;
    height: 120px;
    margin-bottom: 3rem;
    border-radius: 2px;
    filter: url(#watercolor-filter);
    opacity: 0.5;
}

.thumb-1 {
    background: linear-gradient(135deg,
        rgba(62, 207, 207, 0.12) 0%,
        rgba(30, 74, 110, 0.15) 30%,
        rgba(22, 45, 69, 0.2) 60%,
        rgba(77, 223, 176, 0.08) 100%
    );
}

.thumb-2 {
    background: linear-gradient(225deg,
        rgba(232, 168, 76, 0.08) 0%,
        rgba(30, 74, 110, 0.12) 30%,
        rgba(10, 22, 40, 0.2) 60%,
        rgba(62, 207, 207, 0.06) 100%
    );
}

/* --- LAYER 4: Abyssal Zone --- */
#abyssal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abyss);
    position: relative;
}

.abyssal-wash {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 80% at 20% 50%, rgba(62, 207, 207, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse 80% 100% at 80% 30%, rgba(77, 223, 176, 0.02) 0%, transparent 60%),
        radial-gradient(ellipse 120% 60% at 50% 70%, rgba(232, 168, 76, 0.02) 0%, transparent 60%);
    filter: url(#watercolor-soft);
    pointer-events: none;
}

.abyssal-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.abyssal-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--vellum);
    letter-spacing: 0.04em;
    margin-bottom: 2.5rem;
}

.abyssal-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: var(--ink-wash);
    max-width: 600px;
    margin: 0 auto;
}

/* --- LAYER 5: Hadal Zone — Footer --- */
#hadal {
    min-height: 50vh;
    background: linear-gradient(180deg, var(--abyss) 0%, var(--hadal-floor) 30%, var(--hadal-floor) 100%);
    position: relative;
    padding: 6rem 2rem 4rem;
}

.hadal-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 60%, rgba(77, 223, 176, 0.03) 0%, transparent 70%);
    pointer-events: none;
    animation: hadal-pulse 8s ease-in-out infinite;
}

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

.ocean-floor {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.floor-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--ink-wash);
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
    text-align: center;
}

/* Fossil Grid */
.fossil-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.fossil-link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.2rem;
    background: rgba(10, 22, 40, 0.4);
    border: 1px solid rgba(30, 74, 110, 0.15);
    border-radius: 2px;
    text-decoration: none;
    transition: border-color 0.4s var(--ease-ocean), background 0.4s var(--ease-ocean);
    position: relative;
    overflow: hidden;
}

.fossil-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(62, 207, 207, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s var(--ease-ocean);
}

.fossil-link:hover::before {
    opacity: 1;
}

.fossil-link:hover {
    border-color: rgba(62, 207, 207, 0.2);
    background: rgba(15, 33, 54, 0.5);
}

.fossil-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1rem;
    color: var(--vellum);
    letter-spacing: 0.02em;
}

.fossil-depth {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.7rem;
    color: var(--ink-wash);
    letter-spacing: 0.05em;
}

/* Colophon */
.floor-colophon {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--ink-wash);
    line-height: 1.8;
    opacity: 0.6;
}

.colophon-sub {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* --- Fade-In Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s var(--ease-ocean), transform 1.2s var(--ease-ocean);
}

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

.fade-in.stagger-1 {
    transition-delay: 0.15s;
}

.fade-in.stagger-2 {
    transition-delay: 0.3s;
}

/* --- Ink-in-Water Hover Effect --- */
.ink-hover {
    position: relative;
    overflow: hidden;
}

.ink-hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(10, 22, 40, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s var(--ease-ocean), height 0.6s var(--ease-ocean);
    pointer-events: none;
}

.ink-hover:hover::after {
    width: 300px;
    height: 300px;
}

/* --- Parallax Layer Helpers --- */
.parallax-bg {
    will-change: transform;
}

/* --- Selection --- */
::selection {
    background: rgba(62, 207, 207, 0.2);
    color: var(--vellum);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(122, 155, 176, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(122, 155, 176, 0.35);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #fathom-meter {
        display: none;
    }

    #top-nav {
        padding: 1rem 1.5rem;
    }

    #twilight,
    #midnight {
        padding: 5rem 1.2rem 4rem;
    }

    .specimen-card {
        padding: 1.8rem;
    }

    .abyssal-content {
        padding: 3rem 1.5rem;
    }

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

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