/* --- CSS VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-secondary: #4a4a4a;
    --accent-color: #f2f2f2;
    --border-color: #e5e5e5;
    --loader-bg: #ffffff;
    --loader-bar: #eeeeee;
    --loader-progress: #000000;
    --btn-bg: rgba(255, 255, 255, 0.8);
    --btn-border: #000000;
}

body.dark-mode {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-secondary: #888888;
    --accent-color: #1a1a1a;
    --border-color: #333333;
    --loader-bg: #050505;
    --loader-bar: #333333;
    --loader-progress: #ffffff;
    --btn-bg: rgba(0, 0, 0, 0.6);
    --btn-border: #ffffff;
}

/* OTIMIZAÇÃO CSS */
section { content-visibility: auto; contain-intrinsic-size: 1px 500px; }
.marquee-content, .hero-text-bg { will-change: transform; transform: translateZ(0); }

/* Estilo base dos links */
.footer-links a { 
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

/* Efeito ao passar o mouse */
.footer-links a:hover { 
    opacity: 1;
    border-bottom: 1px solid currentColor;
    letter-spacing: 0.05em;
}

/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; }

/* TYPOGRAPHY */
.font-display { font-family: 'Arial Black', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.9; }
.font-mono { font-family: 'Courier New', monospace; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; font-weight: 600; }

/* HEADER */
header {
    position: fixed; top: 0; left: 0; width: 100%; padding: 1.5rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; mix-blend-mode: exclusion;
}
.logo { font-weight: 700; font-size: 1.2rem; color: white; }
.nav-right { display: flex; gap: 2rem; align-items: center; }
.nav-links { display: flex; gap: 2rem; color: white; }
.controls { display: flex; gap: 1rem; align-items: center; }
button.icon-btn { background: none; border: none; cursor: pointer; color: white; display: flex; align-items: center; }

.sun-icon { display: none; } .moon-icon { display: block; }
body.dark-mode .sun-icon { display: block; } body.dark-mode .moon-icon { display: none; }

/* HERO SECTION (3D) */
#hero {
    position: relative; height: 100dvh; width: 100%;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    contain: paint; 
}

#canvas-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    transition: opacity 0.3s;
}

.touch-locked { pointer-events: none; } 
.touch-active { pointer-events: auto; cursor: grab; } 

.hero-text-bg {
    position: absolute; z-index: 0; text-align: center; pointer-events: none;
    width: 100%; top: 50%; transform: translateY(-50%); opacity: 0.4;
}
.hero-title { font-size: clamp(4rem, 16vw, 14rem); color: var(--accent-color); white-space: nowrap; }
.hero-overlay { position: absolute; bottom: 2rem; left: 2rem; z-index: 20; max-width: 300px; pointer-events: none; }

/* MOBILE CONTROLS */
#mobile-controls {
    position: absolute; bottom: 15%; left: 50%; transform: translateX(-50%);
    z-index: 30; display: none;
}
body.is-touch #mobile-controls { display: flex; flex-direction: column; gap: 10px; }

.interaction-btn {
    background: var(--bg-color); color: var(--text-color); border: 1px solid var(--text-color);
    padding: 12px 24px; border-radius: 50px; font-family: 'Courier New', monospace;
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
    display: flex; gap: 10px; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: all 0.3s ease;
}
.interaction-btn:hover { background: var(--text-color); color: var(--bg-color); }
.interaction-btn.hidden { display: none; }

/* MARQUEE */
.marquee-container { border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 1.5rem 0; overflow: hidden; white-space: nowrap; background: var(--bg-color); }
.marquee-content { display: inline-block; animation: marquee 30s linear infinite; }
.marquee-item { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin-right: 4rem; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px var(--text-color); }
body.dark-mode .marquee-item { color: var(--text-color); -webkit-text-stroke: 0; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* DETAILS */
section { padding: 4rem 2rem; }
#details { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; min-height: 50vh; }
.detail-block h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1.5rem; }
.detail-block p { font-size: 1.1rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 2rem; max-width: 600px; }
.specs-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--border-color); padding-top: 2rem; }
.spec-label { font-size: 0.7rem; color: var(--text-secondary); display: block; margin-bottom: 5px;}
.spec-value { font-size: 1rem; font-weight: 600; }

/* GALLERY CAROUSEL */
#gallery h3 { margin-bottom: 2rem; font-size: 2rem; }
.gallery-carousel {
    display: flex; overflow-x: auto; gap: 2rem; padding-bottom: 2rem;
    cursor: grab; user-select: none; -webkit-user-select: none;
    scrollbar-width: none; -ms-overflow-style: none;
}
.gallery-carousel::-webkit-scrollbar { display: none; }
.gallery-carousel.active { cursor: grabbing; }
.gallery-item { flex: 0 0 auto; height: 60vh; width: auto; position: relative; background: none; border: none; }
.gallery-item img { height: 100%; width: auto; object-fit: contain; display: block; pointer-events: none; filter: grayscale(100%); transition: filter 0.5s ease, transform 0.5s ease; }
.gallery-item:hover img { filter: grayscale(0%); transform: scale(1.02); }

/* FOOTER */
footer { padding: 4rem 2rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: flex-end; }
.footer-brand { font-size: clamp(3rem, 10vw, 6rem); font-weight: 900; line-height: 0.8; }
.footer-links { text-align: right; }
.footer-links a { text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }

/* LOADER */
#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--loader-bg); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 999; transition: opacity 0.5s ease; }
.loader-bar { width: 200px; height: 3px; background: var(--loader-bar); margin-top: 1rem; position: relative;}
.loader-progress { position: absolute; left: 0; top: 0; height: 100%; background: var(--loader-progress); width: 0%; transition: width 0.1s;}

@media (max-width: 768px) {
    header { padding: 1rem; }
    .nav-links { display: none; }
    #details { grid-template-columns: 1fr; gap: 2rem; }
    .gallery-item { height: 45vh; }
    footer { flex-direction: column; align-items: flex-start; gap: 2rem; }
    .footer-links { text-align: left; }
}