/* sbom.day - Opulent Aquarium of Software Dependencies */
/* Neomorphic Design System with Tropical Fish Motifs */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Surface & Neomorphic */
    --surface-base: #dfe6ed;
    --shadow-dark: #b8c4d0;
    --shadow-light: #ffffff;

    /* Ocean */
    --deep-ocean: #0a1628;
    --mid-ocean: #1a3a5c;

    /* Fish Accents */
    --fish-primary: #e8784a;
    --fish-secondary: #2ab5a0;
    --fish-tertiary: #7b5ea7;

    /* Ledger */
    --ledger-surface: #3a2f28;
    --ledger-text: #c8b89a;

    /* Alert */
    --alert-red: #d94052;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: linear-gradient(135deg, #dfe6ed 0%, #d0d8e2 100%);
    color: #2a3040;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* ============================================
   Sections
   ============================================ */
.section {
    scroll-snap-align: start;
    position: relative;
    max-width: 1440px;
    margin-inline: auto;
    padding: clamp(24px, 4vw, 64px);
}

/* ============================================
   Section 1: Grand Entrance
   ============================================ */
.section--entrance {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entrance-container {
    width: 100%;
    background: var(--surface-base);
    border-radius: 24px;
    box-shadow:
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    padding: clamp(40px, 6vw, 80px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.entrance-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: -0.02em;
    color: var(--surface-base);
    text-shadow:
        2px 2px 4px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
    margin-bottom: 0.5em;
    position: relative;
}

.entrance-subtitle {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Fish Showcase */
.fish-showcase {
    position: relative;
    width: 100%;
    height: 300px;
}

.fish-lane {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
}

.fish-lane--1 {
    top: 10%;
    animation: swim-lane-1 12s ease-in-out infinite;
}

.fish-lane--2 {
    top: 40%;
    animation: swim-lane-2 16s ease-in-out infinite;
}

.fish-lane--3 {
    top: 65%;
    animation: swim-lane-3 14s ease-in-out infinite;
}

.fish {
    flex-shrink: 0;
    position: relative;
}

.fish--clownfish {
    width: 100px;
    animation: wiggle 2s ease-in-out infinite;
}

.fish--parrotfish {
    width: 80px;
    animation: wiggle 2.5s ease-in-out infinite;
}

.fish--violettang {
    width: 90px;
    animation: wiggle 2.2s ease-in-out infinite;
}

.fish-label {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--ledger-text);
    margin-left: 16px;
    position: relative;
    white-space: nowrap;
}

.fish-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fish-secondary);
    transform: scaleX(0);
    transform-origin: left;
    animation: underline-draw 3s ease-in-out infinite;
}

/* ============================================
   Swimming Animations
   ============================================ */
@keyframes swim-lane-1 {
    0%   { transform: translateX(-120px); }
    50%  { transform: translateX(calc(100% - 120px)); }
    100% { transform: translateX(-120px); }
}

@keyframes swim-lane-2 {
    0%   { transform: translateX(calc(100% - 100px)); }
    50%  { transform: translateX(-100px); }
    100% { transform: translateX(calc(100% - 100px)); }
}

