@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #5a5df0;
    --primary-dark: #3d3fc7;
    --accent: #9fa9ff;
    --bg: #f3f4ff;
    --surface: #ffffff;
    --text: #1f2933;
    --muted: #5e6b7a;
    --border: rgba(90, 93, 240, 0.12);
    --shadow-soft: 0 24px 60px rgba(90, 93, 240, 0.12);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary: #7679ff;
    --primary-dark: #5a5df0;
    --accent: #a4aeff;
    --bg: #0a0a0a;
    --surface: #1a1a1a;
    --text: #e0e0e0;
    --muted: #a0a0a0;
    --border: rgba(118, 121, 255, 0.2);
    --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Dark mode specific adjustments */
[data-theme="dark"] .carousel-container {
    background: #1a1a1a;
}

[data-theme="dark"] .feature-card {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .carousel-btn {
    background: rgba(26, 26, 26, 0.9);
    color: var(--text);
}

[data-theme="dark"] .carousel-btn:hover {
    background: rgba(40, 40, 40, 1);
}

[data-theme="dark"] .store-button {
    background: var(--surface);
    border: 1px solid var(--border);
}

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

/* Accessibility Improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 8px 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Improved Focus States for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Remove default outlines for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-toggle-light,
.theme-toggle-dark {
    font-size: 1.5rem;
    transition: opacity 0.3s ease;
}

.theme-toggle-dark {
    position: absolute;
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-light {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-dark {
    opacity: 1;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.hero {
    text-align: center;
    padding: 3rem 2rem 3.5rem;
    /* Solid base prevents underlying content from showing through */
    background: linear-gradient(135deg, rgba(90, 93, 240, 0.14), rgba(194, 200, 255, 0.32)), #ffffff;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.75), transparent 58%),
                radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.6), transparent 60%);
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
}

.logo-emoji {
    font-size: 2rem;
}

.app-name {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.tagline {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.subtitle {
    font-size: 1.05rem;
    color: rgba(31, 41, 51, 0.85);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.hero-checklist {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.7rem auto 2rem;
    max-width: 600px;
}

.hero-checklist li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-dark);
    box-shadow: 0 12px 24px rgba(90, 93, 240, 0.12);
}

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

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: 1px solid transparent;
    /* Better touch targets for mobile */
    min-height: 48px;
    touch-action: manipulation;
}

.button.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 16px 36px rgba(90, 93, 240, 0.35);
}

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

.button.ghost {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-dark);
    border-color: rgba(90, 93, 240, 0.35);
}

.button.ghost:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
}

.button.large {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* Hero Download Buttons */
.hero-download-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0 2rem 0;
}

.hero-download-buttons .store-button {
    min-width: 140px;
    max-width: 180px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.hero-download-buttons .store-button .store-icon {
    width: 20px;
    height: 20px;
}

.hero-download-buttons .store-button .button-text .small {
    font-size: 0.65rem;
}

.hero-download-buttons .store-button .button-text .large {
    font-size: 0.9rem;
}

.hero-stats {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-stats li {
    min-width: 140px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 12px 28px rgba(90, 93, 240, 0.14);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.content {
    background: var(--surface);
    border-radius: 28px;
    padding: 3rem 2.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-soft);
}

.mockup-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

/* Screenshot Carousel */
.screenshot-carousel {
    position: relative;
    width: 100%;
    max-width: 400px;  /* Reduced from 800px */
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(31, 41, 51, 0.18);
    background: #000;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    flex: 0 0 100%;
    position: relative;
    margin: 0;
}

.carousel-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 350px;  /* Reduced from 600px */
    object-fit: contain;
}

.carousel-slide figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 1.5rem 1rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.carousel-slide:not(.active) {
    display: none;
}

.carousel-slide.active {
    display: block;
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    border: none;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Better touch targets */
    touch-action: manipulation;
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.carousel-btn-prev {
    left: 20px;
}

.carousel-btn-next {
    right: 20px;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 5px;
}

.carousel-dot:hover:not(.active) {
    background: var(--accent);
}

/* Screenshot Gallery Grid */
.screenshot-gallery {
    margin: 4rem 0;
    padding: 0 1rem;
}

.gallery-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text);
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));  /* Reduced from 200px */
    gap: 1rem;  /* Reduced from 1.5rem */
    max-width: 1000px;  /* Reduced from 1200px */
    margin: 0 auto;
}

.screenshot-item {
    position: relative;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(31, 41, 51, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
    cursor: pointer;
}

.screenshot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(31, 41, 51, 0.15);
}

