/* =============================================================
   supplychain.wiki — Styles
   Zen-philosophy wiki with retro-futuristic character
   ============================================================= */

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

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

body {
    background-color: #f0ece4;
    color: #3a3632;
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Color utility classes --- */
.accent-teal { color: #3a8a7a; }
.accent-orange { color: #d47840; }
.accent-green { color: #6a8a5a; }
.accent-brown { color: #8a6a4a; }

/* =============================================================
   HERO SECTION
   ============================================================= */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: #f0ece4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Retro-futuristic connecting lines */
.hero-line {
    position: absolute;
    background: transparent;
    pointer-events: none;
}

.hero-line-1 {
    top: 18%;
    left: 8%;
    width: 45%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3a8a7a 30%, #3a8a7a 70%, transparent);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    animation: lineDrawH 1.2s ease-out 0.8s forwards;
}

.hero-line-2 {
    top: 18%;
    right: 15%;
    width: 1px;
    height: 60%;
    background: linear-gradient(180deg, #3a8a7a, #d47840 50%, transparent);
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    animation: lineDrawV 1.4s ease-out 1.2s forwards;
}

.hero-line-3 {
    bottom: 25%;
    left: 15%;
    width: 35%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d47840 40%, #d47840 60%, transparent);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: right;
    animation: lineDrawH 1s ease-out 1.6s forwards;
}

@keyframes lineDrawH {
    to { opacity: 0.4; transform: scaleX(1); }
}
@keyframes lineDrawV {
    to { opacity: 0.35; transform: scaleY(1); }
}

/* Hero words — asymmetric placement */
.hero-word {
    position: absolute;
    font-family: 'Archivo', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #3a3632;
    opacity: 0;
    transform: translateY(30px);
}

.hero-word--supply {
    top: 15%;
    left: 8%;
    font-size: clamp(48px, 8vw, 110px);
    animation: heroFadeUp 0.9s ease-out 0.2s forwards;
}

.hero-word--chain {
    bottom: 18%;
    right: 8%;
    font-size: clamp(40px, 6.5vw, 90px);
    color: #3a8a7a;
    animation: heroFadeUp 0.9s ease-out 0.5s forwards;
}

.hero-word--wiki {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(30px);
    font-size: clamp(28px, 4vw, 56px);
    color: #d47840;
    letter-spacing: 0.25em;
    animation: heroFadeUpCenter 0.9s ease-out 0.8s forwards;
}

@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeUpCenter {
    to { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
}

.hero-subtitle {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: heroFadeUp 0.8s ease-out 1.4s forwards;
}

.hero-subtitle-label {
    font-family: 'Space Mono', monospace;
    font-size: clamp(10px, 1.2vw, 14px);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #8a6a4a;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
}

/* =============================================================
   WIKI NAV BAR
   ============================================================= */
#wiki-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #faf6f0;
    border-bottom: 1px solid rgba(58, 54, 50, 0.1);
    padding: 0 clamp(20px, 4vw, 60px);
    backdrop-filter: blur(8px);
}

.wiki-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.wiki-nav-logo {
    font-family: 'Archivo', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #3a3632;
    letter-spacing: 0.04em;
}

.wiki-nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}

.wiki-nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3a3632;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.wiki-nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3a8a7a;
    transition: width 0.3s ease;
}

.wiki-nav-links a:hover {
    color: #3a8a7a;
}

.wiki-nav-links a:hover::after {
    width: 100%;
}

/* =============================================================
   WIKI SECTIONS — Asymmetric Layout
   ============================================================= */
.wiki-section {
    position: relative;
    padding: clamp(60px, 8vw, 120px) clamp(20px, 5vw, 80px);
    max-width: 1300px;
    margin: 0 auto;
}

.wiki-section--left {
    margin-left: 5%;
    margin-right: auto;
}

.wiki-section--right {
    margin-left: auto;
    margin-right: 5%;
}

/* Border animation wrapper */
.section-border-wrap {
    position: absolute;
    inset: 20px;
    pointer-events: none;
    z-index: 0;
}

.section-border {
    width: 100%;
    height: 100%;
}

.section-border rect {
    stroke-dasharray: 2600;
    stroke-dashoffset: 2600;
    transition: stroke-dashoffset 0.8s ease-out;
}

.wiki-section.is-visible .section-border rect {
    stroke-dashoffset: 0;
}

/* Section content grid */
.wiki-section-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 4vw, 60px);
    align-items: center;
}

.wiki-section--right .wiki-section-content {
    direction: rtl;
}

.wiki-section--right .wiki-section-content > * {
    direction: ltr;
}

.wiki-section-text {
    padding: clamp(20px, 3vw, 40px);
}

.wiki-section-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.iso-illustration {
    width: 100%;
    max-width: 280px;
    height: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.3s, transform 0.6s ease-out 0.3s;
}

.wiki-section.is-visible .iso-illustration {
    opacity: 1;
    transform: translateY(0);
}

/* Wiki metadata labels */
.wiki-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.wiki-meta-tag {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #faf6f0;
    background-color: #3a8a7a;
    padding: 3px 10px;
    border-radius: 2px;
}

.wiki-meta-id {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #8a6a4a;
    letter-spacing: 0.06em;
}

.wiki-meta-route {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #6a8a5a;
    letter-spacing: 0.04em;
    padding-left: 12px;
    border-left: 2px solid #6a8a5a;
}

/* Section titles */
.wiki-section-title {
    font-family: 'Archivo', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 52px);
    color: #3a3632;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

/* Section body text */
.wiki-section-body {
    color: #3a3632;
    margin-bottom: 16px;
    max-width: 540px;
}

/* Key terms tags */
.wiki-key-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.key-term {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #3a3632;
    background-color: #faf6f0;
    border: 1px solid rgba(58, 54, 50, 0.15);
    padding: 4px 12px;
    border-radius: 2px;
    letter-spacing: 0.04em;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.key-term:hover {
    border-color: #3a8a7a;
    color: #3a8a7a;
}

/* =============================================================
   TRADE ROUTE DIVIDERS
   ============================================================= */
.trade-route-divider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px clamp(20px, 5vw, 80px);
    opacity: 0.6;
}

.trade-route-divider svg {
    width: 100%;
    height: 60px;
}

/* =============================================================
   ZEN QUOTE SECTION
   ============================================================= */
#zen-quote {
    padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 80px);
    background-color: #faf6f0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.zen-quote-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.zen-enso {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-out;
}

