:root {
    --deep-ocean: #264653;
    --reef-teal: #2a9d8f;
    --warm-amber: #f4a261;
    --coral-red: #e76f51;
    --sunlit-sand: #faf3e8;
    --electric-uv: #7b2cbf;
    --foam-white: #e9ecef;
    --deep-dark: #1b2f3a;
    --nav-bg: transparent;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: var(--deep-ocean);
    background: var(--sunlit-sand);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Navigation */
#nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 48px);
    z-index: 1000;
    background: var(--nav-bg);
    transition: background 0.4s ease;
}

#nav-bar.scrolled {
    background: rgba(38, 70, 83, 0.92);
}

.nav-domain {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--foam-white);
    letter-spacing: 0.04em;
}

.nav-numerals {
    display: flex;
    gap: 1.5rem;
}

.nav-numeral {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--foam-white);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    letter-spacing: 0.04em;
}

.nav-numeral.active,
.nav-numeral:hover {
    opacity: 1;
    color: var(--warm-amber);
}

/* Gutter Spine */
#gutter-spine {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 100vh;
    background: var(--warm-amber);
    box-shadow: 0 0 12px rgba(244, 162, 97, 0.19);
    z-index: 500;
}

@media (max-width: 767px) {
    #gutter-spine {
        display: none;
    }
}

/* Spreads */
.spread {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.spread-grid {
    display: grid;
    grid-template-columns: 1fr 8px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px clamp(16px, 4vw, 48px) 40px;
    min-height: 100vh;
    align-items: start;
}

@media (max-width: 767px) {
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.spread-left {
    padding-right: clamp(16px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.spread-right {
    grid-column: 3;
    padding-left: clamp(16px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 767px) {
    .spread-left,
    .spread-right {
        grid-column: 1;
        padding: 0;
    }
}

/* Cover Spread */
.cover-spread {
    background: linear-gradient(180deg, #2a9d8f 0%, #264653 60%, #1b2f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.cover-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 8rem);
    color: var(--foam-white);
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-transform: uppercase;
}

.cover-dot {
    color: var(--warm-amber);
}

.cover-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--foam-white);
    margin-top: 1rem;
    opacity: 0.85;
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
}

/* Fish Container */
.fish-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.fish-container .fish-svg {
    pointer-events: all;
}

/* Index Spread */
.index-spread {
    background: var(--sunlit-sand);
}

.spread-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--deep-ocean);
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.spread-title.light {
    color: var(--warm-amber);
}

.index-list {
    list-style: none;
}

.index-item {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.4;
    color: var(--deep-ocean);
    padding: 0.3em 0;
    border-bottom: 1px solid rgba(38, 70, 83, 0.1);
}

.index-fish-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding-top: 2rem;
}

/* Taxonomy Spread */
.taxonomy-spread {
    background: var(--sunlit-sand);
}

.taxonomy-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(38, 70, 83, 0.08);
}

.card-header {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.circle-header {
    border-radius: 50%;
    background: var(--coral-red);
}

.circle-header.teal {
    background: var(--reef-teal);
}

.rect-header {
    border-radius: 4px;
    background: var(--warm-amber);
}

.triangle-header {
    width: 0;
    height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    border-bottom: 48px solid var(--electric-uv);
}

.card-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--deep-ocean);
    margin-bottom: 0.75rem;
    letter-spacing: 0.04em;
}

.card-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--deep-ocean);
    line-height: 1.7;
    max-width: 62ch;
    margin-bottom: 1rem;
}

.card-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--coral-red);
}

/* Ecosystem Spread */
.ecosystem-spread {
    background: linear-gradient(180deg, #264653 0%, #1b2f3a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px;
}

.ecosystem-spread .spread-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 clamp(16px, 4vw, 48px);
}

.ecosystem-desc {
    font-family: 'Nunito Sans', sans-serif;
    color: var(--foam-white);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    max-width: 62ch;
    margin: 0 auto;
    line-height: 1.7;
}

.ecosystem-fish {
    z-index: 5;
}

/* Coral formations */
.coral-formation {
    position: absolute;
    bottom: 0;
    background: rgba(42, 157, 143, 0.15);
}

.coral-1 {
    left: 10%;
    width: 80px;
    height: 200px;
    clip-path: polygon(30% 100%, 0% 60%, 20% 40%, 10% 20%, 30% 0%, 50% 15%, 70% 0%, 90% 20%, 80% 40%, 100% 60%, 70% 100%);
}

.coral-2 {
    left: 50%;
    width: 60px;
    height: 150px;
    clip-path: polygon(20% 100%, 0% 50%, 30% 30%, 20% 0%, 50% 10%, 80% 0%, 70% 30%, 100% 50%, 80% 100%);
}

.coral-3 {
    right: 15%;
    width: 100px;
    height: 180px;
    clip-path: polygon(25% 100%, 10% 70%, 0% 40%, 20% 20%, 40% 0%, 60% 10%, 80% 0%, 100% 30%, 85% 60%, 75% 100%);
}

/* Current paths */
.current-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.current-line {
    stroke: rgba(42, 157, 143, 0.2);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 10 5;
    animation: flow 8s linear infinite;
}

@keyframes flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -60; }
}

/* Closing Spread */
.closing-spread {
    background: var(--warm-amber);
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-content {
    text-align: center;
}

.sbom-fish-logo {
    margin-bottom: 2rem;
}

.closing-statement {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--deep-ocean);
    letter-spacing: 0.04em;
    line-height: 1.4;
}

/* Line Illustrations */
.line-illustration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 20;
}

.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-in-out;
}

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

/* Skeleton Loading */
.skeleton {
    position: relative;
}

.skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(250, 243, 232, 0.3);
    border-radius: 8px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.skeleton.revealed::before {
    opacity: 0;
    pointer-events: none;
}

.skeleton > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.skeleton.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

@keyframes skeleton-pulse {
    0%, 100% { background-color: rgba(250, 243, 232, 0.2); }
    50% { background-color: rgba(244, 162, 97, 0.25); }
}

/* Fish SVG Styles */
.fish-svg {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fish-svg:hover {
    animation-play-state: paused !important;
    transform: scale(1.3) !important;
}

.fish-svg:hover circle,
.fish-svg:hover polygon {
    stroke: var(--electric-uv);
}

@keyframes swim {
    from { transform: translateX(-100px); }
    to { transform: translateX(calc(100vw + 100px)); }
}

/* Fish Tooltip */
.fish-tooltip {
    position: fixed;
    background: var(--deep-ocean);
    color: var(--foam-white);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2000;
    letter-spacing: 0.08em;
}

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