/* ==========================================================================
   TunerKit / 기타핏 — brand theme
   Palette source: guitar-tuner-flutter (light_theme.dart / dark_theme.dart)
   Brand primary: #E65100 (deep orange) · splash gradient FF8A3D→E65100→B23C00
   Theming: CSS variables + prefers-color-scheme + [data-theme] manual toggle
   ========================================================================== */

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

/* ---------- Light theme (default) ---------- */
:root {
    color-scheme: light;

    /* brand */
    --primary: #e65100;
    --primary-strong: #b23c00;
    --primary-soft: #ff8a3d;
    --accent: #ff6d00;
    --amber: #ffab00;

    /* brand gradient (app splash) */
    --grad-a: #ff8a3d;
    --grad-b: #e65100;
    --grad-c: #b23c00;

    /* surfaces */
    --bg: #fff8f0;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-alt: #fff8f0;

    /* text */
    --text: #1f2937;
    --text-mid: #374151;
    --text-body: #4b5563;
    --text-muted: #6b7280;

    /* lines */
    --border: #ffe0c2;
    --divider: #ffcc80;

    /* nav */
    --nav-bg: rgba(255, 248, 240, 0.92);
    --nav-bg-solid: rgba(255, 248, 240, 0.98);
    --nav-shadow: 0 2px 10px rgba(178, 60, 0, 0.1);

    /* components */
    --btn-bg: #e65100;
    --btn-bg-hover: #b23c00;
    --btn-fg: #ffffff;
    --hero-btn-bg: #ffffff;
    --hero-btn-fg: #b23c00;
    --hero-btn-hover: #fff3e6;
    --card-shadow: 0 4px 6px rgba(31, 41, 55, 0.05);
    --card-shadow-hover: 0 10px 25px rgba(178, 60, 0, 0.12);
    --badge-bg: #ffab00;
    --badge-fg: #3d2200;
    --img-ring: rgba(230, 81, 0, 0.15);

    /* footer */
    --footer-bg: #1f2937;
    --footer-text: #d1d5db;
    --footer-muted: #9ca3af;
    --footer-border: #374151;

    /* theme toggle icon visibility */
    --toggle-moon: inline-block;
    --toggle-sun: none;
}

/* ---------- Dark theme via system preference ---------- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --primary: #ff6d00;
        --primary-strong: #ff8a3d;
        --primary-soft: #ffab00;
        --accent: #ffab00;
        --amber: #ffab00;

        --grad-a: #b23c00;
        --grad-b: #8a2e00;
        --grad-c: #5c1f00;

        --bg: #111827;
        --bg-alt: #161f2e;
        --surface: #1f2937;
        --surface-alt: #26303f;

        --text: #f9fafb;
        --text-mid: #e5e7eb;
        --text-body: #d1d5db;
        --text-muted: #9ca3af;

        --border: #374151;
        --divider: #374151;

        --nav-bg: rgba(17, 24, 39, 0.9);
        --nav-bg-solid: rgba(17, 24, 39, 0.97);
        --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

        --btn-bg: #b23c00;
        --btn-bg-hover: #e65100;
        --btn-fg: #ffffff;
        --hero-btn-bg: #f9fafb;
        --hero-btn-fg: #b23c00;
        --hero-btn-hover: #ffe8d6;
        --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
        --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.4);
        --badge-bg: #ffab00;
        --badge-fg: #3d2200;
        --img-ring: rgba(255, 109, 0, 0.35);

        --footer-bg: #0b1220;
        --footer-text: #d1d5db;
        --footer-muted: #9ca3af;
        --footer-border: #374151;

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

/* ---------- Dark theme via manual toggle ---------- */
:root[data-theme="dark"] {
    color-scheme: dark;

    --primary: #ff6d00;
    --primary-strong: #ff8a3d;
    --primary-soft: #ffab00;
    --accent: #ffab00;
    --amber: #ffab00;

    --grad-a: #b23c00;
    --grad-b: #8a2e00;
    --grad-c: #5c1f00;

    --bg: #111827;
    --bg-alt: #161f2e;
    --surface: #1f2937;
    --surface-alt: #26303f;

    --text: #f9fafb;
    --text-mid: #e5e7eb;
    --text-body: #d1d5db;
    --text-muted: #9ca3af;

    --border: #374151;
    --divider: #374151;

    --nav-bg: rgba(17, 24, 39, 0.9);
    --nav-bg-solid: rgba(17, 24, 39, 0.97);
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

    --btn-bg: #b23c00;
    --btn-bg-hover: #e65100;
    --btn-fg: #ffffff;
    --hero-btn-bg: #f9fafb;
    --hero-btn-fg: #b23c00;
    --hero-btn-hover: #ffe8d6;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.4);
    --badge-bg: #ffab00;
    --badge-fg: #3d2200;
    --img-ring: rgba(255, 109, 0, 0.35);

    --footer-bg: #0b1220;
    --footer-text: #d1d5db;
    --footer-muted: #9ca3af;
    --footer-border: #374151;

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

html {
    -webkit-text-size-adjust: 100%;
}

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

::selection {
    background: var(--primary);
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid var(--primary);
    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;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

.nav-logo .logo-icon {
    margin-right: 0.5rem;
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
}

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

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

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

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

.lang-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.lang-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Theme toggle (dark / light) */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-mid);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

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

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

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

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

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--nav-shadow);
    gap: 0;
}

