/* ========================================
   Maritime Profile - S/V Hardtack 
   ======================================== */

:root {
    --navy-deep: #1a2332;
    --navy-medium: #2c3e50;
    --navy-light: #34495e;
    --brass: #b8860b;
    --brass-light: #daa520;
    --rope-tan: #d2b48c;
    --canvas-white: #f8f6f0;
    --sea-foam: #87ceeb;
    --salt-white: #ffffff;
    --weathered-wood: #8b7355;
    
    --serif-font: 'Playfair Display', serif;
    --sans-font: 'Work Sans', sans-serif;
}

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

body {
    font-family: var(--sans-font);
    line-height: 1.6;
    background: linear-gradient(135deg, 
        #2c5aa0 0%,  
        #1e4d72 25%,
        var(--navy-medium) 50%,
        var(--navy-deep) 100%);
    min-height: 100vh;
    color: var(--navy-deep);
    position: relative;
    overflow-x: hidden;
}

/* Pirate Mode Easter Egg */
.skull-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.skull-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.skull-overlay.fade-out {
    opacity: 0;
    transition: opacity 1s ease;
}

.skull-crossbones {
    width: 400px;
    height: 400px;
    object-fit: contain;
    animation: skull-pulse 2s ease-in-out;
    background: transparent;
}

@keyframes skull-pulse {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Pirate Mode Transformations */
body.pirate-mode {
    background: linear-gradient(135deg, 
        #000000 0%,  
        #1a1a1a 25%,
        #0d0d0d 50%,
        #262626 100%) !important;
    transition: all 1s ease;
}

body.pirate-mode .ancient-scroll {
    background: 
        radial-gradient(circle at 20% 30%, rgba(220, 20, 20, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.15) 0%, transparent 30%),
        linear-gradient(135deg, 
            rgba(20, 20, 20, 0.95) 0%,
            rgba(40, 40, 40, 0.9) 50%,
            rgba(30, 30, 30, 0.95) 100%) !important;
    border: 2px solid #8b0000 !important;
}

body.pirate-mode .captain-name {
    color: #ffffff !important;
    text-shadow: 2px 2px 0px rgba(139, 0, 0, 0.8), 0 0 10px rgba(139, 0, 0, 0.5) !important;
}

body.pirate-mode .title-primary {
    color: #dc143c !important;
}

body.pirate-mode .crew-photo {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.pirate-mode .captain-portrait {
    border-color: #dc143c !important;
}

body.pirate-mode .nav-item {
    color: #cccccc !important;
    border-bottom-color: rgba(220, 20, 60, 0.2) !important;
}

body.pirate-mode .nav-item:hover {
    color: #dc143c !important;
    background-color: rgba(220, 20, 60, 0.1) !important;
}

body.pirate-mode .nav-icon {
    color: #dc143c !important;
}

body.pirate-mode .nav-dropdown {
    background: rgba(20, 20, 20, 0.95) !important;
    border: 1px solid #dc143c !important;
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3) !important;
}

body.pirate-mode .ships-registry .registry-seal {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #cccccc !important;
    border: 2px solid #dc143c !important;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.3) !important;
}

body.pirate-mode .ships-registry .registry-seal span,
body.pirate-mode .ships-registry .registry-seal div {
    display: none !important;
}

body.pirate-mode .entry-divider {
    background: linear-gradient(to right, #dc143c, transparent) !important;
    display: block !important;
}

body.pirate-mode .entry-header h2::before {
    color: #dc143c !important;
}

body.pirate-mode .ancient-scroll::before {
    background: none !important;
    box-shadow: none !important;
}

body.pirate-mode .ancient-scroll::after {
    background: none !important;
    box-shadow: none !important;
}

body.pirate-mode .captains-note {
    border: none !important;
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.8) 0%, 
        rgba(220, 20, 60, 0.6) 25%,
        rgba(139, 0, 0, 0.9) 50%, 
        rgba(100, 0, 0, 0.95) 100%) !important;
}

body.pirate-mode .captains-note::before {
    display: none !important;
}

body.pirate-mode .ships-registry .registry-seal {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #cccccc !important;
    border: 1px solid #dc143c !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.pirate-mode .ships-registry .registry-seal div {
    display: block !important;
    color: #dc143c !important;
    border-top: 1px solid #dc143c !important;
    padding-top: 5px !important;
    margin-top: 5px !important;
}

body.pirate-mode .title-primary::after {
    content: ' ☠️';
}

body.pirate-mode .title-secondary {
    color: #cccccc !important;
}

body.pirate-mode .title-secondary::before {
    content: '🏴‍☠️ ';
}

body.pirate-mode h2 {
    color: #dc143c !important;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8) !important;
}

body.pirate-mode .compass {
    background: radial-gradient(circle, 
        rgba(20, 20, 20, 0.9) 0%, 
        rgba(40, 40, 40, 0.8) 70%, 
        rgba(0, 0, 0, 0.9) 100%) !important;
    border: 3px solid #8b0000 !important;
}

body.pirate-mode .compass-rose,
body.pirate-mode .compass-north-point,
body.pirate-mode .compass-south-point,
body.pirate-mode .compass-east-point,
body.pirate-mode .compass-west-point,
body.pirate-mode .compass-ne-point,
body.pirate-mode .compass-nw-point,
body.pirate-mode .compass-se-point,
body.pirate-mode .compass-sw-point,
body.pirate-mode .compass-center,
body.pirate-mode .compass-n,
body.pirate-mode .compass-s,
body.pirate-mode .compass-e,
body.pirate-mode .compass-w,
body.pirate-mode .compass-needle {
    display: none !important;
}

body.pirate-mode .compass::after {
    content: '⚔️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    z-index: 10;
}

body.pirate-mode .signal-flag {
    filter: grayscale(0.6) brightness(0.6) contrast(1.3) saturate(1.2) !important;
    border: 1px solid rgba(139, 0, 0, 0.4) !important;
}

body.pirate-mode .flag-line::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        #8b0000 20%, 
        #333333 80%, 
        transparent 100%) !important;
}

body.pirate-mode .ancient-scroll::before {
    content: '🏴‍☠️';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    z-index: 10;
    animation: pirate-flag-wave 3s ease-in-out infinite;
}

@keyframes pirate-flag-wave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

body.pirate-mode .ships-registry {
    background: transparent !important;
    border-top: none !important;
    color: #cccccc !important;
    margin-top: 5rem !important;
}

body.pirate-mode .ships-registry .registry-seal::before {
    content: '☠️ Blackbeard\'s Registry ☠️';
    display: block;
    text-align: center;
    color: #dc143c;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
}

body.pirate-mode .ships-registry .registry-seal span {
    display: none !important;
}

body.pirate-mode .ships-registry .registry-seal div {
    color: #cccccc !important;
}

body.pirate-mode::after {
    display: none !important;
}

