/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: #D4A017;
    color: #0A0A0A;
}

::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #0A0A0A;
}
::-webkit-scrollbar-thumb {
    background: #D4A017;
    border-radius: 2px;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: #D4A017 #0A0A0A;
    scrollbar-width: thin;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: #B8B8B8;
    background: #0A0A0A;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== SPLIT CONTAINER ===== */
.split-container {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 100vh;
}

/* ===== LEFT PANEL (Forge) ===== */
.left-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: #0A0A0A;
    border-right: 1px solid rgba(212, 160, 23, 0.08);
    z-index: 10;
}

.left-inner {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
    padding: 2rem;
}

.left-header {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1rem;
}

.version-badge {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #D4A017;
}

.left-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-segment {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1rem;
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}

.left-segment.active {
    opacity: 1;
    pointer-events: auto;
}

.left-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #E8E8E8;
    margin-bottom: 1.5rem;
}

.left-body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.7;
    color: #B8B8B8;
    max-width: 380px;
    margin-bottom: 2rem;
}

.left-footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.footer-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(212, 160, 23, 0.4);
    animation: pulseHint 3s ease-in-out infinite;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== OWNERSHIP SVG (Left Panel) ===== */
.ownership-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    opacity: 0.7;
}

/* ===== CRYSTAL CLUSTERS ===== */
.crystal-cluster {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.6;
}

.crystal {
    width: 80px;
    height: auto;
    display: block;
}

.crystal-sm {
    width: 50px;
    margin-top: -20px;
    margin-left: 15px;
}

/* ===== RIGHT PANEL (Output) ===== */
.right-panel {
    background: #111111;
}

.right-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 3rem;
}

.section-inner {
    max-width: 520px;
    width: 100%;
}

.section-heading {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #E8E8E8;
    margin-bottom: 2rem;
}

.section-body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.7;
    color: #B8B8B8;
    margin-bottom: 2rem;
}

/* ===== HERO SECTION ===== */
#sectionHero {
    flex-direction: column;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title-wrap {
    position: relative;
    display: inline-block;
}

.hero-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 6rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #E8E8E8;
    position: relative;
    z-index: 2;
}

.hero-rust {
    display: inline;
}

.hero-dot {
    color: #D4A017;
    position: relative;
}

.hero-quest {
    display: inline;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #B8B8B8;
    margin-top: 2rem;
    letter-spacing: 0.02em;
}

.hero-path-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    max-width: 600px;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

/* ===== LENS FLARE ===== */
.lens-flare {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease;
    z-index: 5;
}

.lens-flare.visible {
    opacity: 1;
}

.flare-core {
    position: absolute;
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, #F5E6B8 0%, transparent 30%);
    opacity: 0.6;
    animation: flarePulse 4s ease-in-out infinite;
}

.flare-ring {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, transparent 40%, #D4A017 42%, transparent 44%);
    opacity: 0.25;
    animation: flarePulse 4s ease-in-out infinite 0.5s;
}

.flare-haze {
    position: absolute;
    width: 500px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(30deg);
    background: radial-gradient(ellipse at center, #D4A017 0%, transparent 60%);
    opacity: 0.08;
    animation: flarePulse 4s ease-in-out infinite 1s;
}

@keyframes flarePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.flare-haze {
    animation-name: flarePulseRotated;
}

@keyframes flarePulseRotated {
    0%, 100% { transform: translate(-50%, -50%) rotate(30deg) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(30deg) scale(1.05); }
}

.flare-hero {
    top: 50%;
    right: -20px;
    width: 0;
    height: 0;
}

.flare-ownership {
    top: 40%;
    right: 10%;
    width: 0;
    height: 0;
}

.flare-quest {
    bottom: 15%;
    right: 10%;
    width: 0;
    height: 0;
}

/* ===== OWNERSHIP DIAGRAM ===== */
.ownership-diagram {
    position: relative;
    margin: 2rem 0;
}

.ownership-main-svg {
    width: 100%;
    max-width: 500px;
}

/* ===== LIFETIME DIAGRAM ===== */
.lifetime-diagram {
    margin: 2rem 0;
}

.lifetime-svg {
    width: 100%;
    max-width: 500px;
}

.crystal-shard {
    transition: transform 800ms ease-in-out;
}

/* ===== CODE ANNOTATIONS ===== */
.code-annotation {
    background: #0A0A0A;
    border: 1px solid rgba(212, 160, 23, 0.15);
    padding: 1.25rem 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.code-annotation::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(transparent 50%, rgba(10, 10, 10, 0.15) 50%);
    background-size: 100% 3px;
    opacity: 0.05;
    pointer-events: none;
}

.mono-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: #D4A017;
    letter-spacing: 0.04em;
}