@keyframes swim-lane-3 {
    0%   { transform: translateX(-110px); }
    50%  { transform: translateX(calc(100% - 110px)); }
    100% { transform: translateX(-110px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(3deg); }
    75%      { transform: rotate(-3deg); }
}

@keyframes underline-draw {
    0%, 30%  { transform: scaleX(0); }
    50%      { transform: scaleX(1); }
    70%, 100% { transform: scaleX(0); transform-origin: right; }
}

/* ============================================
   Section 2: Observation Tanks
   ============================================ */
.section--tanks {
    min-height: 100vh;
    padding-top: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(260px, 0.8fr);
    grid-template-rows: auto auto;
    grid-template-areas:
        "tank-a   tank-b   sidebar"
        "tank-a   tank-b   sidebar";
    gap: clamp(16px, 2vw, 32px);
    width: 100%;
}

.tank--direct {
    grid-area: tank-a;
}

.tank--transitive {
    grid-area: tank-b;
}

.sidebar-ledger {
    grid-area: sidebar;
}

/* Tank Panels (inset neomorphic) */
.tank {
    background: var(--surface-base);
    border-radius: 20px;
    box-shadow:
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
    padding: clamp(20px, 3vw, 40px);
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.tank-title {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7a8d;
    margin-bottom: 1.5rem;
    text-shadow:
        1px 1px 2px var(--shadow-dark),
        -1px -1px 2px var(--shadow-light);
}

.tank-viewport {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
}

/* Tank Fish */
.tank-fish {
    position: absolute;
    width: 60px;
    height: 30px;
}

.tank-fish--1 {
    top: 15%;
    animation: tank-swim-a 10s ease-in-out infinite;
}

.tank-fish--2 {
    top: 35%;
    animation: tank-swim-b 13s ease-in-out infinite;
    animation-delay: -2s;
}

.tank-fish--3 {
    top: 55%;
    animation: tank-swim-a 11s ease-in-out infinite;
    animation-delay: -4s;
}

.tank-fish--4 {
    top: 70%;
    animation: tank-swim-b 12s ease-in-out infinite;
    animation-delay: -6s;
}

.tank-fish--5 {
    top: 85%;
    animation: tank-swim-a 14s ease-in-out infinite;
    animation-delay: -1s;
}

@keyframes tank-swim-a {
    0%   { transform: translateX(-70px) rotate(0deg); }
    25%  { transform: translateX(calc(50% - 30px)) rotate(2deg); }
    50%  { transform: translateX(calc(100% - 70px)) rotate(0deg); }
    75%  { transform: translateX(calc(50% - 30px)) rotate(-2deg); }
    100% { transform: translateX(-70px) rotate(0deg); }
}

@keyframes tank-swim-b {
    0%   { transform: translateX(calc(100% - 70px)) rotate(0deg) scaleX(-1); }
    25%  { transform: translateX(calc(50% - 30px)) rotate(-2deg) scaleX(-1); }
    50%  { transform: translateX(-70px) rotate(0deg) scaleX(-1); }
    75%  { transform: translateX(calc(50% - 30px)) rotate(2deg) scaleX(-1); }
    100% { transform: translateX(calc(100% - 70px)) rotate(0deg) scaleX(-1); }
}

/* Tank Labels */
.tank-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px 0;
}

.tank-label,
.underline-draw {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: #4a5568;
    position: relative;
    cursor: default;
    padding-bottom: 4px;
}

.tank-label::after,
.underline-draw::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fish-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.tank-label.revealed::after {
    transform: scaleX(1);
}

/* Tank Labels Hover (Transitive) */
.tank-labels--hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 0;
}

.tank-label-hover {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: #6b7a8d;
    position: relative;
    cursor: default;
    padding-bottom: 4px;
    opacity: 0.7;
}

.tank-label-hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fish-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.tank-label-hover:hover::after {
    transform: scaleX(1);
}

.tank-label-hover:hover {
    opacity: 1;
    color: #2a3040;
}

/* Transitive Swarm Fish (small, via JS) */
.swarm {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.swarm-fish {
    position: absolute;
    width: 30px;
    height: 15px;
    opacity: 0.6;
}

.swarm-fish svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Sidebar: Leather Ledger
   ============================================ */
.sidebar-ledger {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(90,72,56,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(90,72,56,0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(200,184,154,0.05) 0%, transparent 30%);
    background-color: var(--ledger-surface);
    border-radius: 20px;
    padding: clamp(20px, 3vw, 40px) clamp(16px, 2vw, 24px);
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    box-shadow:
        4px 4px 12px rgba(0,0,0,0.3),
        -2px -2px 8px rgba(200,184,154,0.1);
}

.ledger-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    color: var(--ledger-text);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    position: relative;
    padding-bottom: 12px;
}

.ledger-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--ledger-text);
    opacity: 0.4;
}

.ledger-entries {
    display: flex;
    flex-direction: column;
}

.ledger-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(200,184,154,0.15);
    transition: background 0.2s ease;
}

.ledger-entry:hover {
    background: rgba(200,184,154,0.05);
}

.ledger-entry--alert {
    background: rgba(217,64,82,0.1);
}

