/* ============================================================
   RAGE Engine — CSS (GTA VI Vibe + HUD Tático)
   Layout organizado, neon pink/cyan e glassmorphism
   ============================================================ */

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

.rage-body {
    background: #05020c;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(255, 46, 136, 0.05), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(33, 217, 255, 0.05), transparent 40%);
    color: #fff;
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0;
}

:root {
    --cyan: #21D9FF;
    --pink: #FF2E88;
    --gray: rgba(255,255,255,0.6);
    --border: rgba(255,255,255,0.1);
    --border-glow: rgba(33, 217, 255, 0.2);
    --glass-bg: rgba(20, 15, 30, 0.5);
    --section-pad: clamp(4rem, 10vw, 8rem);
    --content-max: 1280px;
    --col-gap: clamp(2rem, 5vw, 5rem);
}

.mono { font-family: 'Space Mono', 'Courier New', monospace !important; }

/* ============================================================
   HEADER
   ============================================================ */
.rage-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2rem;
    background: rgba(5, 2, 12, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    border-image: linear-gradient(to right, transparent, var(--pink), var(--cyan), transparent) 1;
    z-index: 9100;
}
.rage-logo {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--cyan), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}
.rage-logo sup { font-size: 0.55em; vertical-align: super; -webkit-text-fill-color: var(--cyan); }
.rage-nav { display: flex; gap: 1.5rem; flex: 1; justify-content: center; }
.rage-nav a { font-size: 0.9rem; color: var(--gray); text-decoration: none; transition: color .2s, text-shadow .2s; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
.rage-nav a:hover { color: #fff; text-shadow: 0 0 8px var(--cyan); }
.rage-header .hamburger-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 0; display: flex; }
.rage-header .menu-btn-text { display: none; }
.version-chip {
    font-size: 0.72rem;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(33, 217, 255, 0.2);
}

/* Barra de progresso */
.read-progress {
    position: fixed;
    top: 56px; left: 0;
    height: 2px; width: 0%;
    background: linear-gradient(90deg, var(--pink), var(--cyan));
    z-index: 9101;
    box-shadow: 0 0 8px var(--cyan);
    transition: width .1s linear;
}

/* ============================================================
   HERO
   ============================================================ */
.rage-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(56px + clamp(3rem, 8vw, 6rem)) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem);
    position: relative;
    overflow: hidden;
}
.rage-hero::before {
    content: 'VI';
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(15rem, 35vw, 30rem);
    font-weight: 700;
    color: rgba(255, 46, 136, 0.03);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    font-style: italic;
}
.hero-inner { max-width: var(--content-max); width: 100%; position: relative; z-index: 2; }
.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(33, 217, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(33, 217, 255, 0.05);
}
.hero-headline {
    font-size: clamp(3.5rem, 9vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin: 0 0 1.75rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hero-sub {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray);
    max-width: 580px;
    line-height: 1.55;
    margin-bottom: 3.5rem;
}
.hero-stats { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.stat-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: #fff;}
.stat-unit { font-size: 1.2rem; color: var(--pink); font-weight: 700; }
.stat-label { font-size: 0.7rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.2rem; }
.hero-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: clamp(1.5rem, 5vw, 4rem);
    font-size: 0.7rem;
    color: var(--cyan);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; text-shadow: 0 0 10px var(--cyan); } }

/* ============================================================
   SEÇÕES GERAIS
   ============================================================ */
.rage-section { padding: var(--section-pad) clamp(1.5rem, 5vw, 4rem); position: relative; }
.rage-section.bg-off { background: rgba(20, 15, 30, 0.3); border-top: 1px solid rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.03); }

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--pink);
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 46, 136, 0.2);
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   LAYOUT DE DUAS COLUNAS (texto + visual)
   ============================================================ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--col-gap); align-items: center; max-width: var(--content-max); margin: 0 auto; }
.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }

.col-text { display: flex; flex-direction: column; gap: 0; }
.section-headline {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.97;
    margin: 0.75rem 0 1.25rem;
    color: #fff;
}
.section-body { font-size: clamp(0.95rem, 1.5vw, 1.05rem); color: var(--gray); line-height: 1.65; margin-bottom: 0.85rem; max-width: 520px; }
.highlight { color: var(--cyan); font-weight: 600; text-shadow: 0 0 8px rgba(33, 217, 255, 0.3); }

.tech-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; }
.tech-list li { font-family: 'Space Mono', monospace; font-size: 0.82rem; color: rgba(255,255,255,0.7); padding-left: 1.25rem; position: relative; }
.tech-list li::before { content: '>'; position: absolute; left: 0; color: var(--pink); font-weight: bold;}

/* Painel de info da peça selecionada */
.part-info-panel {
    margin-top: 1.75rem;
    border: 1px solid var(--border-glow);
    border-left: 3px solid var(--cyan);
    padding: 1.25rem;
    border-radius: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    min-height: 90px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(33, 217, 255, 0.05);
}
.part-info-label { font-size: 0.65rem; letter-spacing: 0.15em; color: var(--cyan); margin-bottom: 0.5rem; text-transform: uppercase; }
.part-info-name { font-size: 1.2rem; font-weight: 600; color: #fff; margin-bottom: 0.5rem; text-shadow: 0 0 5px rgba(255,255,255,0.3);}
.part-info-stats { font-family: 'Space Mono', monospace; font-size: 0.78rem; color: var(--gray); display: flex; flex-direction: column; gap: 4px; }

/* ============================================================
   CANVAS 3D (Three.js) & DIAGRAMAS
   ============================================================ */
.canvas-wrapper, .diagram-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 30px rgba(255, 46, 136, 0.03);
}
.canvas-wrapper { aspect-ratio: 4/3; display: flex; flex-direction: column; position: relative; }
canvas { width: 100% !important; height: 100% !important; display: block; flex: 1; outline: none; }
.canvas-loading {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
    animation: pulse 1s infinite alternate;
    pointer-events: none;
    z-index: 5;
}