@keyframes drift-dark {
    0%, 100% {
        background-position: 0px 0px, 100px 100px, -50px 200px;
    }
    50% {
        background-position: 200px 50px, -100px 150px, 150px -50px;
    }
}

body.pirate-mode p,
body.pirate-mode li {
    color: #cccccc !important;
}

body.pirate-mode .position {
    color: #ffffff !important;
    text-shadow: 1px 1px 0px rgba(139, 0, 0, 0.5) !important;
    font-weight: 500 !important;
}

body.pirate-mode .captains-note p {
    color: #ffffff !important;
    text-shadow: 1px 1px 0px rgba(139, 0, 0, 0.3) !important;
}

body.pirate-mode .normal-content,
body.pirate-mode h2:not(.pirate-heading),
body.pirate-mode .position:not(.pirate-position) {
    display: none !important;
}

body.pirate-mode .pirate-content,
body.pirate-mode .pirate-heading,
body.pirate-mode .pirate-position {
    display: block !important;
}

/* Seamless ocean background */
body::after {
    content: '';
    position: fixed;
    top: -150%;
    left: -150%;
    width: 600%;
    height: 400%;
    background: 
        /* Seamless ocean base */
        linear-gradient(135deg, 
            rgba(30, 77, 114, 0.12) 0%, 
            rgba(70, 130, 180, 0.08) 25%,
            rgba(100, 149, 237, 0.06) 50%, 
            rgba(135, 206, 235, 0.04) 75%,
            rgba(30, 77, 114, 0.08) 100%),
        /* Large seamless wave pattern */
        repeating-linear-gradient(
            110deg,
            transparent 0px,
            rgba(135, 206, 235, 0.03) 80px,
            rgba(173, 216, 230, 0.05) 120px,
            rgba(135, 206, 235, 0.03) 160px,
            transparent 240px
        );
        
    animation: 
        gentleWaves 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    transform: rotate(-8deg);
    filter: blur(0.5px);
}

@keyframes simpleFlow1 {
    0%, 100% { 
        transform: rotate(-8deg) translateX(0) translateY(0);
        filter: blur(1px);
    }
    50% { 
        transform: rotate(-10deg) translateX(-15%) translateY(10px);
        filter: blur(1.2px);
    }
}

@keyframes gentleWaves {
    0%, 100% { 
        transform: rotate(-8deg) translateX(0) translateY(0);
    }
    50% { 
        transform: rotate(-10deg) translateX(-20px) translateY(15px);
    }
}

@keyframes foamDrift {
    0% { 
        transform: rotate(-8deg) translateX(0) translateY(0);
    }
    100% { 
        transform: rotate(-8deg) translateX(-200px) translateY(-50px);
    }
}

@keyframes waveDistort {
    0%, 100% {
        backdrop-filter: 
            blur(6px) 
            brightness(0.92) 
            contrast(1.3) 
            saturate(1.4) 
            hue-rotate(-5deg);
        transform: translateY(0px) scale(1);
    }
    25% {
        backdrop-filter: 
            blur(8px) 
            brightness(0.88) 
            contrast(1.4) 
            saturate(1.6) 
            hue-rotate(-8deg);
        transform: translateY(-3px) scale(1.01);
    }
    50% {
        backdrop-filter: 
            blur(4px) 
            brightness(0.95) 
            contrast(1.2) 
            saturate(1.3) 
            hue-rotate(-2deg);
        transform: translateY(2px) scale(0.99);
    }
    75% {
        backdrop-filter: 
            blur(7px) 
            brightness(0.9) 
            contrast(1.35) 
            saturate(1.5) 
            hue-rotate(-6deg);
        transform: translateY(-1px) scale(1.005);
    }
}


@keyframes bubbleWaveHit {
    /* Approach from left */
    0% { 
        transform: translateX(-200px) translateY(0) scaleX(1) scaleY(1);
        opacity: 0.3;
    }
    
    30% { 
        transform: translateX(-100px) translateY(0) scaleX(1.1) scaleY(1.1);
        opacity: 0.6;
    }
    
    50% { 
        transform: translateX(-20px) translateY(0) scaleX(1.2) scaleY(1.2);
        opacity: 0.8;
    }
    
    /* Hit content border - change direction */
    55% { 
        transform: translateX(0px) translateY(0) scaleX(1.3) scaleY(1.4);
        opacity: 1.0;
    }
    
    /* Splash and start draining downward */
    60% { 
        transform: translateX(10px) translateY(5px) scaleX(1.2) scaleY(1.6);
        opacity: 0.9;
    }
    
    /* Drain down content face */
    70% { 
        transform: translateX(15px) translateY(30px) scaleX(1.0) scaleY(2.0);
        opacity: 0.7;
    }
    
    80% { 
        transform: translateX(20px) translateY(60px) scaleX(0.8) scaleY(2.5);
        opacity: 0.5;
    }
    
    90% { 
        transform: translateX(25px) translateY(100px) scaleX(0.6) scaleY(3.0);
        opacity: 0.2;
    }
    
    100% { 
        transform: translateX(30px) translateY(150px) scaleX(0.4) scaleY(3.5);
        opacity: 0;
    }
}

@keyframes smoothWaveCrash {
    0% { 
        transform: rotate(-8deg) translateX(-150%) scaleX(1) scaleY(1);
        opacity: 0.3;
    }
    30% { 
        transform: rotate(-8deg) translateX(-80%) scaleX(1.1) scaleY(1.1);
        opacity: 0.6;
    }
    60% { 
        transform: rotate(-8deg) translateX(-20%) scaleX(1.3) scaleY(1.4);
        opacity: 0.9;
    }
    
    /* CRASH */
    70% { 
        transform: rotate(-8deg) translateX(0%) scaleX(1.5) scaleY(1.6);
        opacity: 1.0;
    }
    
    /* Spread over content */
    75% { 
        transform: rotate(-8deg) translateX(10%) scaleX(1.6) scaleY(1.3);
        opacity: 1.0;
    }
    
    /* Begin drainage */
    82% { 
        transform: rotate(-8deg) translateX(20%) translateY(15px) scaleX(1.4) scaleY(2.0);
        opacity: 0.7;
    }
    
    /* Draining off */
    90% { 
        transform: rotate(-8deg) translateX(35%) translateY(40px) scaleX(1.0) scaleY(3.0);
        opacity: 0.4;
    }
    
    100% { 
        transform: rotate(-8deg) translateX(50%) translateY(80px) scaleX(0.6) scaleY(4.5);
        opacity: 0;
    }
}