.ledger-entry--alert:hover {
    background: rgba(217,64,82,0.15);
}

.ledger-name {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--ledger-text);
    flex: 1;
    letter-spacing: 0.02em;
}

.ledger-version {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    color: rgba(200,184,154,0.6);
    letter-spacing: 0.04em;
}

.ledger-license {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.license--mit {
    color: var(--fish-secondary);
    border: 1px solid rgba(42,181,160,0.3);
}

.license--apache {
    color: var(--fish-primary);
    border: 1px solid rgba(232,120,74,0.3);
}

.license--isc {
    color: var(--fish-tertiary);
    border: 1px solid rgba(123,94,167,0.3);
}

.license--vuln {
    color: var(--alert-red);
    border: 1px solid rgba(217,64,82,0.5);
    background: rgba(217,64,82,0.1);
    animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217,64,82,0); }
    50%      { box-shadow: 0 0 8px 2px rgba(217,64,82,0.3); }
}

/* ============================================
   Section 3: The Deep
   ============================================ */
.section--deep {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a3a5c 0%, #0a1628 60%, #050d18 100%);
    max-width: none;
    padding: clamp(24px, 4vw, 64px);
    position: relative;
    overflow: hidden;
}

.deep-container {
    max-width: 1440px;
    margin-inline: auto;
    position: relative;
    z-index: 2;
}

.deep-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: -0.02em;
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 0.3em;
}

.deep-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: rgba(200,184,154,0.7);
    text-align: center;
    margin-bottom: 3rem;
}

/* Deep Swarm */
.deep-swarm {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.deep-fish {
    position: absolute;
    opacity: 0.4;
}

.deep-fish svg {
    width: 100%;
    height: 100%;
}

/* Bubbles */
.bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    bottom: -10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    animation: rise linear infinite;
}

@keyframes rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0.3; }
    50%  { opacity: 0.5; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

/* Coral Tree */
.coral-tree {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    z-index: 3;
}

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

.coral-branch {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 4s ease-in-out;
}

.coral-branch.animate {
    stroke-dashoffset: 0;
}

/* Coral Fish */
.coral-fish {
    opacity: 0;
    transition: opacity 1s ease 3.5s;
}

.coral-fish.visible {
    opacity: 1;
}

/* Vulnerable Glow */
.coral-fish--vuln .vuln-glow {
    animation: vuln-pulse 2s ease infinite;
}

@keyframes vuln-pulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.3); }
}

.vuln-glow-circle {
    animation: vuln-pulse 2s ease infinite;
}

/* Deep Quote */
.deep-quote {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    position: relative;
    z-index: 3;
}

.quote-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: rgba(200,184,154,0.8);
    line-height: 1.5;
}

/* ============================================
   Neomorphic Buttons / Interactive Elements
   ============================================ */
.neo-button {
    background: var(--surface-base);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #4a5568;
    cursor: pointer;
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
    transition: box-shadow 0.3s ease, background 0.15s ease;
}

.neo-button:active,
.neo-button.pressed {
    box-shadow:
        inset 5px 5px 10px var(--shadow-dark),
        inset -5px -5px 10px var(--shadow-light);
    background: #d8dfe6;
}

/* ============================================
   Fish Shimmer Animation
   ============================================ */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "tank-a   tank-b"
            "sidebar  sidebar";
    }

    .sidebar-ledger {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "tank-a"
            "tank-b"
            "sidebar";
    }

    .fish-showcase {
        height: 240px;
    }

    .tank {
        min-height: 300px;
    }

    .tank-viewport {
        height: 240px;
    }
}

/* ============================================
   Scrollbar Styling (for ledger)
   ============================================ */
.sidebar-ledger::-webkit-scrollbar {
    width: 6px;
}

.sidebar-ledger::-webkit-scrollbar-track {
    background: rgba(200,184,154,0.1);
    border-radius: 3px;
}

.sidebar-ledger::-webkit-scrollbar-thumb {
    background: rgba(200,184,154,0.3);
    border-radius: 3px;
}

.sidebar-ledger::-webkit-scrollbar-thumb:hover {
    background: rgba(200,184,154,0.5);
}
