:root {
    /* Dark Dev Tool Theme */
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --accent-color: #58a6ff;
    --highlight-purple: #bc8cff;
    --button-bg: #21262d;
    --button-text: #ffffff;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --card-bg: #161b22;
    --card-border: #30363d;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Nav */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
}

.logo-icon {
    background: #fff;
    color: #000;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Demo Overlay - Toasts */
.demo-overlay-toast {
    position: absolute;
    z-index: 500;
    pointer-events: none;
}

.demo-overlay-toast.bottom-left {
    bottom: 20px;
    left: 20px;
}

.demo-overlay-toast.top-left {
    top: 20px;
    left: 20px;
}

.key-toast {
    background: #161b22;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 6px;
    color: #8b949e;
    font-family: 'Menlo', monospace;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;

    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.key-toast.active {
    opacity: 1;
    transform: translateY(0);
}

.key-val {
    color: #58a6ff;
    font-weight: 700;
    background: rgba(88, 166, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.status-toast {
    background: #161b22;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.status-toast:hover {
    border-color: #58a6ff;
}

.status-toast strong {
    color: #fff;
    font-weight: 600;
}

.status-icon {
    font-size: 1rem;
}

.version-badge {
    background: #30363d;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    color: #8b949e;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
}

.btn-primary {
    background: var(--button-bg);
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid var(--card-border);
}

.btn-primary:hover {
    background: #30363d;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 80px 20px 40px;
}

h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.highlight-underline {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.highlight-underline::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--highlight-purple);
    z-index: -1;
    opacity: 0.8;
}

.badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 60px;
}

.store-badge {
    background: var(--button-bg);
    color: var(--button-text);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    border: 1px solid var(--card-border);
}

.store-badge:hover {
    transform: scale(1.02);
    background: #30363d;
}

.featured-badge {
    color: #8b949e;
    font-size: 0.8rem;
    border-left: 1px solid var(--card-border);
    padding-left: 20px;
}

.featured-badge strong {
    color: var(--text-color);
    display: block;
}

/* App Showcase */
.app-showcase {
    max-width: 1000px;
    margin: 0 auto 100px;
    text-align: center;
    perspective: 1000px;
}

.demo-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #8b949e;
    margin-bottom: 20px;
    text-transform: uppercase;
    opacity: 0.8;
}

.demo-section-title .highlight {
    color: #58a6ff;
    padding: 2px 6px;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 4px;
}

.app-window {
    background: #0d1117;
    border-radius: 20px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    border: 1px solid var(--card-border);
}

.app-window:hover {
    transform: translateY(-5px);
}

.window-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #FF5F56;
}

.yellow {
    background: #FFBD2E;
}

.green {
    background: #27C93F;
}

.app-content-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b949e;
    background: radial-gradient(circle at center, #161b22 0%, #0d1117 100%);
}

.placeholder-gradient {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #a855f7, #3b82f6);
    filter: blur(80px);
    border-radius: 50%;
    position: absolute;
    opacity: 0.3;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instruction-text {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #8b949e;
    letter-spacing: 1px;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto 100px;
    padding: 0 20px;
}

.feature-item {
    text-align: center;
}

.icon-box {
    font-size: 2rem;
    margin-bottom: 16px;
    background: var(--card-bg);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);
}

.highlight-oval {
    border: 2px solid var(--highlight-purple);
    border-radius: 50%;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Footer */
.bottom-cta {
    text-align: center;
    margin-bottom: 150px;
}

.store-badge.big {
    font-size: 1.1rem;
    padding: 16px 32px;
    display: inline-block;
}

.site-footer {
    text-align: center;
    position: relative;
    padding-bottom: 40px;
    overflow: hidden;
}

.footer-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.footer-icons .social-icon {
    background: var(--card-bg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background 0.2s;
    border: 1px solid var(--card-border);
}

.footer-icons .social-icon:hover {
    background: #30363d;
}

.big-logo-watermark {
    font-size: 15rem;
    font-weight: 800;
    color: #f0ebe4;
    line-height: 0.8;
    user-select: none;
    pointer-events: none;
    margin-bottom: -60px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar {
        padding: 20px;
    }
}

/* Demo Desktop */
.demo-desktop {
    background: #0d1117;
    border-radius: 20px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    border: 1px solid var(--card-border);
    margin: 0 auto;
    max-width: 1000px;
}

/* Demo Windows */
.demo-window {
    position: absolute;
    width: 45%;
    height: 55%;
    background: #161b22;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    /* Optimize transition: Avoid 'all', target specific properties for performance */
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    cursor: default;
    /* Default non-active state */
    opacity: 1;
    transform: scale(0.98);
    z-index: 10;
    overflow: hidden;
    /* Fix broken corners */
    will-change: transform, opacity;
    /* Hint browser */
}

/* ... */

.status-toast {
    background: #161b22;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    /* Clickable */
    pointer-events: auto;
    /* Enable clicks */
}

.status-toast:hover {
    border-color: #58a6ff;
    color: #fff;
}

.demo-window.active {
    opacity: 1;
    transform: scale(1);
    z-index: 100;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border-color: #58a6ff;
}

.window-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
}

.window-controls {
    position: absolute;
    left: 16px;
}

.window-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.7;
}

