/* ================================================
   lugubrious.dev - Art-Deco Tropical Tutorial
   ================================================ */

/* --- Design Palette Reference ---
   #FFF5E6, #0B1930, #FF5E8A, #00D4AA, #B47EFF,
   #D4A843, #1A1A2E, #3D3450, #F0E6FF, #FF8EC7,
   #FF6B35, #00E5A0, #FFE8D6, #FFFFFF
   ----------------------------------- */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    color: #3D3450;
    background-color: #FFF5E6;
    overflow-x: hidden;
    position: relative;
}

/* --- Coral Fan Background Pattern --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 100%,
            transparent 0deg,
            rgba(212, 168, 67, 0.04) 10deg,
            transparent 20deg
        );
    background-size: 120px 80px;
    background-position: center top;
}

/* --- Seahorse Watermark --- */
.seahorse-watermark {
    position: fixed;
    left: 2vw;
    top: 20vh;
    width: 60px;
    height: 200px;
    z-index: 0;
    pointer-events: none;
}

.seahorse-svg {
    width: 100%;
    height: 100%;
}

/* ================================================
   GRAND ENTRY HEADER
   ================================================ */
#grand-entry {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #FFF5E6 0%, #FFE8D6 100%);
    overflow: hidden;
    z-index: 1;
}

.arch {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Arch Pillars */
.arch-left-pillar,
.arch-right-pillar {
    position: absolute;
    top: 15%;
    width: 40px;
    height: 85%;
    background: linear-gradient(180deg, #D4A843, #B8912E, #D4A843);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.arch-left-pillar {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.arch-left-pillar::before,
.arch-right-pillar::before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 20px,
        rgba(255, 245, 230, 0.2) 20px,
        rgba(255, 245, 230, 0.2) 22px
    );
}

.arch-left-pillar::after,
.arch-right-pillar::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 60px;
    height: 30px;
    background: #D4A843;
}

.arch-left-pillar::after {
    left: 0;
    border-radius: 0 0 0 8px;
}

.arch-right-pillar {
    right: 0;
    border-radius: 0 4px 4px 0;
}

.arch-right-pillar::after {
    right: 0;
    border-radius: 0 0 8px 0;
}

/* Arch Top */
.arch-top {
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 60px;
    background: linear-gradient(90deg, #D4A843, #E5C76B, #D4A843);
    border-radius: 30px 30px 0 0;
    clip-path: polygon(0% 100%, 5% 40%, 15% 10%, 30% 0%, 50% 0%, 70% 0%, 85% 10%, 95% 40%, 100% 100%);
}

.arch-top::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 15%;
    right: 15%;
    height: 40px;
    border: 2px solid rgba(255, 245, 230, 0.3);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    clip-path: polygon(0% 100%, 10% 20%, 30% 0%, 70% 0%, 90% 20%, 100% 100%);
}

.arch-top::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 30%;
    right: 30%;
    height: 30px;
    border: 1px solid rgba(255, 245, 230, 0.2);
    border-bottom: none;
    border-radius: 15px 15px 0 0;
}

/* Arch Opened State */
.arch.opened .arch-left-pillar {
    transform: scaleX(1.3) translateX(-10px);
}

.arch.opened .arch-right-pillar {
    transform: scaleX(1.3) translateX(10px);
}

/* Keystone / Title Area */
.arch-keystone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 2;
}

.title-block {
    text-align: center;
}

.site-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1A1A2E;
    line-height: 1.2;
    margin-bottom: 10px;
}

.site-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3D3450;
    opacity: 0.8;
}

/* Flanking Fish */
.fish-left,
.fish-right {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
}

.angelfish-svg {
    width: 100%;
    height: 100%;
}

/* Swimming Fish in Header */
.swimming-fish {
    position: absolute;
    width: 60px;
    height: 40px;
}

.swim-fish {
    width: 100%;
    height: 100%;
}

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

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

@keyframes swimRight {
    0% { left: -80px; }
    50% { left: calc(100% + 80px); }
    50.01% { left: -80px; }
    100% { left: -80px; }
}

@keyframes swimLeft {
    0% { right: -80px; }
    50% { right: calc(100% + 80px); }
    50.01% { right: -80px; }
    100% { right: -80px; }
}

/* ================================================
   NAVIGATION BAND
   ================================================ */
#nav-band {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFF5E6;
    border-top: 3px solid #D4A843;
    border-bottom: 3px solid #D4A843;
    padding: 0;
}

.nav-frieze {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    gap: 15px;
}