.canvas-ui {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    max-width: 96%;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
}
.canvas-ui::-webkit-scrollbar { display: none; }

.canvas-btn {
    background: rgba(20, 15, 30, 0.85);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 7px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.canvas-btn:hover { border-color: var(--cyan); box-shadow: 0 0 15px rgba(33, 217, 255, 0.3); color: var(--cyan); }
.canvas-btn.active { border-color: var(--pink); color: #fff; background: rgba(255, 46, 136, 0.25); box-shadow: 0 0 15px rgba(255, 46, 136, 0.4); }

.canvas-source-tag {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--cyan);
    background: rgba(5, 2, 12, 0.75);
    border: 1px solid rgba(33, 217, 255, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 6;
    text-shadow: 0 0 6px var(--cyan);
}

.hud-overlay {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(5, 2, 12, 0.7);
    border-left: 2px solid var(--pink);
    padding: 5px 9px;
    border-radius: 0 4px 4px 0;
    backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 6;
}
.hud-overlay span { text-shadow: 0 0 5px rgba(0,0,0,0.8); }

.canvas-drop-hint {
    position: absolute;
    top: 3.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(15, 10, 25, 0.85);
    border: 1px dashed rgba(255, 46, 136, 0.4);
    padding: 5px 12px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 6;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.canvas-wrapper.drag-over {
    border-color: var(--pink) !important;
    box-shadow: 0 0 35px rgba(255, 46, 136, 0.4), inset 0 0 25px rgba(33, 217, 255, 0.15) !important;
}
.canvas-wrapper.drag-over .canvas-drop-hint {
    background: rgba(255, 46, 136, 0.4);
    color: #fff;
    border-color: var(--cyan);
    transform: translateX(-50%) scale(1.05);
}
.canvas-hint {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.1em;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.5s;
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 20px;
}

.diagram-wrapper { padding: 2rem; }
.diagram-wrapper svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 0 10px rgba(33, 217, 255, 0.2)); }
.diagram-caption {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    margin-top: 1.5rem;
}

/* ============================================================
   SEÇÃO CLIMÁTICA
   ============================================================ */
.climate-layout { max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: 2.5rem; }
.climate-chart-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.chart-title { font-size: 0.75rem; color: #fff; letter-spacing: 0.1em; text-transform: uppercase; }
.chart-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--gray); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }

.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px;}
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 1px; min-width: 0; }
.chart-bar { width: 100%; border-radius: 2px 2px 0 0; transition: height 1s cubic-bezier(0.22, 1, 0.3, 1); box-shadow: 0 0 5px currentColor;}
.chart-hours { display: flex; gap: 4px; margin-top: 8px; }
.chart-hour-label { flex: 1; font-size: 0.6rem; color: rgba(255,255,255,0.4); text-align: center; min-width: 0; }

.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.metric-card { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.metric-big { display: block; font-size: clamp(1.8rem, 3vw, 2.75rem); font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1; margin-bottom: 0.5rem; text-shadow: 0 0 15px rgba(255,255,255,0.2);}
.metric-label { font-size: 0.7rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; }

/* ============================================================
   CREDITS FINAL
   ============================================================ */
.credits-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-pad) 2rem;
    border-top: 1px solid var(--border);
    background: radial-gradient(circle at center, rgba(33, 217, 255, 0.05), transparent 60%);
}
.credits-inner { text-align: center; max-width: 700px; }
.credits-headline {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin: 1rem 0 2.5rem;
    background: linear-gradient(135deg, #fff, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.credits-nav { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.credits-link {
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    transition: all 0.25s;
    backdrop-filter: blur(5px);
}
.credits-link:hover { background: rgba(33, 217, 255, 0.2); border-color: var(--cyan); box-shadow: 0 0 20px rgba(33, 217, 255, 0.3); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal-left, .reveal-right, .reveal-up {
    opacity: 0;
    transition: opacity 0.75s cubic-bezier(0.22,1,0.3,1), transform 0.75s cubic-bezier(0.22,1,0.3,1);
}
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-up    { transform: translateY(30px); }
.reveal-left.visible, .reveal-right.visible, .reveal-up.visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 900px) {
    .two-col, .two-col.reverse { grid-template-columns: 1fr; direction: ltr; }
    .two-col.reverse > * { direction: ltr; }
    .metric-row { grid-template-columns: repeat(2, 1fr); }
    .rage-nav { display: none; }
    .version-chip { display: none; }
    .stat-divider { display: none; }
    .hero-stats { gap: 1.5rem; }
}
@media (max-width: 560px) {
    .metric-row { grid-template-columns: 1fr 1fr; }
    .credits-nav { flex-direction: column; align-items: center; }
}