.window-content {
    flex: 1;
    padding: 20px;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.9rem;
    overflow: hidden;
}

/* Code Content - Left Aligned */
.code-content {
    color: #e6edf3;
    padding: 0;
    text-align: left;
    /* Explicitly left aligned */
}

.k {
    color: #ff7b72;
}

/* keyword */
.v {
    color: #79c0ff;
}

/* variable */
.s {
    color: #a5d6ff;
}

/* string */
.indent {
    padding-left: 20px;
}

/* Terminal Content */
.term-content {
    color: #c9d1d9;
}

.prompt {
    color: #7ee787;
    margin-right: 8px;
}

.cmd {
    color: #fff;
}

.success {
    color: #7ee787;
    opacity: 0.8;
    margin-top: 4px;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Chat Content - Fixed Alignment */
.chat-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically for demo look */
    padding: 20px;
    gap: 12px;
    align-items: flex-start;
}

.msg {
    padding: 8px 14px;
    border-radius: 18px;
    /* More rounded like standard chat */
    font-size: 0.85rem;
    max-width: 80%;
    line-height: 1.4;
    position: relative;
}

.msg.received {
    background: #21262d;
    color: #e6edf3;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    text-align: left;
    /* Explicitly ensure text is left aligned */
}

.msg.sent {
    background: #1f6feb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.fake-input {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: default;
}

/* Settings Content */
.settings-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    /* Restore padding */
    gap: 0;
    background: #161b22;
}

.settings-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 8px;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

.settings-section-label:first-child {
    margin-top: 0;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #c9d1d9;
}

.settings-item:last-child {
    border-bottom: none;
}

.setting-value {
    color: #58a6ff;
}

/* Toggle Switch */
.toggle-switch {
    width: 32px;
    height: 18px;
    background: #30363d;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active {
    background: #238636;
    /* GitHub green */
}

.toggle-switch.active::after {
    transform: translateX(14px);
}


/* Settings Dark Mode REMOVED OLD CLASSES */

/* Demo Overlay */
.demo-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    text-align: center;
    pointer-events: none;
}

.demo-status {
    background: #0d1117;
    /* Solid color, no blur */
    color: #58a6ff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    border: 1px solid #58a6ff;
    display: inline-block;
}

.demo-instruction {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.key-visualizer {
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
    height: 80px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.key-visualizer.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Demo Dock */
.demo-dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #161b22;
    padding: 8px 12px;
    border-radius: 16px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--card-border);
    z-index: 1000;
}

/* Dock Item - Fixed Container */
.dock-item {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    cursor: pointer;
    z-index: 10;
}

/* Icon handles the movement/scale */
.dock-icon {
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
    position: relative;
    z-index: 20;
    /* Icon on top */
}

.dock-item:hover .dock-icon {
    transform: scale(1.1) translateY(-10px);
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dock-item.active {
    background: rgba(255, 255, 255, 0.15);
    /* Slightly less bright */
    box-shadow: none;
    /* Remove shadow for performance */
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Very subtle border instead */
}

/* Remove old pseudo-element dot */

/* Dock Dots */
.dock-dots {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    pointer-events: none;
}

.dock-dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    /* Gray/Dim */
    border-radius: 50%;
    transition: background 0.2s;
}

.dock-dot.active {
    background: #fff;
    /* White/Active */
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.dock-tooltip {
    position: absolute;
    top: -35px;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

/* Animations for window switching */
@keyframes popIn {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pop Number Animation */
.pop-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    /* Larger */
    font-weight: 800;
    color: #58a6ff;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    /* Behind the icon */
    /* Removed text-shadow for performance */
}

.pop-number.animate {
    animation: popOut 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popOut {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -120%) scale(1.2);
        opacity: 1;
    }

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

/* Contact Button */
.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0 16px;
    height: 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.contact-btn:hover {
    color: #58a6ff;
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .demo-window {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 12px;
        box-shadow: none;
        border: none;
    }

    .demo-desktop {
        /* Taller on mobile as requested */
        aspect-ratio: 1/1;
        min-height: 400px;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Hide Toasts on Mobile */
    .demo-overlay-toast,
    .status-toast,
    .key-toast {
        display: none !important;
    }
}