@keyframes realisticWaveCrash {
    0% { 
        transform: rotate(-8deg) translateX(-120%) translateY(0) scaleX(1) scaleY(1);
        opacity: 0.2;
    }
    20% { 
        transform: rotate(-8deg) translateX(-80%) translateY(-5px) scaleX(1.1) scaleY(1.05);
        opacity: 0.4;
    }
    40% { 
        transform: rotate(-8deg) translateX(-40%) translateY(-8px) scaleX(1.2) scaleY(1.15);
        opacity: 0.6;
    }
    55% { 
        transform: rotate(-8deg) translateX(-15%) translateY(-15px) scaleX(1.3) scaleY(1.3);
        opacity: 0.8;
    }
    
    /* CRASH - wave hits content */
    65% { 
        transform: rotate(-8deg) translateX(0%) translateY(-20px) scaleX(1.4) scaleY(1.6);
        opacity: 1.0;
    }
    
    /* Splash over content - more opaque */
    70% { 
        transform: rotate(-8deg) translateX(5%) translateY(-10px) scaleX(1.5) scaleY(1.8);
        opacity: 1.0;
    }
    
    /* Water spreads and becomes more opaque over content */
    75% { 
        transform: rotate(-8deg) translateX(10%) translateY(-5px) scaleX(1.6) scaleY(1.4);
        opacity: 0.9;
    }
    
    /* Start draining - water flows down */
    80% { 
        transform: rotate(-8deg) translateX(15%) translateY(10px) scaleX(1.4) scaleY(1.8);
        opacity: 0.7;
    }
    
    /* Drainage accelerates */
    85% { 
        transform: rotate(-8deg) translateX(20%) translateY(25px) scaleX(1.2) scaleY(2.2);
        opacity: 0.5;
    }
    
    /* Water streams off */
    90% { 
        transform: rotate(-8deg) translateX(25%) translateY(45px) scaleX(1.0) scaleY(2.8);
        opacity: 0.3;
    }
    
    /* Final drainage */
    95% { 
        transform: rotate(-8deg) translateX(30%) translateY(70px) scaleX(0.8) scaleY(3.5);
        opacity: 0.1;
    }
    
    100% { 
        transform: rotate(-8deg) translateX(35%) translateY(100px) scaleX(0.6) scaleY(4.0);
        opacity: 0;
    }
}


/* Wave distortion filter overlay - top and bottom with clear middle */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    mask: 
        linear-gradient(to bottom, 
            rgba(255,255,255,1) 0%,
            rgba(255,255,255,0.8) 15%,
            rgba(255,255,255,0.3) 25%,
            rgba(255,255,255,0.1) 35%,
            transparent 50%,
            rgba(255,255,255,0.1) 65%,
            rgba(255,255,255,0.3) 75%,
            rgba(255,255,255,0.8) 85%,
            rgba(255,255,255,1) 100%);
    -webkit-mask: 
        linear-gradient(to bottom, 
            rgba(255,255,255,1) 0%,
            rgba(255,255,255,0.8) 15%,
            rgba(255,255,255,0.3) 25%,
            rgba(255,255,255,0.1) 35%,
            transparent 50%,
            rgba(255,255,255,0.1) 65%,
            rgba(255,255,255,0.3) 75%,
            rgba(255,255,255,0.8) 85%,
            rgba(255,255,255,1) 100%);
    animation: waveDistort 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
    backdrop-filter: 
        blur(6px) 
        brightness(0.92) 
        contrast(1.3) 
        saturate(1.4) 
        hue-rotate(-5deg);
    -webkit-backdrop-filter: 
        blur(6px) 
        brightness(0.92) 
        contrast(1.3) 
        saturate(1.4) 
        hue-rotate(-5deg);
}

/* Scattered foam - no grid */
body::before {
    content: '';
    position: fixed;
    top: -150%;
    left: -150%;
    width: 600%;
    height: 400%;
    opacity: 0.22;
    background: 
        /* Scattered foam bubbles with irregular spacing */
        radial-gradient(circle at 13% 28%, rgba(255, 255, 255, 0.4) 1px, transparent 12px),
        radial-gradient(circle at 47% 19%, rgba(255, 255, 255, 0.3) 1.5px, transparent 10px),
        radial-gradient(circle at 71% 42%, rgba(255, 255, 255, 0.35) 1px, transparent 8px),
        radial-gradient(circle at 23% 67%, rgba(255, 255, 255, 0.25) 2px, transparent 14px),
        radial-gradient(circle at 84% 73%, rgba(255, 255, 255, 0.2) 1px, transparent 9px),
        radial-gradient(circle at 36% 51%, rgba(255, 255, 255, 0.3) 1.5px, transparent 11px),
        radial-gradient(circle at 59% 82%, rgba(255, 255, 255, 0.25) 1px, transparent 7px),
        radial-gradient(circle at 91% 34%, rgba(255, 255, 255, 0.2) 2px, transparent 13px);
        
    background-size: 
        437px 321px, 289px 403px, 512px 267px, 378px 489px, 
        203px 356px, 445px 198px, 334px 456px, 267px 389px;
    animation: 
        foamDrift 35s linear infinite;
    pointer-events: none;
    z-index: 0;
    transform: rotate(-8deg);
    filter: blur(0.5px);
}

@keyframes sideImpact {
    0%, 100% { 
        transform: rotate(-8deg) translateX(0) translateY(0) scaleX(1);
        opacity: 0.6;
    }
    8% { 
        transform: rotate(-12deg) translateX(-3%) translateY(-8px) scaleX(0.8);
        opacity: 0.3;
    }
    15% { 
        transform: rotate(-5deg) translateX(-8%) translateY(-20px) scaleX(1.5);
        opacity: 1.0;
    }
    25% { 
        transform: rotate(-10deg) translateX(-15%) translateY(5px) scaleX(1.2);
        opacity: 0.9;
    }
    40% { 
        transform: rotate(-6deg) translateX(-22%) translateY(-12px) scaleX(0.9);
        opacity: 0.7;
    }
    60% { 
        transform: rotate(-9deg) translateX(-28%) translateY(8px) scaleX(1.1);
        opacity: 0.8;
    }
    80% { 
        transform: rotate(-7deg) translateX(-32%) translateY(-4px) scaleX(0.95);
        opacity: 0.5;
    }
}

@keyframes drainFlow {
    0%, 100% { 
        transform: rotate(-8deg) translateY(0) scaleY(1);
        opacity: 0.6;
    }
    20% { 
        transform: rotate(-6deg) translateY(-15px) scaleY(0.8);
        opacity: 0.9;
    }
    35% { 
        transform: rotate(-10deg) translateY(25px) scaleY(1.4);
        opacity: 1.0;
    }
    50% { 
        transform: rotate(-7deg) translateY(40px) scaleY(1.6);
        opacity: 0.8;
    }
    65% { 
        transform: rotate(-9deg) translateY(60px) scaleY(1.2);
        opacity: 0.6;
    }
    85% { 
        transform: rotate(-8deg) translateY(80px) scaleY(0.9);
        opacity: 0.3;
    }
}

