:root {
    /* Strong / Manly Palette */
    --bg-color: #020202;
    /* Deepest Black */
    --text-color: #ffffff;

    /* High contrast, intense Red and Blue */
    --primary-red: #ff3e3e;
    --primary-blue: #2962ff;
    --accent-purple: transparent;
    /* Removed purple */

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 16px;

    /* Direct linear gradient, no soft purples */
    --gradient-main: linear-gradient(90deg, var(--primary-red), var(--primary-blue));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Ambient Background Glow */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 62, 62, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(41, 98, 255, 0.15) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
    animation: drift 20s infinite alternate;
    overflow: hidden;
}

@keyframes drift {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* Navbar Specifics - Responsive */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 92%;
    max-width: 1400px;
    border-radius: 50px;
    z-index: 1000;
}


.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}

.nav-links-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    transition: color 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Active Pill Style */
.nav-pill.active {
    background: var(--gradient-main);
    color: white;
    border-radius: 30px;
    padding: 0.6rem 1.8rem;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.4);
    /* Red glow matches primary red */
}

.nav-item:hover {
    color: white;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.burger-menu.open span:nth-child(2) {
    opacity: 0;
}

.burger-menu.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-item {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav-item.active {
    color: white;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mobile-nav-item:hover {
    color: white;
    transform: scale(1.1);
}

/* Centered Hero Layout */
.centered-hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 0;
}

.hero-content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.gradient-headline {
    font-size: clamp(3.5rem, 15vw, 8rem);
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
    line-height: 1;
}

.subtitle-text {
    font-size: clamp(1rem, 4vw, 1.8rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    margin-bottom: 3rem;
    letter-spacing: 0.5px;
    max-width: 90%;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

/* Pulse Animations */
.pulse-active {
    animation: textPulse 0.15s ease-out;
}

/* Info Sections */
.info-section {
    padding: 100px 5%;
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
}

.info-section.alternate {
    background: rgba(255, 255, 255, 0.02);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title.left {
    text-align: left;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 3rem 2rem;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Split Layout */
.split-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.split-text {
    flex: 1;
}

.section-desc {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.feature-list li::before {
    content: '→';
    color: var(--primary-blue);
    font-weight: 800;
}

.split-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 300px;
}

.visual-mockup {
    width: 100%;
    max-width: 300px;
    height: 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.mockup-line {
    width: 80%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.mockup-line.short {
    width: 40%;
}

.mockup-circle {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
    box-shadow: 0 0 30px rgba(41, 98, 255, 0.4);
}

/* Footer */
.glass-footer {
    padding: 4rem 10%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.footer-logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@keyframes textPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.02);
        filter: brightness(1.3);
        text-shadow: 0 0 30px rgba(41, 98, 255, 0.6);
        /* Blue glow match */
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Button Styles */
.btn-primary {
    background: var(--gradient-main);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 20px rgba(255, 62, 62, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(41, 98, 255, 0.4);
}

.btn-secondary:active,
.btn-save:active {
    transform: scale(0.98);
}

.btn-secondary.success,
.btn-save.success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border-color: #22c55e !important;
    color: white !important;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Generator Page Styles - Responsive */
.generator-layout {
    display: flex;
    min-height: 100vh;
    padding: 120px 5% 50px 5%;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .generator-layout {
        flex-direction: column-reverse;
        padding-top: 140px;
        height: auto;
        text-align: center;
    }

    .controls-panel {
        width: 100%;
        max-width: 600px;
    }
}

.controls-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
    box-shadow: 0 0 15px rgba(41, 98, 255, 0.3);
}

.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qode-preview-container {
    width: min(85vw, 400px);
    height: min(85vw, 400px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(40px);
}

.qode-img {
    max-width: 85%;
    max-height: 85%;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
    transition: opacity 0.3s ease;
}

.qode-img.hidden {
    opacity: 0;
}

.btn-save {
    position: relative;
    background: var(--gradient-main);
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 200px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 62, 62, 0.3);
}

.btn-save.loading {
    width: 60px;
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: transparent;
}

.btn-save.loading::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-save.success {
    background: #00cc66;
    width: 200px;
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.5);
}

.btn-save.success::before {
    content: 'Saved!';
    color: white;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .preview-panel {
        margin-bottom: 2rem;
    }

    .gradient-headline {
        letter-spacing: -1px;
    }
}

/* Magnetic Siren Cursor */
.cursor-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.cursor-magnet {
    position: absolute;
    width: 200px;
    height: 600px;
    /* Long leaf/beam shape */
    border-radius: 50%;
    opacity: 0;
    filter: blur(60px);
    mix-blend-mode: screen;
    transform-origin: center center;
    transition: opacity 0.3s ease;
}

.magnet-red {
    background: radial-gradient(ellipse at center, rgba(255, 62, 62, 0.4), transparent 70%);
}

.magnet-blue {
    background: radial-gradient(ellipse at center, rgba(41, 98, 255, 0.4), transparent 70%);
}

/* --- Scanner Page Styles - Responsive --- */
.scanner-layout {
    display: flex;
    min-height: 100vh;
    padding: 120px 5% 50px 5%;
    gap: 3rem;
    align-items: center;
}


.mode-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.scanner-container {
    display: none;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: black;
    border: 2px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(41, 98, 255, 0.1);
}

.scanner-container.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#video-feed,
#scan-snap-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#scan-snap-preview {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    background: black;
}

.snap-flash {
    animation: snapFlashAnim 0.4s ease-out;
}

@keyframes snapFlashAnim {
    0% {
        filter: brightness(3) contrast(1.5);
    }

    100% {
        filter: brightness(1) contrast(1);
    }
}

#video-feed {
    animation: focusBreath 4s infinite ease-in-out;
}

/* Focus Reticle Arcs (Circular Lock-on) */
.focus-arc {
    position: absolute;
    width: 70%;
    height: 70%;
    border: 2px solid transparent;
    border-radius: 50%;
    z-index: 3;
    animation: focusPulse 2s infinite ease-in-out;
    pointer-events: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.focus-arc.tl {
    border-top-color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    transform: translate(-50%, -50%) rotate(-5deg);
}

.focus-arc.tr {
    border-top-color: var(--primary-blue);
    border-right-color: var(--primary-blue);
    transform: translate(-50%, -50%) rotate(5deg);
}

.focus-arc.bl {
    border-bottom-color: var(--primary-red);
    border-left-color: var(--primary-red);
    transform: translate(-50%, -50%) rotate(5deg);
}

.focus-arc.br {
    border-bottom-color: var(--primary-red);
    border-right-color: var(--primary-red);
    transform: translate(-50%, -50%) rotate(-5deg);
}

@keyframes focusPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1.0);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 10px var(--primary-blue));
    }
}

@keyframes focusBreath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Scan Line Animation */
.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Dropzone */
.dropzone {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--glass-border);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-blue);
    color: white;
    background: rgba(41, 98, 255, 0.05);
}

.dropzone .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Uploaded Image Preview */
#uploaded-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Match container */
    display: block;
}

/* Result Box */
.result-box.hidden {
    display: none;
}

.result-box textarea {
    resize: none;
    margin-top: 0.5rem;
    font-family: monospace;
}

/* --- Mobile Responsiveness Overrides --- */
@media (max-width: 1024px) {
    .scanner-layout {
        flex-direction: column-reverse;
        height: auto;
        padding-top: 140px;
        padding-bottom: 80px;
    }

    .controls-panel {
        width: 100%;
        max-width: 600px;
    }

    .qode-preview-container,
    .scanner-container {
        width: min(85vw, 350px);
        height: min(85vw, 350px);
    }
}

@media (max-width: 600px) {
    .glass-nav {
        padding: 0.6rem 1rem;
        top: 10px;
        width: 95%;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .split-layout {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .split-visual {
        min-width: initial;
        width: 100%;
    }

    .info-section {
        padding: 60px 4%;
    }

    .nav-links-right {
        display: none;
        /* Hide desktop links */
    }

    .burger-menu {
        display: flex;
    }
}