:root {
    --primary: #00eeff;
    --secondary: #7a04eb;
    --dark: #000;
    --light: #fff;
    --gray: #333;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

body.dark-mode {
    background: #0a0a0a;
    color: #e0e0e0;
}

body.light-mode {
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================
   HEADER COM ESCALONAMENTO RESPONSIVO
   ========================= */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 20px rgba(0, 238, 255, 0.3);
}

.light-mode .header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(122, 4, 235, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-size: clamp(1rem, 2vw, 1.125rem);
    white-space: nowrap;
}

.light-mode .nav-menu a {
    color: #333;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

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

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lang-btn,
.theme-btn {
    background: transparent;
    border: 1px solid var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-size: clamp(1rem, 2vw, 1.2rem);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover,
.theme-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 238, 255, 0.4);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.75rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    background: radial-gradient(circle at 20% 50%, rgba(0, 238, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(122, 4, 235, 0.1) 0%, transparent 50%);
}

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

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 3vw, 2.5rem);
    color: var(--primary);
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.hero-slogan {
    font-size: clamp(1rem, 2.5vw, 1.375rem);
    opacity: 0.8;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s;
    animation-fill-mode: both;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    font-weight: 600;
    cursor: pointer;
    font-size: clamp(1rem, 2vw, 1.125rem);
    min-width: 200px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 238, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-3px);
}

.floating-element {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(0, 238, 255, 0.1), rgba(122, 4, 235, 0.1));
    border-radius: 50%;
    filter: blur(40px);
    animation: float 6s ease-in-out infinite;
}

/* =========================
   SECTIONS GERAIS
   ========================= */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
}

.sobre,
.habilidades,
.projetos,
.contato {
    padding: 5rem 0;
}

.light-mode .sobre:nth-child(even),
.light-mode .projetos:nth-child(even) {
    background: #f9f9f9;
}

.sobre-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.sobre-content p {
    margin-bottom: 1.5rem;
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    line-height: 1.8;
    opacity: 0.9;
}

/* =========================
   SKILLS GRID - CORRIGIDO PARA DESKTOP
   ========================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.skill-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid rgba(0, 238, 255, 0.2);
}

.skill-card h3 {
    font-size: 1.125rem;
    /* Permite quebra de linha em desktop */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.light-mode .skill-card {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 238, 255, 0.3);
    border-color: var(--primary);
}

.skill-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

/* =========================
   PROJECTS GRID
   ========================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(122, 4, 235, 0.2);
}

.light-mode .project-card {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(122, 4, 235, 0.3);
}

.placeholder-image {
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 238, 255, 0.2), rgba(122, 4, 235, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--primary);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.375rem;
    font-family: 'Orbitron', sans-serif;
}

.project-content p {
    font-size: 1.125rem;
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.project-tech span {
    padding: 0.375rem 1rem;
    background: rgba(0, 238, 255, 0.1);
    border-radius: 15px;
    font-size: 1rem;
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* =========================
   CONTACT FORM
   ========================= */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.125rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 238, 255, 0.3);
    border-radius: 8px;
    color: inherit;
    transition: var(--transition);
    font-size: 1.125rem;
    font-family: 'Space Grotesk', sans-serif;
}

.light-mode .form-group input,
.light-mode .form-group textarea {
    background: white;
    border-color: #ddd;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 238, 255, 0.3);
}

.error-message {
    color: #ff4444;
    font-size: 1rem;
    margin-top: 0.25rem;
    display: block;
}

.g-recaptcha {
    margin: 1rem 0;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-size: 1.125rem;
}

.status-message.success {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border: 1px solid #00ff00;
}

.status-message.error {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border: 1px solid #ff4444;
}

/* =========================
   FOOTER
   ========================= */
.footer {
    background: rgba(0, 0, 0, 0.9);
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
}

.light-mode .footer {
    background: #fff;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--primary);
    font-size: 1.75rem;
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-5px);
    color: var(--secondary);
}

.copyright {
    font-size: 1.125rem;
}

/* =========================
   ANIMAÇÕES
   ========================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* =========================
   RESPONSIVIDADE MOBILE-FIRST
   ========================= */

/* Tablets e dispositivos médios */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 7vw, 5rem);
    }
}