.chevron-pattern {
    flex: 0 0 40px;
    height: 20px;
    background: repeating-linear-gradient(
        -60deg,
        transparent,
        transparent 4px,
        #D4A843 4px,
        #D4A843 6px
    );
    opacity: 0.5;
}

.nav-items {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-pill {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: #3D3450;
    padding: 6px 18px;
    border: 1.5px solid #D4A843;
    border-radius: 0;
    clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
    background: transparent;
    transition: background 0.3s, color 0.3s;
}

.nav-pill:hover {
    background: #D4A843;
    color: #FFF5E6;
}

/* ================================================
   CONTENT FLOW
   ================================================ */
#content-flow {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 20px 80px;
}

/* --- Tutorial Sections --- */
.tutorial-section {
    margin-bottom: 20px;
}

.section-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Headings --- */
h2 {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1A1A2E;
    margin-bottom: 24px;
    line-height: 1.3;
}

/* --- Drop Cap --- */
.drop-cap {
    font-family: 'Poiret One', cursive;
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 6px;
    color: #FF5E8A;
}

/* --- Paragraphs --- */
p {
    margin-bottom: 20px;
}

/* --- Inline Code --- */
code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    background: rgba(11, 25, 48, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    color: #3D3450;
}

/* --- Code Blocks --- */
.code-block-wrapper {
    margin: 30px 0;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.code-block-wrapper.visible {
    opacity: 1;
    transform: translateX(0);
}

.code-frame {
    position: relative;
    background: #0B1930;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #D4A843;
    box-shadow:
        0 0 0 4px #FFF5E6,
        0 0 0 6px rgba(212, 168, 67, 0.4),
        0 0 0 10px #FFF5E6,
        0 0 0 11px rgba(212, 168, 67, 0.2);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(212, 168, 67, 0.12);
    border-bottom: 1px solid rgba(212, 168, 67, 0.3);
}

.code-lang {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #D4A843;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-coral { background: #FF5E8A; }
.dot-gold { background: #D4A843; }
.dot-teal { background: #00D4AA; }

pre {
    padding: 20px;
    overflow-x: auto;
    margin: 0;
}

pre code {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.9em;
    line-height: 1.65;
    color: #F0E6FF;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Syntax Colors */
.kw { color: #FF5E8A; }       /* Keywords - Hot Coral */
.str { color: #B47EFF; }      /* Strings - Candied Violet */
.cm { color: rgba(212, 168, 67, 0.6); }  /* Comments - Gold at 60% */
.fn { color: #00D4AA; }       /* Functions - Electric Teal */

/* --- Blockquotes --- */
.deco-blockquote {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 30px 0;
    padding: 24px 20px;
    background: rgba(180, 126, 255, 0.06);
    border-left: 4px solid #B47EFF;
    border-right: 4px solid #B47EFF;
}

.deco-blockquote p {
    flex: 1;
    font-style: italic;
    font-size: 1.05em;
    color: #1A1A2E;
    margin-bottom: 0;
}

.blockquote-fish-left,
.blockquote-fish-right {
    flex: 0 0 40px;
    width: 40px;
    height: 30px;
}

.clownfish {
    width: 100%;
    height: 100%;
}

/* ================================================
   ORNAMENTAL DIVIDERS
   ================================================ */
.deco-divider {
    position: relative;
    height: 40px;
    margin: 40px auto;
    max-width: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-line {
    width: 0;
    height: 2px;
    background: #D4A843;
    transition: width 0.4s ease-out;
}

.deco-divider.visible .divider-line {
    width: 100%;
}

.divider-fan-left,
.divider-fan-right {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: scale(0);
    transition: transform 0.2s ease-out 0.4s;
}

.deco-divider.visible .divider-fan-left,
.deco-divider.visible .divider-fan-right {
    transform: scale(1);
}

.divider-fan-left {
    left: 0;
    background: conic-gradient(
        from -90deg at 100% 100%,
        #D4A843 0deg,
        transparent 30deg,
        #D4A843 60deg,
        transparent 90deg,
        #D4A843 120deg,
        transparent 150deg,
        transparent 360deg
    );
    clip-path: polygon(100% 100%, 0% 0%, 100% 0%);
}

.divider-fan-right {
    right: 0;
    background: conic-gradient(
        from 90deg at 0% 100%,
        transparent 0deg,
        transparent 210deg,
        #D4A843 210deg,
        transparent 240deg,
        #D4A843 240deg,
        transparent 270deg,
        #D4A843 270deg,
        transparent 300deg
    );
    clip-path: polygon(0% 100%, 0% 0%, 100% 0%);
}

/* ================================================
   FOOTER
   ================================================ */
#site-footer {
    position: relative;
    background: linear-gradient(0deg, #FFF5E6 0%, #FFE8D6 100%);
    padding: 60px 20px 40px;
    text-align: center;
    border-top: 3px solid #D4A843;
    overflow: hidden;
}

/* Footer Arch (Inverted) */
.footer-arch {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 40px;
    margin: 0 auto 30px;
}

.footer-arch-left,
.footer-arch-right {
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(180deg, #D4A843, #B8912E);
}

.footer-arch-left { left: 0; }
.footer-arch-right { right: 0; }

.footer-arch-bottom {
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 30px;
    background: linear-gradient(90deg, #D4A843, #E5C76B, #D4A843);
    border-radius: 0 0 30px 30px;
    clip-path: polygon(0% 0%, 100% 0%, 95% 60%, 85% 90%, 70% 100%, 50% 100%, 30% 100%, 15% 90%, 5% 60%);
}

/* Fish Marquee */
.footer-fish-marquee {
    overflow: hidden;
    width: 100%;
    margin: 20px 0;
}

.fish-train {
    display: flex;
    gap: 40px;
    animation: marqueeSwim 20s linear infinite;
    width: max-content;
}

.tiny-fish {
    width: 35px;
    height: 25px;
    flex-shrink: 0;
}

@keyframes marqueeSwim {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.footer-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3D3450;
    opacity: 0.7;
    margin-bottom: 0;
}

/* ================================================
   HOVER FISH (on code blocks)
   ================================================ */
#hover-fish-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hover-fish {
    position: absolute;
    width: 40px;
    height: 28px;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.hover-fish.swimming {
    animation: fishSwimAcross 3s ease-in-out forwards;
}

@keyframes fishSwimAcross {
    0% {
        opacity: 0;
        transform: translateX(-50px) translateY(0);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateX(calc(50vw)) translateY(-8px);
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(calc(100vw)) translateY(0);
    }
}

/* ================================================
   DARK MODE
   ================================================ */
body.dark-mode {
    background-color: #0B1930;
    color: #F0E6FF;
}

body.dark-mode h2,
body.dark-mode .site-title {
    color: #F0E6FF;
}

body.dark-mode .site-subtitle {
    color: rgba(240, 230, 255, 0.7);
}

body.dark-mode p {
    color: #F0E6FF;
}

body.dark-mode #nav-band {
    background: #0B1930;
}

body.dark-mode .nav-pill {
    color: #F0E6FF;
}

body.dark-mode .nav-pill:hover {
    color: #0B1930;
}

body.dark-mode #grand-entry {
    background: linear-gradient(180deg, #0B1930 0%, #0F2240 100%);
}

body.dark-mode #site-footer {
    background: linear-gradient(0deg, #0B1930 0%, #0F2240 100%);
}

body.dark-mode .deco-blockquote {
    background: rgba(180, 126, 255, 0.1);
}

body.dark-mode .deco-blockquote p {
    color: #F0E6FF;
}

body.dark-mode code {
    background: rgba(240, 230, 255, 0.1);
    color: #F0E6FF;
}

body.dark-mode .drop-cap {
    color: #FF8EC7;
}

body.dark-mode .footer-text {
    color: #F0E6FF;
}

body.dark-mode::before {
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 100%,
            transparent 0deg,
            rgba(212, 168, 67, 0.03) 10deg,
            transparent 20deg
        );
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .arch-keystone {
        flex-direction: column;
        gap: 15px;
    }

    .fish-left,
    .fish-right {
        width: 50px;
        height: 38px;
    }

    .arch-keystone {
        flex-direction: row;
    }

    .arch-left-pillar,
    .arch-right-pillar {
        width: 25px;
    }

    #content-flow {
        padding: 40px 16px 60px;
    }

    .code-frame {
        box-shadow:
            0 0 0 3px #FFF5E6,
            0 0 0 4px rgba(212, 168, 67, 0.4);
    }

    .nav-pill {
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    .deco-blockquote {
        flex-direction: column;
        gap: 12px;
    }

    .blockquote-fish-left,
    .blockquote-fish-right {
        display: none;
    }

    pre {
        padding: 14px;
    }

    pre code {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .fish-left,
    .fish-right {
        display: none;
    }

    .site-title {
        font-size: clamp(1.6rem, 8vw, 2.5rem);
    }

    h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .drop-cap {
        font-size: 2.5em;
    }

    .swimming-fish {
        display: none;
    }
}
