/* Modern CSS Baseline & Theming */
@layer base, layout, components, utilities;

@layer base {
    :root {
        /* Colors using oklch */
        --primary-hue: 250;
        --primary: oklch(60% 0.2 var(--primary-hue));
        --primary-light: oklch(75% 0.15 var(--primary-hue));
        --primary-dark: oklch(45% 0.25 var(--primary-hue));
        --primary-glow: oklch(65% 0.3 var(--primary-hue) / 0.5);

        --secondary: oklch(70% 0.1 150);
        --accent: oklch(80% 0.2 60);

        --bg-light: oklch(98% 0.01 250);
        --bg-alt: oklch(94% 0.02 250);
        --bg-dark: oklch(15% 0.05 250);

        --text-main: oklch(20% 0.02 250);
        --text-muted: oklch(45% 0.02 250);
        --text-white: oklch(99% 0.01 250);

        /* Shadows */
        --shadow-sm: 0 2px 4px oklch(0% 0 0 / 0.05);
        --shadow-md: 0 10px 25px -5px oklch(0% 0 0 / 0.1), 0 8px 10px -6px oklch(0% 0 0 / 0.1);
        --shadow-lg: 0 20px 50px -12px oklch(0% 0 0 / 0.25);
        --shadow-glow: 0 0 20px var(--primary-glow);

        /* Spacing & Transitions */
        --spacing-unit: 1rem;
        --transition-fast: 0.2s ease;
        --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    html {
        scroll-behavior: smooth;
        font-size: 16px;
    }

    body {
        font-family: 'Inter', 'Noto Sans KR', sans-serif;
        line-height: 1.6;
        color: var(--text-main);
        background-color: var(--bg-light);
        overflow-x: hidden;
    }

    h1, h2, h3, h4 {
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    img {
        max-width: 100%;
        display: block;
    }

    .noise-bg {
        position: relative;
    }

    .noise-bg::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.03;
        z-index: 9999;
        pointer-events: none;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3BaseFilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/baseFilter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    }
}

@layer layout {
    .container {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1.5rem;
    }

    .section {
        padding: 6rem 0;
    }

    .bg-alt {
        background-color: var(--bg-alt);
    }

    .bg-dark {
        background-color: var(--bg-dark);
    }

    .text-white {
        color: var(--text-white);
    }

    .grid {
        display: grid;
        gap: 2rem;
    }

    @media (min-width: 768px) {
        .grid-2 { grid-template-columns: repeat(2, 1fr); }
        .grid-3 { grid-template-columns: repeat(3, 1fr); }
    }
}

@layer components {
    /* Buttons */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 1rem 2rem;
        border-radius: 50px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        transition: var(--transition-base);
        border: none;
        font-family: inherit;
    }

    .btn-primary {
        background-color: var(--primary);
        color: white;
    }

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

    .btn-secondary {
        background-color: white;
        color: var(--text-main);
        box-shadow: var(--shadow-sm);
    }

    .btn-secondary:hover {
        background-color: var(--bg-alt);
        transform: translateY(-2px);
    }

    .btn-outline-white {
        background-color: transparent;
        color: white;
        border: 2px solid white;
    }

    .btn-large {
        padding: 1.25rem 3rem;
        font-size: 1.125rem;
    }

    .glow-effect {
        box-shadow: var(--shadow-glow);
    }

    .glow-effect:hover {
        box-shadow: 0 0 30px var(--primary-glow);
    }

    /* Hero Section */
    .hero {
        padding: 10rem 0 6rem;
        background: radial-gradient(circle at top right, oklch(90% 0.1 280 / 0.3), transparent 40%),
                    radial-gradient(circle at bottom left, oklch(90% 0.1 200 / 0.3), transparent 40%);
    }

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

    .hero h1 {
        font-size: clamp(2.5rem, 8vw, 4.5rem);
        font-weight: 900;
        margin-bottom: 1.5rem;
        color: var(--bg-dark);
        word-break: keep-all;
    }

    .hero h1 strong {
        color: var(--primary);
    }

    .hero p {
        font-size: 1.25rem;
        color: var(--text-muted);
        margin-bottom: 2.5rem;
    }

    .badge {
        display: inline-block;
        padding: 0.5rem 1rem;
        background-color: oklch(90% 0.05 var(--primary-hue));
        color: var(--primary-dark);
        border-radius: 20px;
        font-size: 0.875rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
    }

    .hero-actions {
        display: flex;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Section Header */
    .section-header {
        text-align: center;
        margin-bottom: 4rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .section-header p {
        color: var(--text-muted);
        font-size: 1.125rem;
    }

    /* Grid Layouts */
    .problem-grid, .pricing-grid {
        display: grid;
        gap: 2rem;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    /* Solution Items */
    .solution-grid {
        display: grid;
        gap: 6rem;
    }

    .solution-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
    }

    .solution-item.reverse {
        direction: rtl;
    }

    .solution-item.reverse .solution-text {
        direction: ltr;
    }

    .solution-text h3 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        color: var(--primary-dark);
    }

    .solution-text p {
        font-size: 1.125rem;
        color: var(--text-muted);
    }

    .solution-image-placeholder {
        aspect-ratio: 4/3;
        background: linear-gradient(135deg, var(--bg-alt), var(--primary-light));
        border-radius: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: var(--primary-dark);
        box-shadow: var(--shadow-md);
    }

    /* Solution Illustrations */
    .illustration-container {
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 300px;
        background: oklch(15% 0.05 250);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: var(--shadow-lg);
    }

    /* AI Detection Visualization */
    .ai-detection {
        background: linear-gradient(135deg, oklch(20% 0.05 250), oklch(10% 0.05 250));
        position: relative;
    }

    .camera-feed {
        position: absolute;
        inset: 10px;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 16px;
        overflow: hidden;
    }

    .bounding-box {
        position: absolute;
        border: 2px solid oklch(70% 0.2 150);
        border-radius: 4px;
        box-shadow: 0 0 10px oklch(70% 0.2 150 / 0.5);
    }

    .bounding-box::before {
        content: attr(data-label);
        position: absolute;
        top: -25px;
        left: -2px;
        background: oklch(70% 0.2 150);
        color: black;
        font-size: 10px;
        font-weight: 800;
        padding: 2px 6px;
        border-radius: 2px 2px 0 0;
        white-space: nowrap;
    }

    .scanline {
        position: absolute;
        width: 100%;
        height: 2px;
        background: oklch(70% 0.2 150 / 0.5);
        box-shadow: 0 0 15px oklch(70% 0.2 150);
        animation: scan 3s linear infinite;
    }

    @keyframes scan {
        0% { top: 0; }
        100% { top: 100%; }
    }

    /* Remote Audio System */
    .audio-system {
        display: flex;
        align-items: center;
        justify-content: center;
        background: oklch(15% 0.05 250);
    }

    .audio-waves {
        display: flex;
        align-items: center;
        gap: 6px;
        height: 100px;
    }

    .wave-bar {
        width: 6px;
        background: var(--primary);
        border-radius: 10px;
        animation: wave 1s ease-in-out infinite alternate;
    }

    @keyframes wave {
        0% { height: 20px; opacity: 0.5; }
        100% { height: 80px; opacity: 1; }
    }

    .live-indicator {
        position: absolute;
        top: 20px;
        right: 20px;
        background: oklch(60% 0.2 20);
        color: white;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 800;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .live-indicator::before {
        content: "";
        width: 8px;
        height: 8px;
        background: white;
        border-radius: 50%;
        animation: blink 1s infinite;
    }

    @keyframes blink {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.3; }
    }

    @media (max-width: 768px) {
        .solution-item {
            grid-template-columns: 1fr;
            gap: 2rem;
        }
        .solution-item.reverse {
            direction: ltr;
        }
    }

    /* Pricing Extra */
    .pricing-note {
        text-align: center;
        margin-top: 3rem;
        color: var(--text-muted);
        font-size: 0.875rem;
    }

    /* Trust Section */
    .trust-content {
        max-width: 800px;
        margin: 0 auto;
        text-align: center;
    }

    .trust-content h2 {
        font-size: 2.25rem;
        font-style: italic;
        margin-bottom: 2rem;
    }

    .trust-content p {
        font-size: 1.25rem;
        opacity: 0.9;
        margin-bottom: 2rem;
    }

    .trust-content cite {
        font-weight: 700;
        font-style: normal;
        color: var(--primary-light);
    }

    /* CTA Section */
    .cta-section {
        padding-bottom: 8rem;
    }

    .cta-card {
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        padding: 4rem;
        border-radius: 32px;
        text-align: center;
        color: white;
    }

    .cta-card h2 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .cta-card p {
        font-size: 1.25rem;
        margin-bottom: 2.5rem;
        opacity: 0.9;
    }

    .cta-actions {
        display: flex;
        gap: 1.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    @media (max-width: 640px) {
        .cta-card {
            padding: 3rem 1.5rem;
        }
    }
}

@layer utilities {
    .text-center { text-align: center; }
    .mt-4 { margin-top: 1rem; }
}