.screenshot-item img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 250px;  /* Reduced from 400px */
    object-fit: cover;
    object-position: top;
}

.screenshot-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
    color: white;
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.screenshot-item:hover figcaption {
    transform: translateY(0);
}

/* Dark mode adjustments for gallery */
[data-theme="dark"] .screenshot-item {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .screenshot-item:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 90%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: white;
    margin-top: 1rem;
    font-size: 1rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
    }
}

.section-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 2.5rem;
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-dark);
    background: rgba(90, 93, 240, 0.12);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

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

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
}

.feature-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.9rem 1.6rem;
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(31, 41, 51, 0.08);
    text-align: left;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(31, 41, 51, 0.12);
}

.feature-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 1.9rem;
    margin-bottom: 1.1rem;
    background: rgba(90, 93, 240, 0.12);
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Removed unused classes: .app-info, .info-grid, .info-card, .keywords-list */

.highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin: 3rem 0;
    text-align: center;
}

.highlights-title {
    width: 100%;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.highlight-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(90, 93, 240, 0.08);
    color: var(--primary-dark);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.highlight-icon {
    font-size: 1.2rem;
}

.download {
    text-align: center;
    padding: 2.8rem 2rem 3rem;
    background: linear-gradient(140deg, rgba(90, 93, 240, 0.16), rgba(159, 169, 255, 0.28));
    border-radius: 28px;
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.download-subtitle {
    font-size: 0.95rem;
    color: rgba(31, 41, 51, 0.78);
    margin: 0.7rem auto 2.2rem;
    max-width: 420px;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.store-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.6rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 15px 32px rgba(26, 33, 76, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px rgba(26, 33, 76, 0.28);
}

.app-store {
    background: #101524;
}

.onestore {
    background: linear-gradient(135deg, #5865F2, #7289DA);
}

.store-icon {
    width: 28px;
    height: 28px;
}

.button-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 0.85rem;
}

.button-text .large {
    font-size: 1.08rem;
}

.footer {
    text-align: center;
    padding: 2.5rem 0 0;
    color: var(--muted);
}

.footer p {
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary-dark);
    background: rgba(90, 93, 240, 0.12);
    padding: 0.55rem 1.1rem;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.github-link:hover {
    background: rgba(90, 93, 240, 0.2);
}

@media (max-width: 900px) {
    .content {
        padding: 2.5rem 2rem;
    }

}

@media (max-width: 720px) {
    .container {
        padding: 2rem 1.2rem 3rem;
    }

    /* Screenshot gallery responsive */
    .screenshot-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));  /* Further reduced for tablets */
        gap: 0.8rem;
    }

    .gallery-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .hero {
        padding: 2.5rem 1.5rem 3rem;
    }

    .content {
        padding: 2.2rem 1.5rem;
    }

    .hero-checklist {
        margin: 1.2rem auto 1.6rem;
    }


    .feature-grid {
        gap: 1.2rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .app-info {
        padding: 2.2rem 1.6rem;
    }
}

@media (max-width: 540px) {
    /* Improve tap targets and spacing for mobile */
    .hero-stats {
        flex-direction: column;
        gap: 0.9rem;
    }

    /* Larger tap targets for mobile */
    .button {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .carousel-dot {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }

    .carousel-dot.active {
        width: 32px;
    }

    /* Screenshot gallery on mobile */
    .screenshot-gallery {
        margin: 2.5rem 0;
        padding: 0;
    }

    .screenshot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .screenshot-item figcaption {
        font-size: 0.8rem;
        padding: 0.75rem;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    }

    .hero-stats li {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-download-buttons {
        gap: 0.5rem;
    }

    .hero-download-buttons .store-button {
        min-width: 120px;
        max-width: 150px;
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
    }

    .hero-download-buttons .store-button .store-icon {
        width: 18px;
        height: 18px;
    }

    .hero-download-buttons .store-button .button-text .small {
        font-size: 0.6rem;
    }

    .hero-download-buttons .store-button .button-text .large {
        font-size: 0.85rem;
    }


    .hero-checklist {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-checklist li {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

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

    .store-button {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        min-height: 56px;
    }


    /* Carousel responsive adjustments */
    .screenshot-carousel {
        max-width: 100%;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .carousel-btn-prev {
        left: 10px;
    }

    .carousel-btn-next {
        right: 10px;
    }

    .carousel-slide figcaption {
        font-size: 0.8rem;
        padding: 1rem 0.8rem 0.8rem;
    }
}
