/* ==========================================================================
   GABS.WIKI — Art-Deco Encyclopedic Reference
   Colors: #C46A3A, #F5EED8, #B8963A, #1A1A20, #8B3A2A, #7A8068, #FAF6EE
   Fonts: Libre Baskerville, Newsreader, Azeret Mono
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #FAF6EE;
    color: #1A1A20;
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Sci-fi HUD Sidebar --- */
#hud-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 40px;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-40px);
}

.hud-dots {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.hud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid rgba(184, 150, 58, 0.3);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

.hud-dot.active {
    background-color: #B8963A;
    border-color: #B8963A;
}

.hud-dot:hover {
    transform: scale(1.6);
    border-color: #B8963A;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FAF6EE;
    overflow: hidden;
}

/* Deco Radiating Lines Background */
.deco-radiating-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        from 0deg,
        rgba(184, 150, 58, 0.06) 0deg 1deg,
        transparent 1deg 10deg
    );
    border-radius: 50%;
    opacity: 0;
    animation: decoLinesReveal 1s 0.2s ease-out forwards;
}

@keyframes decoLinesReveal {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(0deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

@keyframes decoLinesSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Burnt Orange center glow */
#hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(196, 106, 58, 0.25) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: orangeGlow 0.6s 0.1s ease-out forwards;
}

@keyframes orangeGlow {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Monogram */
.monogram-container {
    margin-bottom: 40px;
}

#monogram-svg {
    overflow: visible;
}

#monogram-svg .deco-frame,
#monogram-svg .deco-frame-inner {
    stroke-dasharray: 720;
    stroke-dashoffset: 720;
    animation: drawFrame 0.8s 0.5s ease-out forwards;
}

#monogram-svg .deco-frame-inner {
    animation-delay: 0.7s;
}

@keyframes drawFrame {
    to { stroke-dashoffset: 0; }
}

#monogram-svg .deco-corner {
    opacity: 0;
    animation: fadeIn 0.4s 1.0s ease-out forwards;
}

#monogram-svg .monogram-letter {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawLetter 0.7s 0.5s ease-out forwards;
}

@keyframes drawLetter {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Site Title */
.site-title {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: clamp(26px, 4.5vw, 56px);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #1A1A20;
    margin-bottom: 12px;
    overflow: hidden;
}

.title-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterReveal 0.5s ease-out forwards;
}

.title-letter:nth-child(1) { animation-delay: 1.2s; }
.title-letter:nth-child(2) { animation-delay: 1.24s; }
.title-letter:nth-child(3) { animation-delay: 1.28s; }
.title-letter:nth-child(4) { animation-delay: 1.32s; }
.title-letter:nth-child(5) { animation-delay: 1.36s; }
.title-letter:nth-child(6) { animation-delay: 1.40s; }
.title-letter:nth-child(7) { animation-delay: 1.44s; }
.title-letter:nth-child(8) { animation-delay: 1.48s; }
.title-letter:nth-child(9) { animation-delay: 1.52s; }

@keyframes letterReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-subtitle {
    font-family: 'Azeret Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: #7A8068;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 0.8s 1.6s ease-out forwards;
}

/* --- Wiki Articles --- */
.wiki-article {
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 24px;
    opacity: 0;
    transform: scale(0.98);
    filter: blur(1px);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.wiki-article.in-view {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
}

.article-inner {
    background-color: #F5EED8;
    padding: 60px 48px;
    position: relative;
}

.article-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, #B8963A, transparent);
}

/* Article Header */
.article-header {
    text-align: center;
    margin-bottom: 48px;
}

.article-meta {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: #7A8068;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

.article-title {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: clamp(26px, 4.5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1A1A20;
    margin-bottom: 20px;
    line-height: 1.2;
}

/* Deco Initial in Title */
.deco-initial {
    color: #B8963A;
    position: relative;
}

.deco-separator {
    display: flex;
    justify-content: center;
}

.deco-separator svg {
    display: block;
}

/* Article Body */
.article-body {
    color: #1A1A20;
}

.article-body p {
    margin-bottom: 1.5em;
    text-align: justify;
    hyphens: auto;
}

.article-body p:last-child {
    margin-bottom: 0;
}

.article-body em {
    font-style: italic;
    color: #8B3A2A;
}

/* Drop Caps */
.drop-cap {
    float: left;
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 0.8;
    padding-right: 10px;
    padding-top: 6px;
    color: #B8963A;
    position: relative;
}

.drop-cap::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 100%;
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, #B8963A, transparent);
}

/* Gold shimmer on drop-cap in view */
.wiki-article.in-view .drop-cap {
    background: linear-gradient(
        135deg,
        #B8963A 0%,
        #D4B054 30%,
        #B8963A 50%,
        #D4B054 70%,
        #B8963A 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 3s ease-in-out infinite;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Line Diagrams --- */
.line-diagram {
    margin: 2.5em auto;
    text-align: center;
}

.diagram-svg {
    display: block;
    margin: 0 auto 12px;
    max-width: 100%;
    height: auto;
}

/* Stroke draw animation for diagrams */
.diagram-svg .diagram-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 0.8s ease-out;
}

.wiki-article.in-view .diagram-svg .diagram-line {
    stroke-dashoffset: 0;
}

.line-diagram figcaption {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    color: #7A8068;
    letter-spacing: 0.05em;
}

/* --- Footer --- */
#site-footer {
    text-align: center;
    padding: 80px 24px 60px;
    margin-top: 40px;
}

.footer-deco {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.footer-deco svg {
    display: block;
}

.footer-text {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: 14px;
    font-weight: 400;
    color: #1A1A20;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.footer-sub {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    color: #7A8068;
    letter-spacing: 0.15em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #hud-sidebar {
        width: 30px;
    }

    .wiki-article {
        padding: 80px 16px;
    }

    .article-inner {
        padding: 40px 28px;
    }

    .drop-cap {
        font-size: 56px;
    }

    .drop-cap::after {
        width: 30px;
    }

    .deco-radiating-lines {
        width: 500px;
        height: 500px;
    }

    #hero::before {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .wiki-article {
        padding: 60px 12px;
    }

    .article-inner {
        padding: 32px 20px;
    }

    .drop-cap {
        font-size: 44px;
        padding-right: 6px;
    }

    .drop-cap::after {
        display: none;
    }

    .article-body p {
        text-align: left;
        hyphens: none;
    }

    .site-title {
        letter-spacing: 0.08em;
    }
}

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

::-webkit-scrollbar-track {
    background: #FAF6EE;
}

::-webkit-scrollbar-thumb {
    background: rgba(184, 150, 58, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 150, 58, 0.5);
}

/* --- Selection --- */
::selection {
    background-color: rgba(196, 106, 58, 0.2);
    color: #1A1A20;
}