#zen-quote.is-visible .zen-enso {
    opacity: 1;
}

#zen-quote.is-visible .zen-enso path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawEnso 2s ease-out 0.3s forwards;
}

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

.zen-text {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(20px, 3vw, 32px);
    font-style: italic;
    font-weight: 400;
    color: #3a3632;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.5s, transform 0.8s ease-out 0.5s;
}

#zen-quote.is-visible .zen-text {
    opacity: 1;
    transform: translateY(0);
}

.zen-attribution {
    display: block;
    margin-top: 24px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8a6a4a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease-out 0.8s;
}

#zen-quote.is-visible .zen-attribution {
    opacity: 1;
}

/* =============================================================
   FOOTER
   ============================================================= */
#site-footer {
    background-color: #3a3632;
    color: #f0ece4;
    padding: clamp(40px, 6vw, 80px) clamp(20px, 5vw, 80px) 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-logo {
    font-family: 'Archivo', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #faf6f0;
}

.footer-tagline {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    color: rgba(240, 236, 228, 0.6);
    margin-top: 8px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 60px;
    justify-content: flex-end;
}

.footer-col-title {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3a8a7a;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    color: rgba(240, 236, 228, 0.5);
    margin-bottom: 8px;
    transition: color 0.3s ease;
    cursor: default;
}

.footer-col li:hover {
    color: #faf6f0;
}

.footer-bottom {
    border-top: 1px solid rgba(240, 236, 228, 0.1);
    padding: 20px 0;
    text-align: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-copy {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: rgba(240, 236, 228, 0.35);
    letter-spacing: 0.06em;
}

.footer-wave {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
}

/* =============================================================
   DATA PULSE ANIMATION (Technology section SVG)
   ============================================================= */
.data-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.data-pulse:nth-child(2) {
    animation-delay: 0.6s;
}

.data-pulse:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; r: 3; }
    50% { opacity: 1; r: 5; }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
    .wiki-section-content {
        grid-template-columns: 1fr;
    }

    .wiki-section--right .wiki-section-content {
        direction: ltr;
    }

    .wiki-section--left,
    .wiki-section--right {
        margin-left: auto;
        margin-right: auto;
    }

    .wiki-nav-links {
        gap: 14px;
    }

    .wiki-nav-links a {
        font-size: 10px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .wiki-nav-links {
        display: none;
    }

    .hero-word--supply {
        font-size: clamp(36px, 12vw, 60px);
    }

    .hero-word--chain {
        font-size: clamp(32px, 10vw, 50px);
    }

    .hero-word--wiki {
        font-size: clamp(22px, 6vw, 36px);
    }

    .section-border-wrap {
        display: none;
    }

    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
}
