:root {
    --bg-dark: #131316;
    --bg-surface: #1b1b20;
    --bg-elevated: #222228;
    --accent: #6c9fff;
    --accent-glow: rgba(108, 159, 255, 0.2);
    --accent-pink: #f472b6;
    --accent-orange: #fb923c;
    --accent-purple: #a78bfa;
    --accent-green: #4ade80;
    --accent-yellow: #facc15;
    --text-primary: #eaeaed;
    --text-secondary: #9494a3;
    --text-muted: #5e5e6e;
    --border-color: rgba(255,255,255,0.06);
    --border-subtle: rgba(255,255,255,0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* ===== SUBTLE GRAIN TEXTURE ===== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* ===== TOP BAR ===== */
.app-topbar {
    background: rgba(19, 19, 22, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-logo {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.app-logo .logo-accent {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(108, 159, 255, 0.5);
}
.file-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: 6px;
}

/* ===== HERO ===== */
.hero-section {
    position: relative;
    overflow: hidden;
}
.hero-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
}
.glow-1 { background: var(--accent); top: -200px; right: -100px; }
.glow-2 { background: var(--accent-pink); bottom: -200px; left: -100px; }

.hero-canvas {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 60px 50px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--border-subtle), 0 20px 60px rgba(0,0,0,0.3);
}
/* Checkerboard subtle */
.hero-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.01) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.01) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.01) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.01) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
    pointer-events: none;
}
.hero-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
}
.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -2px;
    color: var(--text-primary);
}
.hero-title .t-accent { color: var(--accent); }
.hero-title .t-pink { color: var(--accent-pink); }
.hero-sub {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 400px;
}
/* Corner handles */
.corner-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 2px solid var(--accent);
    background: var(--bg-surface);
    opacity: 0.4;
}
.ch-tl { top: 12px; left: 12px; }
.ch-tr { top: 12px; right: 12px; }
.ch-bl { bottom: 12px; left: 12px; }
.ch-br { bottom: 12px; right: 12px; }

/* Tool chips */
.tool-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tool-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR PANELS (desktop) ===== */
.side-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.s-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.s-panel-head {
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.s-panel-body { padding: 12px 14px; }

/* Color swatches */
.swatch-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.swatch:hover { transform: scale(1.25); box-shadow: 0 0 12px rgba(255,255,255,0.15); }

/* Layer rows */
.layer-item {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    gap: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    transition: background 0.2s;
    cursor: pointer;
}
.layer-item:hover { background: rgba(255,255,255,0.03); }
.layer-item.active { background: rgba(108, 159, 255, 0.08); }
.layer-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    flex-shrink: 0;
}
.layer-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    flex: 1;
}
.layer-vis { font-size: 12px; color: var(--text-muted); }

/* Info rows */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}
.info-key { color: var(--text-muted); }
.info-val { color: var(--accent); }

/* ===== SECTION HEADING ===== */
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}
.section-label::before { content: '/* '; color: #4a6; }
.section-label::after { content: ' */'; color: #4a6; }

/* ===== INSTAGRAM EMBEDS ===== */
.insta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
.insta-card:hover {
    transform: translateY(-6px);
    border-color: rgba(108, 159, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25), 0 0 0 1px rgba(108, 159, 255, 0.1);
}
.insta-card iframe {
    display: block;
    border: none;
    width: 100%;
    min-height: 480px;
    background: var(--bg-surface);
}
.insta-label {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.insta-label-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.insta-label-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--accent);
}

/* ===== GLOW DIVIDER ===== */
.glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-pink), transparent);
    opacity: 0.15;
}

/* ===== CTA ===== */
.cta-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-subtle), 0 20px 60px rgba(0,0,0,0.2);
}
.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(108, 159, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}
.cta-btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}
.cta-btn-primary:hover {
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}
.cta-btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.cta-btn-secondary:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    display: inline-block;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   RESPONSIVE - MEDIA QUERIES
   ============================================ */

/* Tablet (max-width: 991px) */
@media (max-width: 991px) {
    .desktop-only { display: none !important; }
    .hero-canvas { padding: 40px 24px; }
}

/* Tablet pequeno (max-width: 768px) */
@media (max-width: 768px) {
    .hero-canvas {
        padding: 35px 20px;
    }

    .hero-title {
        font-size: clamp(28px, 5vw, 48px);
        letter-spacing: -1px;
    }

    .hero-sub {
        font-size: 14px;
    }

    .insta-card iframe {
        min-height: 400px;
    }

    .insta-card:hover {
        transform: translateY(-3px);
    }

    .cta-box {
        padding: 40px 24px;
    }
}

/* Mobile (max-width: 639px) */
@media (max-width: 639px) {
    .hero-canvas {
        padding: 30px 16px;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .hero-sub {
        font-size: 13px;
    }

    .hero-tag {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .tool-chip {
        font-size: 9px;
        padding: 4px 8px;
    }

    .corner-handle {
        width: 8px;
        height: 8px;
    }

    .insta-card iframe {
        min-height: 350px;
    }

    .insta-label {
        padding: 10px 12px;
    }

    .cta-box {
        padding: 30px 16px;
        border-radius: 12px;
    }

    .cta-btn {
        font-size: 12px;
        padding: 10px 18px;
        width: 100%;
        justify-content: center;
    }

    .section-label {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .app-footer {
        font-size: 9px;
    }
}

/* Mobile muito pequeno (max-width: 374px) */
@media (max-width: 374px) {
    .hero-title {
        font-size: 24px;
    }

    .insta-card iframe {
        min-height: 300px;
    }

    .cta-box {
        padding: 24px 14px;
    }
}