@keyframes mistyFoam1 {
    0% { 
        transform: rotate(-8deg) translateX(0) translateY(0) scale(1);
        filter: blur(1px);
        opacity: 0.4;
    }
    25% { 
        transform: rotate(-5deg) translateX(-8%) translateY(-12px) scale(1.03);
        filter: blur(0.7px);
        opacity: 0.6;
    }
    50% { 
        transform: rotate(-11deg) translateX(-18%) translateY(8px) scale(0.97);
        filter: blur(1.3px);
        opacity: 0.3;
    }
    75% { 
        transform: rotate(-6deg) translateX(-28%) translateY(-4px) scale(1.02);
        filter: blur(0.9px);
        opacity: 0.5;
    }
    100% { 
        transform: rotate(-8deg) translateX(-35%) translateY(0) scale(1);
        filter: blur(1px);
        opacity: 0.4;
    }
}

@keyframes mistyFoam2 {
    0% { 
        transform: rotate(-8deg) translateX(0) translateY(0) scaleY(1) scaleX(1);
        filter: blur(0.8px);
        opacity: 0.4;
    }
    30% { 
        transform: rotate(-10deg) translateX(-6%) translateY(18px) scaleY(1.08) scaleX(0.95);
        filter: blur(1.1px);
        opacity: 0.7;
    }
    60% { 
        transform: rotate(-6deg) translateX(-14%) translateY(-14px) scaleY(0.92) scaleX(1.06);
        filter: blur(0.5px);
        opacity: 0.2;
    }
    100% { 
        transform: rotate(-8deg) translateX(-22%) translateY(0) scaleY(1) scaleX(1);
        filter: blur(0.8px);
        opacity: 0.4;
    }
}

@keyframes mistyFoam3 {
    0% { 
        transform: rotate(-8deg) translateX(0) translateY(0) rotate(0deg);
        filter: blur(1.2px);
        opacity: 0.4;
    }
    20% { 
        transform: rotate(-4deg) translateX(-9%) translateY(25px) rotate(3deg);
        filter: blur(0.4px);
        opacity: 0.8;
    }
    40% { 
        transform: rotate(-12deg) translateX(-17%) translateY(-18px) rotate(-2deg);
        filter: blur(1.5px);
        opacity: 0.1;
    }
    65% { 
        transform: rotate(-7deg) translateX(-25%) translateY(12px) rotate(1deg);
        filter: blur(0.6px);
        opacity: 0.6;
    }
    85% { 
        transform: rotate(-9deg) translateX(-32%) translateY(-8px) rotate(-1deg);
        filter: blur(1px);
        opacity: 0.3;
    }
    100% { 
        transform: rotate(-8deg) translateX(-40%) translateY(0) rotate(0deg);
        filter: blur(1.2px);
        opacity: 0.4;
    }
}

.maritime-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   COMPASS NAVIGATION
   ======================================== */

.compass-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.compass {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, var(--brass-light) 0%, var(--brass) 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 0 3px var(--navy-deep),
        0 6px 18px rgba(26, 35, 50, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compass:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 3px var(--navy-deep),
        0 8px 25px rgba(26, 35, 50, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    animation: compass-sway 8s ease-in-out infinite;
    z-index: 6;
}

/* The main black shaft - north section */
.compass-needle::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 15px;
    background: var(--navy-deep);
    border-radius: 1px;
}

/* The main black shaft - south section */
.compass-needle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: var(--navy-deep);
    border-radius: 1px;
}

/* Red north triangle - at top of north shaft, heavier for visibility */
.compass-needle-north {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 8px solid #ee0000;
}

/* Black south V - two lines forming V at bottom of shaft */
.compass-needle-south {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-needle-south::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 10px;
    height: 1px;
    background: var(--navy-deep);
    transform: rotate(115deg);
    transform-origin: left bottom;
}

.compass-needle-south::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 1px;
    background: var(--navy-deep);
    transform: rotate(-115deg);
    transform-origin: right bottom;
}

/* Center pivot dot - positioned at the gap between north and south shafts */
.compass-pivot {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--navy-deep);
    border-radius: 50%;
    border: 1px solid var(--brass-light);
}

/* Small circle filling the gap around pivot dot */
.compass-pivot-ring {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: transparent;
    border: 1px solid var(--navy-deep);
    border-radius: 50%;
}

