/* =========================================================================
   gabs.wiki — Encyclopedia of Value
   Art-Deco aesthetic · ma-negative-space · burnt-orange · sci-fi HUD
   ========================================================================= */

:root {
    --burnt-orange: #C46A3A;
    --vellum-cream: #F5EED8;
    --deco-gold: #B8963A;
    --carbon-ink: #1A1A20;
    --oxide-red: #8B3A2A;
    --sage-gray: #7A8068;
    --paper-white: #FAF6EE;

    --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-body: "Newsreader", Georgia, "Times New Roman", serif;
    --font-hud: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --sidebar-width: 56px;

    --article-max: 640px;
    --article-gap: 180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.85;
    color: var(--carbon-ink);
    background: var(--paper-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   SCI-FI HUD SIDEBAR
   ========================================================================= */

.hud-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 0 28px;
    background: rgba(26, 26, 32, 0.92);
    color: var(--vellum-cream);
    border-right: 1px solid rgba(184, 150, 58, 0.35);
    font-family: var(--font-hud);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
                opacity 0.6s ease;
    pointer-events: none;
}

.hud-sidebar.is-visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.hud-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(184, 150, 58, 0.25);
    width: 36px;
    text-align: center;
}

.hud-brand-mark {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--deco-gold);
    letter-spacing: 0;
    line-height: 1;
}

.hud-brand-index {
    font-size: 8px;
    letter-spacing: 0.22em;
    color: rgba(245, 238, 216, 0.55);
}

.hud-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 32px;
    flex: 1;
}

.hud-dot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(245, 238, 216, 0.5);
    text-decoration: none;
    width: 30px;
    transition: color 0.3s ease;
    transform: scale(0);
    opacity: 0;
}

.hud-dot.is-entered {
    animation: hud-dot-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes hud-dot-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hud-dot-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(184, 150, 58, 0.6);
    background: transparent;
    transition: background 0.45s ease, border-color 0.35s ease, transform 0.35s ease;
    position: relative;
}

.hud-dot-circle::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: border-color 0.35s ease;
}

.hud-dot-label {
    font-size: 8px;
    letter-spacing: 0.18em;
    color: rgba(245, 238, 216, 0.4);
    transition: color 0.3s ease;
}

.hud-dot:hover .hud-dot-circle,
.hud-dot.is-active .hud-dot-circle {
    background: var(--deco-gold);
    border-color: var(--deco-gold);
    transform: scale(1.2);
}

.hud-dot.is-active .hud-dot-circle::after {
    border-color: rgba(184, 150, 58, 0.45);
}

.hud-dot.is-active .hud-dot-label,
.hud-dot:hover .hud-dot-label {
    color: var(--deco-gold);
}

.hud-dot-readout {
    position: absolute;
    left: calc(var(--sidebar-width) + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: rgba(26, 26, 32, 0.92);
    color: var(--vellum-cream);
    padding: 6px 10px;
    border: 1px solid rgba(184, 150, 58, 0.45);
    white-space: nowrap;
    font-size: 9px;
    letter-spacing: 0.18em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.hud-dot:hover .hud-dot-readout {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.hud-scroll-readout {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(184, 150, 58, 0.25);
    width: 36px;
}

.hud-scroll-label {
    font-size: 8px;
    letter-spacing: 0.22em;
    color: rgba(245, 238, 216, 0.45);
}

.hud-scroll-value {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--deco-gold);
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   RADIATING DECO LINES (reusable)
   ========================================================================= */

.radiating-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(184, 150, 58, 0.0) 0deg,
            rgba(184, 150, 58, 0.0) 9.5deg,
            rgba(184, 150, 58, 0.18) 9.6deg,
            rgba(184, 150, 58, 0.18) 10deg
        );
    opacity: 0.35;
    animation: deco-rotate 120s linear infinite;
    mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 75%);
}

@keyframes deco-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================================================
   SECTION STRUCTURE & MA-NEGATIVE-SPACE
   ========================================================================= */

.section {
    position: relative;
    padding-left: calc(var(--sidebar-width) + 24px);
    padding-right: 24px;
}

.section-opening {
    min-height: 100vh;
    background: radial-gradient(
        ellipse at 50% 42%,
        var(--burnt-orange) 0%,
        var(--burnt-orange) 42%,
        #A8562E 70%,
        #7C3E22 100%
    );
    color: var(--vellum-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 60px;
    padding-bottom: 60px;
}

.opening-stage {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 680px;
}

.monogram-wrap {
    width: clamp(220px, 32vw, 320px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vellum-cream);
}

.monogram {
    width: 100%;
    height: 100%;
    color: var(--vellum-cream);
    display: block;
}

.monogram-frame rect,
.monogram-frame path {
    opacity: 0;
    animation: deco-frame-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 300ms forwards;
}

.monogram-rays line {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: deco-ray-draw 700ms ease-out 900ms forwards;
}

.monogram-letter {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: letter-draw 1100ms cubic-bezier(0.65, 0, 0.35, 1) 500ms forwards;
}

.monogram-serif {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: deco-ray-draw 400ms ease-out 1400ms forwards;
}

@keyframes deco-frame-in {
    from { opacity: 0; transform: scale(0.94); transform-origin: 50% 50%; }
    to { opacity: 1; transform: scale(1); }
}

@keyframes letter-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes deco-ray-draw {
    to { stroke-dashoffset: 0; }
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 76px);
    margin: 0 0 14px;
    letter-spacing: 0.02em;
    color: var(--vellum-cream);
    line-height: 1;
}

