/* --- CSS Custom Properties (Tokens) --- */
:root[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --google-play: #00a173;
    --ms-store: #0067b8;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] {
    --bg-base: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.6);
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --google-play: #00e6a4;
    --ms-store: #3b82f6;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* --- Base Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-base);
    transition: background-color 0.4s ease, color 0.4s ease;
}

body {
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

/* --- Layout Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.mt-12 { margin-top: 3rem; }

/* --- Navigation Bar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
}
.logo-link:hover { color: inherit; }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 2rem;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    display: none;
}
@media (min-width: 640px) {
    .brand-name { display: block; }
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1.5rem;
    margin-right: auto;
}
@media (min-width: 860px) {
    .nav-links { display: flex; }
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.nav-links a:hover {
    color: var(--primary);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn, .lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icon-btn {
    width: 40px;
    height: 40px;
}

.icon-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.sun-icon, .moon-icon {
    width: 20px;
    height: 20px;
}

:root[data-theme="light"] .sun-icon { display: none; }
:root[data-theme="dark"] .moon-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: block; }

.lang-btn {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--border-color);
    color: var(--text-main);
}
.lang-btn:hover {
    background: var(--primary);
    color: white;
}

/* --- Hero Section --- */
.hero {
    margin-top: 70px;
    padding: 6rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45vh;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero .highlight {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: white !important;
    padding: 0.875rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 10px 20px -10px var(--primary);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--primary);
}

/* Hero Background Shapes */
.hero-bg-shapes {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    z-index: -1;
}

.shape-1 {
    top: -10%; left: -10%;
    width: 600px; height: 600px;
    background: rgba(59, 130, 246, 0.3);
}

.shape-2 {
    bottom: -20%; right: -10%;
    width: 500px; height: 500px;
    background: rgba(139, 92, 246, 0.2);
}

/* --- App Store Sections --- */
main {
    flex: 1;
    padding-bottom: 6rem;
}

.store-section {
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.store-icon {
    width: 28px;
    height: 28px;
}
.play-store-icon { color: var(--google-play); }
.ms-store-icon { color: var(--ms-store); }

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.developer-tag {
    margin-left: auto;
    background: var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- App Grid & Cards --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.app-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--google-play), #3b82f6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ms-link ~ .app-meta .win-tag {
    color: var(--ms-store);
}
.app-card:has(.ms-link)::before {
    background: linear-gradient(90deg, #00a4ef, var(--ms-store));
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.app-card:hover::before { opacity: 1; }

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.app-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.app-meta {
    margin-bottom: 1.5rem;
    width: 100%;
}

.meta-tag {
    display: inline-block;
    font-family: monospace;
    font-size: 0.75rem;
    background: var(--border-color);
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.detail-link {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
.detail-link:hover {
    background: var(--border-color);
    color: var(--primary);
}

.download-link {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(0, 161, 115, 0.1);
    color: var(--google-play) !important;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.download-link:hover {
    background: var(--google-play);
    color: white !important;
}

.download-link.ms-link {
    background: rgba(0, 103, 184, 0.1);
    color: var(--ms-store) !important;
}

.download-link.ms-link:hover {
    background: var(--ms-store);
    color: white !important;
}

/* --- AdSense Container --- */
.ad-container {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--border-color);
    border-radius: 12px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Blog Page --- */
.blog-header {
    text-align: center;
    margin-bottom: 4rem;
}
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}
.blog-post {
    padding: 2rem;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}
.blog-post:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.blog-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
}
.blog-post h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.blog-excerpt {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* --- App Detail Page --- */
.app-detail-header {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    margin-bottom: 4rem;
    padding: 3rem;
    background: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--border-color);
}
.detail-icon {
    width: 160px;
    height: 160px;
    border-radius: 36px;
    box-shadow: var(--card-shadow);
    flex-shrink: 0;
}
.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.detail-info .app-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
}
.screenshots-wrapper {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}
.screenshot {
    height: 400px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 500;
}
.back-btn:hover {
    color: var(--primary);
}

/* --- Document Content & Footer --- */
.document-page {
    margin-top: 100px;
    max-width: 800px;
}

.document-page h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.last-updated {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 0.9rem;
}

.doc-content section {
    margin-bottom: 2.5rem;
}

.doc-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

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


/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    margin-top: auto;
    background: var(--bg-surface);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

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

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .hero { padding: 4rem 1rem; }
    .developer-tag { display: none; }
    .app-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
}