.compass-rose {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* North Point - Cardinal (smaller and finer) */
.compass-north-point {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 18px solid var(--brass);
}

/* South Point - Cardinal (smaller and finer) */
.compass-south-point {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 18px solid var(--brass);
}

/* East Point - Cardinal (smaller and finer) */
.compass-east-point {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 18px solid var(--brass);
}

/* West Point - Cardinal (smaller and finer) */
.compass-west-point {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 18px solid var(--brass);
}

/* Northeast Point - 50% smaller with bronze color */
.compass-ne-point {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 2px solid transparent;
    border-bottom: 7px solid #8b6914;
    transform: rotate(45deg);
}

/* Northwest Point - 50% smaller with bronze color */
.compass-nw-point {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 0;
    height: 0;
    border-right: 2px solid transparent;
    border-bottom: 7px solid #8b6914;
    transform: rotate(-45deg);
}

/* Southeast Point - 50% smaller with bronze color */
.compass-se-point {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 2px solid transparent;
    border-top: 7px solid #8b6914;
    transform: rotate(-45deg);
}

/* Southwest Point - 50% smaller with bronze color */
.compass-sw-point {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 0;
    height: 0;
    border-right: 2px solid transparent;
    border-top: 7px solid #8b6914;
    transform: rotate(45deg);
}

/* Center Circle - less prominent */
.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, var(--brass-light) 0%, var(--brass) 70%);
    border: 1px solid rgba(139, 105, 20, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

/* Cardinal Direction Letters - dark bronze engraved style */
.compass-n {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 900;
    color: #5d4e2a;
    font-family: var(--serif-font);
    z-index: 5;
}

.compass-s {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 900;
    color: #5d4e2a;
    font-family: var(--serif-font);
    z-index: 5;
}

.compass-e {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 900;
    color: #5d4e2a;
    font-family: var(--serif-font);
    z-index: 5;
}

.compass-w {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 900;
    color: #5d4e2a;
    font-family: var(--serif-font);
    z-index: 5;
}

@keyframes compass-sway {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

@keyframes gentle-float {
    0%, 100% { 
        transform: translateY(0px);
        box-shadow: 
            0 0 0 3px var(--navy-deep),
            0 12px 32px rgba(26, 35, 50, 0.4);
    }
    50% { 
        transform: translateY(-8px);
        box-shadow: 
            0 0 0 3px var(--navy-deep),
            0 16px 40px rgba(26, 35, 50, 0.5);
    }
}

/* Navigation Dropdown */
.nav-dropdown {
    position: absolute;
    top: 80px;
    right: 0;
    background: var(--navy-deep);
    border-radius: 12px;
    box-shadow: 
        0 15px 35px rgba(26, 35, 50, 0.5),
        inset 0 1px 0 rgba(184, 134, 11, 0.3);
    border: 2px solid var(--brass);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 200;
    min-width: 180px;
}

.nav-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--brass-light);
    text-decoration: none;
    font-family: var(--sans-font);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
    transition: all 0.2s ease;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item:hover {
    background: rgba(184, 134, 11, 0.1);
    padding-left: 1.2rem;
}

.nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

/* ========================================
   SHIP'S LOG HEADER
   ======================================== */

/* Ancient Found Scroll - unified document */
.ancient-scroll {
    background: 
        /* Major water damage stains throughout scroll */
        radial-gradient(ellipse at 12% 8%, rgba(139, 105, 20, 0.3) 0%, transparent 35%),
        radial-gradient(ellipse at 88% 25%, rgba(101, 67, 33, 0.22) 0%, transparent 40%),
        radial-gradient(circle at 45% 15%, rgba(160, 82, 45, 0.18) 0%, transparent 30%),
        radial-gradient(circle at 25% 45%, rgba(139, 105, 20, 0.16) 0%, transparent 25%),
        radial-gradient(ellipse at 85% 70%, rgba(160, 82, 45, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 15% 80%, rgba(139, 105, 20, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 75% 90%, rgba(101, 67, 33, 0.12) 0%, transparent 30%),
        /* Heavy aged spots and foxing throughout */
        radial-gradient(circle at 20% 30%, rgba(101, 67, 33, 0.15) 0%, transparent 12%),
        radial-gradient(circle at 65% 18%, rgba(139, 105, 20, 0.12) 0%, transparent 18%),
        radial-gradient(circle at 35% 60%, rgba(160, 82, 45, 0.1) 0%, transparent 15%),
        radial-gradient(circle at 80% 40%, rgba(101, 67, 33, 0.08) 0%, transparent 14%),
        radial-gradient(circle at 15% 75%, rgba(139, 105, 20, 0.09) 0%, transparent 16%),
        radial-gradient(circle at 55% 85%, rgba(160, 82, 45, 0.07) 0%, transparent 13%),
        /* Subtle paper creases and folds */
        linear-gradient(
            12deg,
            transparent 0%,
            transparent 22%,
            rgba(139, 105, 20, 0.035) 22.3%,
            rgba(139, 105, 20, 0.035) 22.7%,
            transparent 23%,
            transparent 75%,
            rgba(160, 82, 45, 0.03) 75.3%,
            rgba(160, 82, 45, 0.03) 75.7%,
            transparent 76%,
            transparent 100%
        ),
        linear-gradient(
            -15deg,
            transparent 0%,
            transparent 45%,
            rgba(101, 67, 33, 0.035) 45.3%,
            rgba(101, 67, 33, 0.035) 45.7%,
            transparent 46%,
            transparent 100%
        ),
        /* Strong paper fiber texture */
        repeating-linear-gradient(
            23deg,
            transparent 0px,
            rgba(139, 105, 20, 0.1) 1px,
            transparent 2px
        ),
        repeating-linear-gradient(
            67deg,
            transparent 0px,
            rgba(160, 82, 45, 0.08) 1px,
            transparent 3px
        ),
        /* Base heavily aged scroll */
        linear-gradient(125deg, 
            #ede1d0 0%,
            #f2e8dc 15%,
            #e8dcc4 35%,
            #efe3d4 50%,
            #e8dcc4 65%,
            #f2e8dc 85%,
            #f3e9dd 100%
        );
    border: 2px solid rgba(184, 134, 11, 0.4);
    border-bottom: none;
    border-radius: 0;
    margin-bottom: 3rem;
    position: relative;
    box-shadow: 
        0 15px 50px rgba(26, 35, 50, 0.3),
        inset 0 2px 0 rgba(220, 38, 38, 0.4),
        inset 3px 3px 12px rgba(139, 105, 20, 0.35);
    z-index: 2;
    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 99.2%, 99.5% 99.1%, 99% 99.4%, 98.5% 99.4%, 98% 99%, 97.5% 99.1%, 97% 99.5%, 96.5% 99.4%, 96% 99.2%, 95.5% 99.2%, 95% 99.3%, 94.5% 99.4%, 94% 99.1%, 93.5% 99.1%, 93% 99.4%, 92.5% 99.4%, 92% 99%, 91.5% 99.1%, 91% 99.5%, 90.5% 99.4%,
        90% 99.2%, 89.5% 99.2%, 89% 99.3%, 88.5% 99.4%, 88% 99.1%, 87.5% 99.1%, 87% 99.4%, 86.5% 99.4%, 86% 98.9%, 85.5% 99.1%, 85% 99.5%, 84.5% 99.4%, 84% 99.2%, 83.5% 99.2%, 83% 99.3%, 82.5% 99.4%, 82% 99.1%, 81.5% 99.1%, 81% 99.4%, 80.5% 99.4%,
        80% 99%, 79.5% 99.1%, 79% 99.5%, 78.5% 99.4%, 78% 99.2%, 77.5% 99.2%, 77% 99.3%, 76.5% 99.4%, 76% 99.1%, 75.5% 99.1%, 75% 99.4%, 74.5% 99.4%, 74% 98.8%, 73.5% 99.1%, 73% 99.5%, 72.5% 99.4%, 72% 99.2%, 71.5% 99.2%, 71% 99.3%, 70.5% 99.4%,
        70% 99.1%, 69.5% 99.1%, 69% 99.4%, 68.5% 99.4%, 68% 99%, 67.5% 99.1%, 67% 99.5%, 66.5% 99.4%, 66% 99.2%, 65.5% 99.2%, 65% 99.3%, 64.5% 99.4%, 64% 99.1%, 63.5% 99.1%, 63% 99.4%, 62.5% 99.4%, 62% 98.9%, 61.5% 99.1%, 61% 99.5%, 60.5% 99.4%,
        60% 99.2%, 59.5% 99.2%, 59% 99.3%, 58.5% 99.4%, 58% 99.1%, 57.5% 99.1%, 57% 99.4%, 56.5% 99.4%, 56% 99%, 55.5% 99.1%, 55% 99.5%, 54.5% 99.4%, 54% 99.2%, 53.5% 99.2%, 53% 99.3%, 52.5% 99.4%, 52% 99.1%, 51.5% 99.1%, 51% 99.4%, 50.5% 99.4%,
        50% 98.9%, 49.5% 99.1%, 49% 99.5%, 48.5% 99.4%, 48% 99.2%, 47.5% 99.2%, 47% 99.3%, 46.5% 99.4%, 46% 99.1%, 45.5% 99.1%, 45% 99.4%, 44.5% 99.4%, 44% 99%, 43.5% 99.2%, 43% 99.5%, 42.5% 99.4%, 42% 99.2%, 41.5% 99.1%, 41% 99.3%, 40.5% 99.4%,
        40% 98.9%, 39.5% 99.2%, 39% 99.4%, 38.5% 99.4%, 38% 99.1%, 37.5% 99.1%, 37% 99.5%, 36.5% 99.3%, 36% 99.2%, 35.5% 99.4%, 35% 99%, 34.5% 99.1%, 34% 99.4%, 33.5% 99.2%, 33% 99.3%, 32.5% 99.4%, 32% 99.1%, 31.5% 99.1%, 31% 99.5%, 30.5% 99.4%,
        30% 98.8%, 29.5% 99.2%, 29% 99.4%, 28.5% 99.4%, 28% 99.2%, 27.5% 99.1%, 27% 99.3%, 26.5% 99.4%, 26% 99%, 25.5% 99.2%, 25% 99.5%, 24.5% 99.4%, 24% 99.1%, 23.5% 99.1%, 23% 99.4%, 22.5% 99.3%, 22% 99.2%, 21.5% 99.4%, 21% 98.9%, 20.5% 99.1%,
        20% 99.5%, 19.5% 99.2%, 19% 99.3%, 18.5% 99.4%, 18% 99.1%, 17.5% 99.1%, 17% 99.4%, 16.5% 99.4%, 16% 99%, 15.5% 99.2%, 15% 99.6%, 14.5% 99.4%, 14% 99.2%, 13.5% 99.1%, 13% 99.3%, 12.5% 99.4%, 12% 98.8%, 11.5% 99.2%, 11% 99.5%, 10.5% 99.4%,
        10% 99.1%, 9.5% 99.1%, 9% 99.4%, 8.5% 99.5%, 8% 99%, 7.5% 99.4%, 7% 99.2%, 6.5% 99.2%, 6% 99.6%, 5.5% 99.1%, 5% 99.3%, 4.5% 99.4%, 4% 98.9%, 3.5% 99%, 3% 99.4%, 2.5% 99.3%, 2% 99.1%, 1.5% 99.5%, 1% 99%, 0.5% 99.4%, 0% 99.2%
    );
}

.ships-log::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--brass), var(--brass-light), var(--brass));
    z-index: -1;
    border-radius: 0;
}