.wordmark-letter,
.wordmark-dot {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    animation: word-letter-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.wordmark-letter:nth-child(1)  { animation-delay: 1200ms; }
.wordmark-letter:nth-child(2)  { animation-delay: 1240ms; }
.wordmark-letter:nth-child(3)  { animation-delay: 1280ms; }
.wordmark-letter:nth-child(4)  { animation-delay: 1320ms; }
.wordmark-dot                  { animation-delay: 1360ms; color: var(--deco-gold); }
.wordmark-letter:nth-child(6)  { animation-delay: 1400ms; }
.wordmark-letter:nth-child(7)  { animation-delay: 1440ms; }
.wordmark-letter:nth-child(8)  { animation-delay: 1480ms; }
.wordmark-letter:nth-child(9)  { animation-delay: 1520ms; }

@keyframes word-letter-in {
    to { opacity: 1; transform: translateY(0); }
}

.wordmark-sub {
    font-family: var(--font-hud);
    font-size: 11px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: rgba(250, 246, 238, 0.85);
    margin: 0 0 28px;
    opacity: 0;
    animation: fade-up 600ms ease-out 1700ms forwards;
}

.wordmark-meta {
    font-family: var(--font-display);
    font-size: 13px;
    font-style: italic;
    color: rgba(250, 246, 238, 0.7);
    margin: 0;
    opacity: 0;
    animation: fade-up 600ms ease-out 1900ms forwards;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.opening-footer {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--font-hud);
    font-size: 9px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(250, 246, 238, 0.55);
    z-index: 2;
    opacity: 0;
    animation: fade-up 600ms ease-out 2200ms forwards;
}

.opening-footer-rule {
    display: block;
    width: 36px;
    height: 1px;
    background: rgba(250, 246, 238, 0.4);
}

/* =========================================================================
   ARTICLE SECTIONS
   ========================================================================= */

.article {
    background: var(--paper-white);
    padding-top: var(--article-gap);
    padding-bottom: var(--article-gap);
    position: relative;
}

.article::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--deco-gold),
        transparent
    );
    opacity: 0.55;
}

.article:nth-of-type(odd) {
    background: var(--paper-white);
}

.article:nth-of-type(even) {
    background: var(--vellum-cream);
}

.article-header {
    max-width: var(--article-max);
    margin: 0 auto 56px;
    text-align: center;
}

.article-number {
    display: inline-block;
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--deco-gold);
    margin-bottom: 20px;
    position: relative;
}

.article-number::before,
.article-number::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 26px;
    height: 1px;
    background: var(--deco-gold);
    opacity: 0.55;
}

.article-number::before { right: calc(100% + 14px); }
.article-number::after  { left: calc(100% + 14px); }

.article-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(26px, 4.5vw, 56px);
    letter-spacing: -0.01em;
    line-height: 1.12;
    margin: 0 0 14px;
    color: var(--carbon-ink);
}

.article-meta {
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--sage-gray);
    margin: 0;
}

.article-body {
    max-width: var(--article-max);
    margin: 0 auto;
}

.article-body p {
    margin: 0 0 1.4em;
    font-family: var(--font-body);
    font-size: clamp(16px, 1.55vw, 19px);
    line-height: 1.85;
    color: var(--carbon-ink);
    hyphens: auto;
}

.article-body p.article-lede::after {
    content: "";
    display: block;
    clear: both;
}

.article-body em {
    font-style: italic;
    color: var(--oxide-red);
}

.article-body strong {
    font-weight: 600;
    color: var(--carbon-ink);
}

.article-close {
    text-align: right;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--sage-gray);
    margin-top: 2em !important;
}

/* Decorated Initial Cap */
.drop-cap {
    float: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 78px;
    line-height: 0.85;
    padding: 6px 14px 0 0;
    color: var(--deco-gold);
    background: linear-gradient(
        120deg,
        var(--deco-gold) 0%,
        #D4B55C 50%,
        var(--deco-gold) 100%
    );
    background-size: 220% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 1.4s ease;
    position: relative;
}

.article.is-focused .drop-cap {
    background-position: 100% 0;
}

.drop-cap::after {
    content: "";
    position: absolute;
    bottom: 10px;
    left: 100%;
    width: 0;
    height: 1px;
    background: var(--deco-gold);
    opacity: 0.45;
    transition: width 0.8s ease 0.2s;
}

.article.is-focused .drop-cap::after {
    width: 120px;
}