/* Dispositivos móveis maiores */
@media (max-width: 768px) {
    /* Body com padding para acomodar widgets escalonados */
    body {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 1.5rem;
        overflow: visible !important;
    }

    .light-mode .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu a {
        font-size: 1.25rem;
        padding: 0.5rem 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-controls {
        order: -1;
        gap: 0.5rem;
    }

    .hero {
        padding: 100px 20px 40px;
        min-height: 100vh;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .btn {
        width: 250px;
    }
    
    .floating-element {
        width: 200px;
        height: 200px;
    }

    .section-title {
        margin-bottom: 2rem;
    }
    
    .sobre,
    .habilidades,
    .projetos,
    .contato {
        padding: 3rem 0;
    }
    
    .sobre-content p {
        text-align: justify;
        padding: 0 10px;
    }

    /* Skills Grid - Escalonamento apenas em mobile */
    .skills-grid {
        transform: scale(0.85);
        transform-origin: center top;
        width: max-content;
        min-width: 100%;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        max-width: 100vw;
    }
    
    .skill-card {
        padding: 1.5rem 0.5rem;
        flex-shrink: 0;
        min-width: 120px;
    }
    
    .skill-card h3 {
        font-size: clamp(0.875rem, 2vw, 1.125rem);
        white-space: nowrap;
    }

    /* Projects Grid - Mantém integridade */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 10px;
    }
    
    .project-card {
        transform: scale(0.95);
        margin: 0 auto;
        min-width: 280px;
    }
    
    .project-content h3 {
        font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    }
    
    .project-content p {
        font-size: clamp(1rem, 2vw, 1.125rem);
    }
    
    .project-tech span {
        font-size: clamp(0.875rem, 1.5vw, 1rem);
        white-space: nowrap;
    }

    /* Contact Form - Escalonamento crítico */
    .contact-form {
        transform: scale(0.9);
        transform-origin: center top;
        width: max-content;
        min-width: 100%;
        padding: 0 10px;
    }
    
    .form-group label {
        font-size: clamp(1rem, 2vw, 1.125rem);
    }
    
    .form-group input,
    .form-group textarea {
        font-size: clamp(1rem, 2vw, 1.125rem);
        min-width: 280px;
    }
    
    .error-message {
        font-size: clamp(0.875rem, 1.5vw, 1rem);
    }
    
    /* reCAPTCHA responsivo */
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
        margin: 1rem auto;
        width: 304px;
    }
    
    .status-message {
        font-size: clamp(1rem, 2vw, 1.125rem);
    }

    .footer {
        padding: 2rem 0;
        margin-top: 3rem;
    }
    
    .social-links a {
        font-size: clamp(1.5rem, 3vw, 1.75rem);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .copyright {
        font-size: clamp(1rem, 2vw, 1.125rem);
    }
}

/* Dispositivos móveis pequenos */
@media (max-width: 480px) {
    .hero {
        padding: 80px 15px 30px;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .sobre,
    .habilidades,
    .projetos,
    .contato {
        padding: 2.5rem 0;
    }
    
    /* Skills Grid - Maior escalonamento em telas pequenas */
    .skills-grid {
        transform: scale(0.75);
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .skill-card {
        padding: 1.25rem 0.25rem;
    }
    
    .placeholder-image {
        height: 150px;
        font-size: clamp(3rem, 5vw, 3.5rem);
    }
    
    /* Project Cards com escalonamento total */
    .project-card {
        transform: scale(0.88);
    }
    
    /* Form ainda menor em mobile */
    .contact-form {
        transform: scale(0.82);
    }
    
    /* reCAPTCHA ainda menor */
    .g-recaptcha {
        transform: scale(0.77);
        margin: 1rem -10px;
    }
}

/* Dispositivos muito pequenos */
@media (max-width: 360px) {
    /* Skills em 2 colunas com escala reduzida */
    .skills-grid {
        transform: scale(0.7);
    }
    
    .skill-card h3 {
        font-size: 0.7rem;
    }
    
    /* Projetos mantêm proporção */
    .project-card {
        transform: scale(0.85);
    }
    
    /* Form crítico preservado */
    .contact-form {
        transform: scale(0.78);
    }
}

/* Ajustes para landscape em móveis */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }
    
    /* Ajusta escala em landscape */
    .skills-grid {
        transform: scale(0.8);
    }
    
    .contact-form {
        transform: scale(0.85);
    }
}

/* =========================
   GARANTIAS DE OVERFLOW
   ========================= */
/* Previne scroll horizontal em qualquer situação */
html {
    overflow-x: hidden;
}

/* Garante que widgets escalonados não causem overflow */
@media (max-width: 768px) {
    section {
        overflow: visible;
    }
    
    /* Container flexível para widgets */
    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}