.mono-comment {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: rgba(184, 184, 184, 0.5);
}

/* ===== TERMINAL ===== */
.terminal-block {
    background: #0A0A0A;
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #1A1A1A;
    border-bottom: 1px solid rgba(212, 160, 23, 0.1);
}

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

.dot-red { background: #CE422B; }
.dot-yellow { background: #D4A017; }
.dot-green { background: #4A9EBF; }

.terminal-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: rgba(184, 184, 184, 0.5);
    margin-left: 8px;
}

.terminal-body {
    padding: 1.25rem 1.5rem;
    min-height: 260px;
    position: relative;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

.terminal-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(transparent 50%, rgba(10, 10, 10, 0.15) 50%);
    background-size: 100% 3px;
    opacity: 0.05;
    pointer-events: none;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line .char {
    opacity: 0;
    transition: opacity 0.05s ease;
}

.terminal-line .char.visible {
    opacity: 1;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #D4A017;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    position: absolute;
    bottom: 1.25rem;
    left: 1.5rem;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.term-gold { color: #D4A017; }
.term-silver { color: #B8B8B8; }
.term-blue { color: #4A9EBF; }
.term-orange { color: #CE422B; }
.term-white { color: #E8E8E8; }

/* ===== COMPILER CHECKMARKS ===== */
.compiler-checkmarks {
    margin-top: 1rem;
}

.check-svg {
    width: 100%;
    max-width: 400px;
}

/* ===== QUEST SECTION ===== */
.section-quest-inner {
    position: relative;
    max-width: 520px;
    width: 100%;
}

.quest-path-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    z-index: 1;
    pointer-events: none;
}

.quest-content {
    position: relative;
    z-index: 2;
}

.quest-body {
    font-weight: 300;
    color: #E8E8E8;
}

.quest-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.quest-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #D4A017;
    transition: color 300ms ease;
}

.quest-cta:hover .quest-label {
    color: #B8860B;
}

/* Hover states using Ember Gold */
.section-heading:hover,
.left-title:hover {
    color: #B8860B;
    transition: color 300ms ease;
}

.mono-text:hover {
    color: #B8860B;
}

.quest-arrow {
    width: 60px;
    height: 20px;
}

/* ===== CRYSTAL DECORATIONS ===== */
.crystal-decoration {
    position: absolute;
    opacity: 0.4;
    pointer-events: none;
    transition: transform 800ms ease-in-out;
}

.crystal-deco-1 {
    top: 10%;
    right: 8%;
    width: 60px;
    transform: rotate(15deg);
}

.crystal-deco-2 {
    bottom: 15%;
    left: 5%;
    width: 50px;
    transform: rotate(-20deg);
}

.crystal-deco-3 {
    top: 8%;
    right: 5%;
    width: 70px;
    transform: rotate(25deg);
}

.crystal-deco-4 {
    top: 5%;
    left: 5%;
    width: 55px;
    transform: rotate(-15deg);
}

.crystal-deco-5 {
    bottom: 10%;
    right: 8%;
    width: 45px;
    transform: rotate(30deg);
}

.crystal-deco-6 {
    top: 8%;
    right: 5%;
    width: 80px;
    transform: rotate(10deg);
}

.crystal-deco-7 {
    bottom: 20%;
    left: 5%;
    width: 60px;
    transform: rotate(-25deg);
}

/* ===== DRAW PATH BASE ===== */
.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.draw-path.animated {
    animation: drawIn 2500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ===== DRAW NODES ===== */
.draw-node {
    transition: opacity 800ms ease;
}

.draw-node.visible {
    opacity: 1 !important;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .split-container {
        grid-template-columns: 1fr;
    }

    .left-panel {
        position: relative;
        height: auto;
        min-height: 60vh;
        border-right: none;
        border-bottom: 1px solid rgba(212, 160, 23, 0.08);
    }

    .left-inner {
        padding: 1.5rem;
    }

    .left-segment {
        position: relative;
        opacity: 1;
        pointer-events: auto;
        padding: 1rem 0;
    }

    .left-segment:not(.active) {
        display: none;
    }

    .right-section {
        padding: 3rem 1.5rem;
        min-height: 80vh;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .section-heading {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }

    .flare-core { width: 80px; height: 80px; }
    .flare-ring { width: 160px; height: 160px; }
    .flare-haze { width: 260px; height: 100px; }

    .crystal-decoration {
        opacity: 0.2;
    }

    .terminal-body {
        font-size: 0.75rem;
        min-height: 220px;
    }

    .ownership-main-svg,
    .lifetime-svg {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .right-section {
        padding: 2rem 1rem;
    }

    .left-inner {
        padding: 1rem;
    }
}