/* =========================================================================
   ARTICLE FIGURES (line-illustration diagrams)
   ========================================================================= */

.article-figure {
    margin: 56px 0;
    padding: 0;
}

.line-diagram {
    display: block;
    width: 100%;
    height: auto;
    color: var(--carbon-ink);
    overflow: visible;
}

.diagram-line,
.diagram-axis {
    fill: none;
    stroke: var(--carbon-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.diagram-axis {
    stroke-width: 1;
    opacity: 0.55;
}

.diagram-dash {
    fill: none;
    stroke: var(--carbon-ink);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    opacity: 0.5;
}

.diagram-node {
    fill: var(--oxide-red);
    stroke: none;
}

.diagram-text {
    font-family: var(--font-hud);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    fill: var(--carbon-ink);
}

.diagram-text-sm {
    font-family: var(--font-hud);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    fill: var(--sage-gray);
}

/* Stroke-draw animation on intersection */
.line-diagram .diagram-line,
.line-diagram .diagram-axis,
.line-diagram .diagram-dash {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 900ms cubic-bezier(0.4, 0.1, 0.3, 1);
}

.line-diagram .diagram-node,
.line-diagram text {
    opacity: 0;
    transition: opacity 500ms ease 400ms;
}

.article.is-focused .line-diagram .diagram-line,
.article.is-focused .line-diagram .diagram-axis,
.article.is-focused .line-diagram .diagram-dash {
    stroke-dashoffset: 0;
}

.article.is-focused .line-diagram .diagram-node,
.article.is-focused .line-diagram text {
    opacity: 1;
}

.article-figure figcaption {
    margin-top: 18px;
    text-align: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 13px;
    color: var(--sage-gray);
    line-height: 1.55;
}

/* =========================================================================
   ZOOM-FOCUS ARTICLE ENTRY
   ========================================================================= */

.article {
    transform: scale(0.985);
    filter: blur(1.2px);
    opacity: 0.55;
    transition:
        transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 550ms cubic-bezier(0.2, 0.7, 0.2, 1),
        opacity 550ms ease;
    transform-origin: 50% 50%;
}

.article.is-focused {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

/* =========================================================================
   COLOPHON
   ========================================================================= */

.section-colophon {
    background: var(--carbon-ink);
    color: var(--vellum-cream);
    padding-top: 160px;
    padding-bottom: 160px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.section-colophon::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(184, 150, 58, 0.0) 0deg,
            rgba(184, 150, 58, 0.0) 9.5deg,
            rgba(184, 150, 58, 0.12) 9.6deg,
            rgba(184, 150, 58, 0.12) 10deg
        );
    opacity: 0.4;
    pointer-events: none;
    mask-image: radial-gradient(circle at 50% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 10%, transparent 70%);
}

.colophon-wrap {
    position: relative;
    z-index: 2;
    max-width: 560px;
    margin: 0 auto;
}

.colophon-rule {
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--deco-gold), transparent);
    margin: 0 auto 40px;
}

.colophon-title {
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--deco-gold);
    margin: 0 0 28px;
}

.colophon-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    line-height: 1.85;
    color: rgba(245, 238, 216, 0.88);
    margin: 0 0 36px;
}

.colophon-text em {
    font-style: italic;
    color: var(--deco-gold);
}

.colophon-meta {
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(245, 238, 216, 0.55);
    margin: 0 0 60px;
}

.colophon-mark {
    display: inline-block;
    width: 72px;
    height: 72px;
    line-height: 72px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 44px;
    color: var(--deco-gold);
    border: 1px solid var(--deco-gold);
    position: relative;
}

.colophon-mark::before,
.colophon-mark::after {
    content: "";
    position: absolute;
    background: var(--deco-gold);
}

.colophon-mark::before {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
}

.colophon-mark::after {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
}

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

@media (max-width: 860px) {
    :root {
        --article-gap: 120px;
        --sidebar-width: 44px;
    }
    .hud-brand-index,
    .hud-scroll-label {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --article-gap: 96px;
        --sidebar-width: 40px;
    }
    .section {
        padding-left: calc(var(--sidebar-width) + 18px);
        padding-right: 18px;
    }
    .wordmark {
        font-size: clamp(30px, 11vw, 48px);
    }
    .article-title {
        font-size: clamp(24px, 7vw, 36px);
    }
    .drop-cap {
        font-size: 60px;
    }
    .article-figure {
        margin: 40px 0;
    }
    .hud-dot {
        width: 26px;
    }
    .hud-dot-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .radiating-lines {
        animation: none;
    }
    .monogram-letter,
    .monogram-rays line,
    .monogram-serif,
    .monogram-frame rect,
    .monogram-frame path,
    .wordmark-letter,
    .wordmark-dot,
    .wordmark-sub,
    .wordmark-meta,
    .opening-footer {
        animation: none;
        opacity: 1;
        stroke-dashoffset: 0;
        transform: none;
    }
    .article {
        transform: none;
        filter: none;
        opacity: 1;
    }
}
