/* rust.quest — Frutiger Aero Glossy Tech */
/* Typography: Poppins 600/700, Inter 400/500, JetBrains Mono 400/500 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #FFFFFF;
    color: #4A5568;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* ===== SHARED COMPONENTS ===== */
.glossy-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F4F8 100%);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
}

.glossy-button {
    display: inline-block;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%), #DE5722;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 2.4rem;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glossy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(222, 87, 34, 0.3);
}

.glossy-button:active {
    transform: translateY(0);
}

.section-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #1A1A2E;
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.section-intro {
    text-align: center;
    color: #4A5568;
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F4F8 100%);
    text-align: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(222, 87, 34, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* Crab Icon */
.crab-icon {
    position: relative;
    width: 80px;
    height: 60px;
    margin: 0 auto 2rem;
}

.crab-body {
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 32px;
    background: #DE5722;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(222, 87, 34, 0.3);
}

.antenna-stem {
    position: absolute;
    bottom: 26px;
    width: 2px;
    height: 18px;
    background: #DE5722;
}

.antenna-stem.left-stem {
    left: 20px;
    transform: rotate(-15deg);
}

.antenna-stem.right-stem {
    right: 20px;
    transform: rotate(15deg);
}

.antenna-ball {
    position: absolute;
    top: 0;
    width: 12px;
    height: 12px;
    background: #DE5722;
    border-radius: 50%;
}

.antenna-ball.left-ball {
    left: 13px;
}

.antenna-ball.right-ball {
    right: 13px;
}

.hero-headline {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3rem);
    color: #1A1A2E;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #4A5568;
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

.cta-button {
    font-size: 1.1rem;
    padding: 1rem 3rem;
}

/* ===== QUEST MAP ===== */
.quest-map {
    max-width: 700px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.quest-path-container {
    position: relative;
}

.quest-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.quest-node {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 460px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.quest-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.quest-node-left {
    flex-direction: row;
    align-self: flex-start;
    margin-left: 2rem;
}

.quest-node-right {
    flex-direction: row-reverse;
    align-self: flex-end;
    margin-right: 2rem;
}

.quest-node-right .node-card {
    text-align: right;
}

.node-circle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #FFFFFF;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.node-circle-complete {
    background: #48BB78;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.node-circle-current {
    background: #DE5722;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(222, 87, 34, 0.3);
}

.node-circle-future {
    background: #E2E8F0;
    color: #4A5568;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(222, 87, 34, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(222, 87, 34, 0); }
}

.node-card {
    flex: 1;
    padding: 1rem 1.25rem;
}

.node-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #1A1A2E;
    margin-bottom: 0.15rem;
}

.node-difficulty {
    font-size: 0.75rem;
    color: #4A5568;
    display: block;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.node-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.quest-node-right .node-status-row {
    justify-content: flex-end;
}

.node-status {
    font-size: 0.8rem;
    font-weight: 500;
}

.status-complete {
    color: #48BB78;
}

.status-current {
    color: #DE5722;
}

.status-locked {
    color: #CBD5E1;
}

.node-xp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #3182CE;
    font-weight: 500;
}

.node-progress-bar {
    height: 4px;
    background: #E2E8F0;
    border-radius: 2px;
    overflow: hidden;
}

.node-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

.quest-node-complete .node-progress-fill {
    background: #48BB78;
}

.quest-node-current .node-progress-fill {
    background: #DE5722;
}

.quest-node-future .node-progress-fill {
    background: #E2E8F0;
}

/* Path Connectors */
.path-connector {
    display: flex;
    justify-content: center;
    padding: 0;
}

.path-line {
    width: 0;
    height: 36px;
    border-left: 2px dashed #CBD5E1;
}

/* ===== CODE CHALLENGE ===== */
.challenge {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.challenge-split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.code-panel {
    padding: 0;
    overflow: hidden;
}

.code-panel-header {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #E2E8F0;
    background: linear-gradient(180deg, #FFFFFF, #F0F4F8);
}

.code-tab {
    padding: 0.6rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #4A5568;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.code-tab.active {
    color: #DE5722;
    border-bottom-color: #DE5722;
}

.rust-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #1A1A2E;
    white-space: pre;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
}

.rust-keyword { color: #3182CE; font-weight: 500; }
.rust-type { color: #DE5722; }
.rust-fn { color: #1A1A2E; font-weight: 500; }
.rust-string { color: #48BB78; }
.rust-comment { color: #4A5568; font-style: italic; }
.rust-lifetime { color: #3182CE; font-style: italic; }

.desc-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.challenge-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #3182CE;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.challenge-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1A1A2E;
}

.challenge-desc {
    font-size: 0.92rem;
    color: #4A5568;
    line-height: 1.65;
}

.challenge-desc code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    background: #F0F4F8;
    padding: 2px 5px;
    border-radius: 3px;
    color: #DE5722;
}

/* Compiler Messages */
.compiler-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #F0F4F8;
    border-left: 3px solid #DE5722;
    padding: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
}

.compiler-error {
    border-left-color: #DE5722;
}

.compiler-error .msg-icon {
    color: #DE5722;
}

.compiler-hint {
    border-left-color: #3182CE;
}

.compiler-hint .msg-icon {
    color: #3182CE;
}

.msg-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.msg-content {
    flex: 1;
}

.msg-label {
    font-weight: 500;
    color: #1A1A2E;
}

.msg-content code {
    font-size: 0.78rem;
    background: rgba(222, 87, 34, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
    color: #DE5722;
}

.challenge-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.small-btn {
    font-size: 0.85rem;
    padding: 0.55rem 1.4rem;
}

.secondary-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%), #3182CE;
}

.secondary-btn:hover {
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.3);
}

.hint-box {
    background: #F0F4F8;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.88rem;
    color: #4A5568;
    line-height: 1.6;
    transition: opacity 0.3s ease, max-height 0.4s ease;
    overflow: hidden;
}

.hint-box code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #DE5722;
    background: rgba(222, 87, 34, 0.08);
    padding: 1px 4px;
    border-radius: 2px;
}

.hint-box.hidden {
    opacity: 0;
    max-height: 0;
    padding: 0 1rem;
    border-color: transparent;
}

.hint-box:not(.hidden) {
    opacity: 1;
    max-height: 200px;
}

/* ===== ACHIEVEMENTS ===== */
.achievements {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    transition: transform 0.3s ease;
}

.badge:hover {
    transform: translateY(-4px);
}

.badge-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-svg {
    width: 44px;
    height: 44px;
}

.badge-locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4A5568;
    text-align: center;
    max-width: 80px;
}

/* ===== STATS BANNER ===== */
.stats-banner {
    background: linear-gradient(180deg, #F0F4F8 0%, #FFFFFF 100%);
    padding: 4rem 2rem;
}

.stats-inner {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.stat-number {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: #1A1A2E;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: #4A5568;
    text-align: center;
}

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(180deg, #FFFFFF, #F0F4F8);
    padding: 4rem 2rem 3rem;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-crab {
    position: relative;
    width: 30px;
    height: 24px;
}

.mini-body {
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 14px;
    background: #DE5722;
    border-radius: 5px;
}

.mini-antenna {
    position: absolute;
    top: 0;
    width: 6px;
    height: 6px;
    background: #DE5722;
    border-radius: 50%;
}

.mini-antenna.left-mini {
    left: 4px;
}

.mini-antenna.right-mini {
    right: 4px;
}

.footer-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1A1A2E;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    font-size: 0.88rem;
    color: #3182CE;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #DE5722;
}

.footer-bottom {
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
    width: 100%;
    text-align: center;
}

.built-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #4A5568;
}

.rust-accent {
    color: #DE5722;
    font-weight: 500;
}

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

    .quest-node-left,
    .quest-node-right {
        margin-left: 0;
        margin-right: 0;
        align-self: center;
    }

    .quest-node-right {
        flex-direction: row;
    }

    .quest-node-right .node-card {
        text-align: left;
    }

    .quest-node-right .node-status-row {
        justify-content: flex-start;
    }

    .stats-inner {
        gap: 2rem;
    }

    .hero {
        min-height: 80vh;
    }
}

@media (max-width: 480px) {
    .badge-row {
        gap: 1rem;
    }

    .footer-links {
        gap: 1rem;
    }

    .stats-inner {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.6rem;
    }
}