.nav-menu.active li {
    padding: 0.75rem 20px;
    border-bottom: 1px solid var(--border);
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 55%, var(--grad-c) 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.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: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(92, 31, 0, 0.25);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(92, 31, 0, 0.25);
}

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

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

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background: var(--hero-btn-bg);
    color: var(--hero-btn-fg);
}

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

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-secondary:hover {
    background: #ffffff;
    color: var(--hero-btn-fg);
}

/* Phone Mockup */
.phone-mockup {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-screen {
    width: 280px;
    height: 560px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.app-preview {
    background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 55%, var(--grad-c) 100%);
    height: 100%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    color: #ffffff;
}

.preview-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.preview-icon img {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2);
    border-radius: 22%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.preview-text {
    text-align: center;
    margin-bottom: 20px;
}

.preview-text h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.preview-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.tuner-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--bg);
    transition: background-color 0.3s ease;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

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

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

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

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 60%, var(--grad-c) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: #ffffff;
}

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

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

/* Download Section */
.download {
    padding: 80px 0;
    background: var(--bg-alt);
    transition: background-color 0.3s ease;
}

.download h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.download > .container > p {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

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

.download-card {
    display: flex;
    align-items: center;
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: var(--surface-alt);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    min-width: 250px;
}

.download-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.download-card.coming-soon {
    opacity: 0.65;
    cursor: not-allowed;
    position: relative;
}

.download-card.coming-soon::after {
    content: attr(data-label);
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--badge-bg);
    color: var(--badge-fg);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.download-card i {
    font-size: 3rem;
    margin-right: 1rem;
    color: var(--primary);
}

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

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

/* About Section */
.about {
    padding: 80px 0;
    background: var(--bg);
    transition: background-color 0.3s ease;
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.about-content {
    display: flex;
    justify-content: center;
    align-items: start;
}

.about-text {
    max-width: 800px;
    width: 100%;
}

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

.about-text p {
    margin-bottom: 2rem;
    color: var(--text-body);
    line-height: 1.8;
}

.about-text ul {
    list-style: none;
    margin-bottom: 2rem;
}

.about-text li {
    padding: 0.75rem 0;
    color: var(--text-body);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: start;
}

.about-text li::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.about-text li:last-child {
    border-bottom: none;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: #ffffff;
    padding: 60px 0 20px;
    transition: background-color 0.3s ease;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ffffff;
}

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

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

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

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

.footer-section ul li a:hover {
    color: var(--primary-soft);
}

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

/* Doc pages (privacy, terms, faq) */
.doc-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 60px 20px;
    line-height: 1.8;
}

.doc-content h1 {
    color: var(--text);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.doc-content h2 {
    color: var(--text-mid);
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    font-size: 1.3rem;
}

.doc-content p {
    margin-bottom: 1rem;
    color: var(--text-body);
}

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

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

.doc-content ul li {
    margin-bottom: 0.4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.back-link:hover {
    background: var(--btn-bg-hover);
}

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

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

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

.faq-item h3 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg-solid);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--nav-shadow);
    }

    .nav-menu li {
        padding: 0.75rem 20px;
        border-bottom: 1px solid var(--border);
    }

    .hamburger {
        display: flex;
    }

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

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

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

    .about-content {
        flex-direction: column;
    }

    .download-options {
        flex-direction: column;
        align-items: center;
    }

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

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

    .hero-content p {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .phone-screen {
        width: 240px;
        height: 480px;
    }
}