.log-entry {
    padding: 2.5rem 2.5rem;
    text-align: center;
    background: transparent;
    position: relative;
}

.titles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.title-primary {
    font-family: 'Inter Tight', var(--sans-font);
    font-size: 1.2rem;
    color: var(--brass);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-variant: small-caps;
}

.title-secondary {
    font-family: 'Inter Tight', var(--sans-font);
    font-size: 1rem;
    color: var(--navy-light);
    font-weight: 400;
    letter-spacing: 0.3px;
    font-style: normal;
}

.captain-name {
    font-family: var(--serif-font);
    font-size: 3rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0px rgba(184, 134, 11, 0.3);
}

.vessel-info {
    margin-bottom: 2rem;
    font-family: var(--sans-font);
    font-weight: 500;
}

.position {
    color: var(--navy-light);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.crew-photo {
    margin-bottom: 1.5rem;
}

.captain-portrait {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid var(--brass);
    box-shadow: 
        0 0 0 3px var(--navy-deep),
        0 12px 32px rgba(26, 35, 50, 0.4);
    object-fit: cover;
    animation: gentle-float 8s ease-in-out infinite;
}

/* ========================================
   SIGNAL FLAGS (LINKS)
   ======================================== */

.scroll-header {
    padding: 2.5rem 4rem 2rem 4rem;
    text-align: center;
    background: transparent;
    position: relative;
    margin-bottom: 2rem;
}

.scroll-header .crew-photo {
    margin-bottom: 1.5rem;
}

.scroll-header .captain-portrait {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 6px solid var(--brass);
    box-shadow: 
        0 0 0 4px var(--navy-deep),
        0 15px 40px rgba(26, 35, 50, 0.5);
    object-fit: cover;
    animation: gentle-float 8s ease-in-out infinite;
}

.scroll-header .captain-name {
    font-family: 'Cinzel', var(--serif-font);
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin-bottom: 0.3rem;
    text-shadow: 2px 2px 0px rgba(184, 134, 11, 0.3);
    letter-spacing: 2px;
}

.scroll-header .titles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.scroll-header .title-primary {
    font-family: 'Inter Tight', var(--sans-font);
    font-size: 1.2rem;
    color: var(--brass);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-variant: small-caps;
}

.scroll-header .title-secondary {
    font-family: 'Inter Tight', var(--sans-font);
    font-size: 1rem;
    color: var(--navy-light);
    font-weight: 400;
    letter-spacing: 0.3px;
    font-style: normal;
}

.scroll-header .vessel-info {
    margin-bottom: 2rem;
    font-family: var(--sans-font);
    font-weight: 500;
}

.scroll-header .position {
    color: var(--navy-light);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.scroll-header .signal-flags {
    margin-top: 2rem;
    margin-bottom: 0;
    position: relative;
}

.flag-line {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
}

.flag-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #8b4513 20%, 
        #654321 80%, 
        transparent 100%);
    z-index: 3;
}

.flag-line::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rope-tan);
    z-index: 0;
    box-shadow: 0 1px 0 var(--weathered-wood);
}

.signal-flag {
    width: 28px;
    height: 42px;
    display: block;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    animation: flag-wave 4s ease-in-out infinite;
    transform-origin: top center;
    box-sizing: border-box;
    border-top: 1px solid white;
}

.signal-flag:nth-child(1) { animation-delay: 0s; }
.signal-flag:nth-child(2) { animation-delay: -1s; }
.signal-flag:nth-child(3) { animation-delay: -2s; }
.signal-flag:nth-child(4) { animation-delay: -3s; }
.signal-flag:nth-child(5) { animation-delay: -4s; }

@keyframes flag-wave {
    0%, 100% { 
        transform: translateY(12px) rotate(360deg) rotateY(0deg) rotateZ(-1deg);
    }
    25% { 
        transform: translateY(12px) rotate(360deg) rotateY(8deg) rotateZ(1deg);
    }
    50% { 
        transform: translateY(12px) rotate(360deg) rotateY(-3deg) rotateZ(-0.5deg);
    }
    75% { 
        transform: translateY(12px) rotate(360deg) rotateY(6deg) rotateZ(0.5deg);
    }
}

@keyframes flag-pulse {
    0%, 100% { 
        transform: translateY(12px) rotate(360deg) scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: translateY(12px) rotate(360deg) scale(1.15);
        filter: brightness(1.3);
    }
}

.flag-pattern {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Swallowtail flags - double-peaked cutout at the bottom edge */
.alpha-pattern,
.bravo-pattern {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 75%, 0% 100%);
}


/* Victor Flag - V (Vault Profile) - White with red diagonal cross */
.victor-pattern {
    background: white;
}
.victor-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 45%, #ee0000 47%, #ee0000 53%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, #ee0000 47%, #ee0000 53%, transparent 55%);
}

