/* ============================================================
   아이마을 (AiMaeul) — Brand Theme
   Palette source: aimaeul-flutter light_theme.dart / dark_theme.dart
   Primary #FF8C69 · Light bg #FFF9F5 · Dark bg #121212
   ============================================================ */

/* Design Tokens — Light (default) */
:root {
    color-scheme: light;

    /* Brand */
    --accent: #FF8C69;             /* app colorScheme.primary */
    --accent-hover: #E07050;
    --accent-text: #C14E2A;        /* darker coral for text/links on light bg */
    --accent-soft: #FFD6C0;        /* app colorScheme.secondary */
    --accent-tint: #FFF0E8;        /* app input fillColor */
    --gradient-brand: linear-gradient(135deg, #FFB48A 0%, #FF8C69 55%, #FF6B6B 100%); /* app brandGradient */
    --gradient-hero: linear-gradient(135deg, #FFF5F0 0%, #FFE8DF 100%);

    /* Surfaces */
    --bg: #FFF9F5;                 /* app scaffoldBackgroundColor */
    --surface: #FFFFFF;            /* app surface */
    --card: #FFF9F5;
    --border: #F3E9E2;
    --border-strong: #FFD6C0;

    /* Text */
    --text: #1F2937;               /* app onSurface */
    --text-2: #4B5563;
    --text-3: #6B7280;
    --text-faint: #9CA3AF;

    /* Misc */
    --error: #EF4444;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --nav-bg-solid: rgba(255, 255, 255, 0.98);
    --shadow-sm: 0 2px 10px rgba(31, 41, 55, 0.08);
    --shadow-md: 0 10px 30px rgba(31, 41, 55, 0.10);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.25);
    --img-ring: rgba(31, 41, 55, 0.06);
    --footer-bg: #1F2937;
    --footer-border: #374151;
    --footer-text: #D1D5DB;
    --footer-muted: #9CA3AF;

    /* Theme toggle icons */
    --icon-moon: inline-block;
    --icon-sun: none;
}

/* Design Tokens — Dark (system preference, unless user forced light) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --accent: #FF8C69;
        --accent-hover: #FFA98C;
        --accent-text: #FF9E80;
        --accent-soft: rgba(255, 140, 105, 0.18);
        --accent-tint: rgba(255, 140, 105, 0.10);
        --gradient-brand: linear-gradient(135deg, #A6755A 0%, #A65B44 55%, #A64646 100%); /* app brandGradientDark */
        --gradient-hero: linear-gradient(135deg, #181210 0%, #221611 100%);

        --bg: #121212;             /* app dark scaffoldBackgroundColor */
        --surface: #1E1E1E;        /* app dark surface */
        --card: #262626;
        --border: #2A2A2A;         /* app dark divider */
        --border-strong: #3A3A3A;

        --text: #F9FAFB;           /* app dark onSurface */
        --text-2: #D1D5DB;
        --text-3: #9CA3AF;
        --text-faint: #6B7280;

        --error: #EF4444;
        --nav-bg: rgba(18, 18, 18, 0.88);
        --nav-bg-solid: rgba(18, 18, 18, 0.97);
        --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
        --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
        --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
        --img-ring: rgba(255, 255, 255, 0.12);
        --footer-bg: #161616;
        --footer-border: #2A2A2A;
        --footer-text: #D1D5DB;
        --footer-muted: #9CA3AF;

        --icon-moon: none;
        --icon-sun: inline-block;
    }
}