/* Golf Flag - G (GitHub) - Yellow with blue vertical stripes */
.golf-pattern {
    background: 
        linear-gradient(90deg, 
            #ffcc00 0%, #ffcc00 16.66%, 
            #0044bb 16.66%, #0044bb 33.33%,
            #ffcc00 33.33%, #ffcc00 50%,
            #0044bb 50%, #0044bb 66.66%,
            #ffcc00 66.66%, #ffcc00 83.33%,
            #0044bb 83.33%, #0044bb 100%);
}

/* Bravo Flag - B - Solid red (if needed) */
.bravo-pattern {
    background: #ee0000;
}

/* Delta Flag - D (@donohfx) - Yellow with blue triangle */
/* Delta Flag - D - Yellow, blue, yellow in 1:2:1 ratio */
.delta-pattern {
    background: 
        linear-gradient(90deg, 
            #ffcc00 0%, #ffcc00 25%, 
            #0044bb 25%, #0044bb 75%, 
            #ffcc00 75%, #ffcc00 100%);
}

/* Hotel Flag - H (@hardtackracing) - White and red vertical halves */
.hotel-pattern {
    background: white;
    position: relative;
}
.hotel-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: #ee0000;
}

/* Charlie Flag - C - Blue, white, red, white, blue horizontal stripes */
.charlie-pattern {
    background: 
        linear-gradient(0deg,
            #0044bb 0%, #0044bb 20%,
            white 20%, white 40%,
            #ee0000 40%, #ee0000 60%,
            white 60%, white 80%,
            #0044bb 80%, #0044bb 100%);
}

/* Alpha Flag - A - White at top, blue at bottom (for rotated flag) */
.alpha-pattern {
    background: white;
    position: relative;
}
.alpha-pattern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 54%;
    background: #0044bb;
}

/* Echo Flag - E - Blue with red horizontal stripe */
.echo-pattern {
    background: #0044bb;
    position: relative;
}
.echo-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: #ee0000;
}

/* Foxtrot Flag - F - White with red diamond */
.foxtrot-pattern {
    background: white;
}
.foxtrot-pattern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #ee0000;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* India Flag - I - Yellow with black circle */
.india-pattern {
    background: #ffcc00;
}
.india-pattern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--navy-deep);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Juliet Flag - J - Blue with white horizontal stripe */
.juliet-pattern {
    background: 
        linear-gradient(0deg,
            #0044bb 0%, #0044bb 33%,
            white 33%, white 67%,
            #0044bb 67%, #0044bb 100%);
}

/* Kilo Flag - K - Yellow and blue vertical */
.kilo-pattern {
    background: 
        linear-gradient(90deg,
            #ffcc00 0%, #ffcc00 50%,
            #0044bb 50%, #0044bb 100%);
}

/* Lima Flag - L - Yellow and black squares */
.lima-pattern {
    background: 
        linear-gradient(45deg, 
            #ffcc00 25%, var(--navy-deep) 25%, var(--navy-deep) 50%,
            #ffcc00 50%, #ffcc00 75%, var(--navy-deep) 75%),
        linear-gradient(45deg, 
            #ffcc00 25%, var(--navy-deep) 25%, var(--navy-deep) 50%,
            #ffcc00 50%, #ffcc00 75%, var(--navy-deep) 75%);
    background-size: 14px 14px;
    background-position: 0 0, 7px 7px;
}

/* Mike Flag - M - White and blue X */
.mike-pattern {
    background: white;
}
.mike-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 45%, #0044bb 47%, #0044bb 53%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, #0044bb 47%, #0044bb 53%, transparent 55%);
}

/* November Flag - N - Blue and white checkerboard */
.november-pattern {
    background: 
        linear-gradient(45deg, 
            #0044bb 25%, white 25%, white 50%,
            #0044bb 50%, #0044bb 75%, white 75%),
        linear-gradient(45deg, 
            #0044bb 25%, white 25%, white 50%,
            #0044bb 50%, #0044bb 75%, white 75%);
    background-size: 12px 12px;
    background-position: 0 0, 6px 6px;
}

/* Romeo Flag - R - Yellow with red cross */
.romeo-pattern {
    background: #ffcc00;
}
.romeo-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 45%, #ee0000 47%, #ee0000 53%, transparent 55%),
        linear-gradient(0deg, transparent 45%, #ee0000 47%, #ee0000 53%, transparent 55%);
}

/* Oscar Flag - O - Yellow and red diagonal split */
.oscar-pattern {
    background: #ffcc00;
    position: relative;
}
.oscar-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ee0000;
    clip-path: polygon(100% 0%, 100% 100%, 0% 100%);
}

/* Uniform Flag - U - White and red quadrants */
.uniform-pattern {
    background: 
        linear-gradient(45deg, 
            white 0%, white 25%, 
            #ee0000 25%, #ee0000 50%,
            white 50%, white 75%, 
            #ee0000 75%, #ee0000 100%);
    background-size: 20px 20px;
}

/* Flag spacer for word separation */
.flag-spacer {
    width: 20px;
    background: transparent;
}


/* ========================================
   LOG BOOK (MAIN CONTENT)
   ======================================== */

.log-book {
    background: 
        /* Major water damage stains */
        radial-gradient(ellipse at 10% 15%, rgba(139, 105, 20, 0.3) 0%, transparent 30%),
        radial-gradient(ellipse at 92% 80%, rgba(101, 67, 33, 0.22) 0%, transparent 35%),
        radial-gradient(circle at 45% 5%, rgba(160, 82, 45, 0.18) 0%, transparent 25%),
        radial-gradient(circle at 75% 95%, rgba(139, 105, 20, 0.16) 0%, transparent 20%),
        /* Heavy aged spots and foxing */
        radial-gradient(circle at 20% 60%, rgba(101, 67, 33, 0.15) 0%, transparent 12%),
        radial-gradient(circle at 65% 25%, rgba(139, 105, 20, 0.12) 0%, transparent 18%),
        radial-gradient(circle at 30% 90%, rgba(160, 82, 45, 0.1) 0%, transparent 15%),
        radial-gradient(circle at 80% 40%, rgba(101, 67, 33, 0.08) 0%, transparent 14%),
        radial-gradient(circle at 15% 75%, rgba(139, 105, 20, 0.09) 0%, transparent 16%),
        radial-gradient(circle at 55% 85%, rgba(160, 82, 45, 0.07) 0%, transparent 13%),
        /* Strong paper fiber texture */
        repeating-linear-gradient(
            23deg,
            transparent 0px,
            rgba(139, 105, 20, 0.1) 1px,
            transparent 2px
        ),
        repeating-linear-gradient(
            67deg,
            transparent 0px,
            rgba(160, 82, 45, 0.08) 1px,
            transparent 3px
        ),
        /* Base heavily aged paper */
        linear-gradient(125deg, 
            #ede1d0 0%,
            #f2e8dc 25%,
            #e8dcc4 50%,
            #efe3d4 75%,
            #f3e9dd 100%
        );
    border: 2px solid var(--navy-deep);
    box-shadow: 
        0 12px 40px rgba(26, 35, 50, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 3px 3px 12px rgba(139, 105, 20, 0.35);
    position: relative;
}

.log-book::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--brass) 5%, 
        var(--brass) 95%, 
        transparent 100%);
}

.log-entry-section {
    padding: 1.5rem 4rem 2.5rem 4rem;
    position: relative;
}

.log-entry-section:first-of-type {
    padding-top: 2rem;
}

.entry-header {
    margin-bottom: 2rem;
    position: relative;
}

.entry-header h2 {
    font-family: var(--serif-font);
    font-size: 1.8rem;
    color: var(--navy-deep);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2rem;
}

.entry-header h2::before {
    content: '◦';
    position: absolute;
    left: 0;
    color: var(--brass);
    font-size: 1.5rem;
}

.entry-divider {
    display: none;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--navy-medium);
    margin-left: 2rem;
}

.entry-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.maritime-list {
    list-style: none;
    padding: 0;
}

.maritime-list li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2rem;
}

.maritime-list li::before {
    content: '⚓';
    position: absolute;
    left: 0;
    color: var(--brass);
    font-size: 0.9rem;
}

/* ========================================
   CAPTAIN'S NOTE
   ======================================== */

.captains-note {
    padding: 2.5rem 4rem 4rem 4rem;
    margin: 0;
    background: transparent;
    border-top: 3px solid var(--brass);
    position: relative;
}

.captains-note::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brass), var(--brass-light), var(--brass));
}