/* Design Tokens — Dark (manual toggle) */
:root[data-theme="dark"] {
    color-scheme: dark;

    --accent: #FF8C69;
    --accent-hover: #FFA98C;
    --accent-text: #FF9E80;
    --accent-soft: rgba(255, 140, 105, 0.18);
    --accent-tint: rgba(255, 140, 105, 0.10);
    --gradient-brand: linear-gradient(135deg, #A6755A 0%, #A65B44 55%, #A64646 100%); /* app brandGradientDark */
    --gradient-hero: linear-gradient(135deg, #181210 0%, #221611 100%);

    --bg: #121212;
    --surface: #1E1E1E;
    --card: #262626;
    --border: #2A2A2A;
    --border-strong: #3A3A3A;

    --text: #F9FAFB;
    --text-2: #D1D5DB;
    --text-3: #9CA3AF;
    --text-faint: #6B7280;

    --error: #EF4444;
    --nav-bg: rgba(18, 18, 18, 0.88);
    --nav-bg-solid: rgba(18, 18, 18, 0.97);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
    --img-ring: rgba(255, 255, 255, 0.12);
    --footer-bg: #161616;
    --footer-border: #2A2A2A;
    --footer-text: #D1D5DB;
    --footer-muted: #9CA3AF;

    --icon-moon: none;
    --icon-sun: inline-block;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text-2);
    background: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
    background: var(--nav-bg-solid);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-logo img {
    box-shadow: 0 0 0 1px var(--img-ring);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin-left: auto;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-2);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-3);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--border-strong);
    background: var(--accent-tint);
}

.theme-toggle .fa-moon {
    display: var(--icon-moon);
}

.theme-toggle .fa-sun {
    display: var(--icon-sun);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-2);
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-hero);
    padding-top: 80px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-3);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 140, 105, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--accent-text);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Phone Mockup */
.phone-mockup {
    position: relative;
    width: 300px;
    height: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 40px;
    padding: 20px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--img-ring);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--surface);
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-preview {
    text-align: center;
    padding: 2rem;
}

.preview-icon {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.preview-icon img {
    box-shadow: 0 0 0 1px var(--img-ring);
}

.preview-text h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.preview-text p {
    color: var(--text-3);
    font-size: 1rem;
}

.check-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: #ffffff;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section Headings */
.features h2,
.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
    color: var(--text);
}

.features h2::after,
.how-it-works h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
    margin: 1rem auto 0;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: var(--surface);
    transition: background-color 0.25s ease;
}

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

.feature-card {
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.feature-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-3);
    line-height: 1.8;
}

/* How It Works Section */
.how-it-works {
    padding: 6rem 0;
    background: var(--bg);
    transition: background-color 0.25s ease;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 6px 16px rgba(255, 140, 105, 0.3);
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.step-content p {
    color: var(--text-3);
    line-height: 1.8;
}

/* Download Section */
.download {
    padding: 6rem 0;
    background: var(--gradient-brand);
    color: #ffffff;
    text-align: center;
}

.download h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.download > .container > p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.92;
}

.download-options {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 3rem;
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.25s ease;
    min-width: 250px;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.download-card i {
    font-size: 3rem;
    color: var(--accent);
}

.download-text {
    text-align: left;
}

.download-text h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.download-text p {
    color: var(--text-3);
    font-size: 0.9rem;
}

.coming-soon {
    position: relative;
    opacity: 0.75;
    cursor: not-allowed;
}

.coming-soon::after {
    content: 'Coming Soon';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--error);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Document Content (Privacy, Terms) */
.doc-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 60px;
}

.doc-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.doc-content h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.doc-content p {
    color: var(--text-2);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.doc-content strong {
    color: var(--text);
}

.doc-content ul {
    margin: 1rem 0 1rem 2rem;
    color: var(--text-2);
}

.doc-content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent-hover);
}

/* FAQ Content */
.faq-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 60px;
}

.faq-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 2rem;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

.faq-item h3 {
    font-size: 1.2rem;
    color: var(--accent-text);
    margin-bottom: 0.8rem;
}

.faq-item p {
    color: var(--text-2);
    line-height: 1.8;
}

.faq-item strong {
    color: var(--text);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--footer-border);
    transition: background-color 0.25s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent);
}

.footer-section p {
    color: var(--footer-text);
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--footer-border);
    color: var(--footer-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--surface);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--border);
        padding: 2rem 0;
        margin-left: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-actions {
        margin-left: auto;
    }

    .hamburger {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .phone-mockup {
        width: 250px;
        height: 500px;
    }

    .features-grid,
    .steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .download-card {
        min-width: auto;
        width: 100%;
    }
}