.note-border p {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--navy-deep);
    text-align: center;
    line-height: 1.6;
    font-weight: 500;
}

/* ========================================
   SHIP'S REGISTRY FOOTER
   ======================================== */

.ships-registry {
    margin-top: 3rem;
    text-align: center;
}

.registry-seal {
    background: var(--navy-deep);
    color: var(--brass-light);
    padding: 1.5rem;
    border-radius: 50px;
    display: inline-block;
    font-family: var(--sans-font);
    font-weight: 500;
    box-shadow: 
        0 8px 24px rgba(26, 35, 50, 0.3),
        inset 0 1px 0 rgba(184, 134, 11, 0.3);
}

.registry-seal span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.registry-seal div {
    font-size: 0.8rem;
    opacity: 0.8;
}

.treasure-hint {
    font-size: 0.75rem !important;
    color: var(--brass) !important;
    opacity: 0.7 !important;
    font-style: italic !important;
    margin-top: 8px !important;
}

/* Floating Treasure Chest Easter Egg Hint */
.floating-treasure-chest {
    position: fixed;
    font-size: 2rem;
    z-index: 50;
    opacity: 0;
    animation: treasure-float 15s ease-in-out infinite;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.5s ease;
}

.floating-treasure-chest:hover {
    animation: treasure-guide 2s ease-in-out forwards;
    transform: scale(1.2);
}

@keyframes treasure-float {
    0%, 90%, 100% { 
        opacity: 0; 
        transform: translateX(0) scale(1); 
    }
    5%, 85% { 
        opacity: 0.7; 
        transform: translateX(-70px) scale(1.05); 
    }
    45% { 
        opacity: 0.9; 
        transform: translateX(-80px) scale(1.1); 
    }
}

@keyframes treasure-guide {
    0% { 
        opacity: 0.9;
        transform: scale(1.2);
    }
    100% { 
        opacity: 1;
        transform: translateX(-50vw) translateY(-40vh) scale(1.3);
    }
}

/* Konami Code Progress Counter */
.konami-progress {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.konami-progress.show {
    opacity: 0.7;
}

.konami-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(184, 134, 11, 0.3);
    border: 1px solid var(--brass);
}

.konami-dot.active {
    background: var(--brass);
    box-shadow: 0 0 6px rgba(184, 134, 11, 0.6);
}

/* Signal Flag Tooltip */
.tooltip-flag {
    position: relative;
}

.flag-tooltip {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 35, 50, 0.95);
    color: var(--brass-light);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 200;
    border: 1px solid var(--brass);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.4);
}

.flag-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(26, 35, 50, 0.95);
}

.tooltip-flag:hover .flag-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Compass Hover Easter Egg */
.compass::before {
    content: '☠️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 20;
    pointer-events: none;
}

.compass.show-skull::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .maritime-container {
        padding: 1rem;
    }
    
    .compass-nav {
        top: 1rem;
        right: 1rem;
    }
    
    .compass {
        width: 60px;
        height: 60px;
    }
    
    /* Adjust compass needle for smaller screens */
    .compass-needle::before {
        height: 12px; /* Reduce north shaft */
    }
    
    .compass-needle::after {
        height: 8px; /* Reduce south shaft */
    }
    
    .compass-needle-north {
        top: -16px; /* Adjust red triangle position */
        border-left: 3px solid transparent;
        border-right: 3px solid transparent;
    }
    
    .compass-needle-south {
        bottom: -10px; /* Adjust V-tail position */
    }
    
    .compass-pivot {
        top: -2px;
    }
    
    .compass-pivot-ring {
        top: -3px;
        width: 5px;
        height: 5px;
    }
    
    .nav-dropdown {
        top: 70px;
        right: -10px;
        min-width: 160px;
    }
    
    .nav-item {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .log-entry {
        padding: 1.8rem 1.5rem;
    }
    
    .captain-portrait {
        width: 140px;
        height: 140px;
        border: 4px solid var(--brass);
        box-shadow: 
            0 0 0 2px var(--navy-deep),
            0 8px 24px rgba(26, 35, 50, 0.3);
    }
    
    .crew-photo {
        margin-bottom: 1.5rem;
    }
    
    .captain-name {
        font-size: 2.2rem;
    }
    
    .titles {
        gap: 0.3rem;
        margin-bottom: 1rem;
    }
    
    .title-primary {
        font-size: 1.1rem;
    }
    
    .title-secondary {
        font-size: 0.9rem;
    }
    
    .flag-line {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .signal-flag {
        width: 24px;
        height: 36px;
    }
    
    .log-book::before {
        left: 30px;
    }
    
    .log-entry-section {
        padding: 1.8rem 2rem 1.8rem 3rem;
    }
    
    .entry-header h2 {
        font-size: 1.5rem;
        padding-left: 1.5rem;
    }
    
    .entry-divider {
        margin-left: 1.5rem;
        width: 150px;
    }
    
    .entry-content {
        margin-left: 1.5rem;
        font-size: 1rem;
    }
    
    .entry-content p {
        text-align: left;
    }
    
    .maritime-list li {
        padding-left: 1.5rem;
    }
    
    .captains-note {
        padding: 1.8rem 2rem 1.8rem 3rem;
    }
    
    .note-border p {
        font-size: 1.1rem;
    }
}