/* ========================================
   WanderHUB Tech — Design System
   ======================================== */

/* --- Custom Properties --- */
:root {
    /* Brand */
    --color-red: #EB002F;
    --color-red-80: #EF3359;
    --color-red-60: #F36683;
    --color-red-40: #F799AD;
    --color-red-20: #FBCCD6;
    --color-black: #1A1A1A;
    --color-black-80: #484848;
    --color-black-60: #484848;
    --color-black-40: #A5A5A5;
    --color-black-20: #D2D2D2;
    --color-white: #FFFFFF;

    /* UI */
    --primary: var(--color-red);
    --primary-hover: #C50028;
    --primary-light: var(--color-red-20);
    --primary-ring: var(--color-red-40);
    --secondary: var(--color-black-80);
    --secondary-hover: var(--color-black);
    --success: #10B981;
    --warning: #F59E0B;
    --error: var(--color-red);
    --info: #3B82F6;
    --bg: var(--color-white);
    --surface: #F5F5F5;
    --border: var(--color-black-20);
    --text-primary: var(--color-black);
    --text-secondary: var(--color-black-60);
    --text-muted: var(--color-black-40);

    /* Fonts */
    --font-heading: 'Montserrat', system-ui, sans-serif;
    --font-body: 'Montserrat', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Layout */
    --max-width: 1200px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --bg: #121212;
    --surface: #1E1E1E;
    --border: #333333;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #999999;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.text-red {
    color: var(--primary);
}

/* --- Icon --- */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    height: 2rem;
    width: auto;
}

.logo-tech {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .logo-tech {
    background: rgba(235, 0, 47, 0.15);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Theme Toggle */
.lang-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

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

.icon-moon { display: none; }

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

/* ========================================
   Hero
   ======================================== */
.hero {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 100%);
    overflow: hidden;
}

.hero-layout {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.hero-content {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    text-align: left;
}

[data-theme="dark"] .hero-content {
    background: rgba(30, 30, 30, 0.92);
}

.hero-ascii {
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ascii-img {
    max-height: 320px;
    width: auto;
    border-radius: var(--radius-lg);
}


.ascii-caption {
    margin-top: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--color-black);
    opacity: 0.9;
    text-align: left;
    font-style: normal;
    max-width: 320px;
}

[data-theme="dark"] .ascii-caption {
    color: var(--text-primary);
}

.hero-content h1 {
    margin-bottom: var(--spacing-sm);
}

.hero-content h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.hero-content p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 0 var(--spacing-lg);
}

.author {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.author-signature {
    height: 60px;
    width: auto;
    margin-bottom: -0.25rem;
}

[data-theme="dark"] .author-signature {
    filter: invert(1) brightness(2);
}

/* ========================================
   Main / Apps Grid
   ======================================== */
.main {
    flex: 1;
    padding: var(--spacing-2xl) 0;
}

.section-title {
    margin-bottom: var(--spacing-xl);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

/* App Card */
.app-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.app-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.app-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(235, 0, 47, 0.3);
}

.app-card-icon .material-icons-outlined {
    font-size: 1.75rem;
}

[data-theme="dark"] .app-card-icon {
    color: rgba(255, 255, 255, 0.3);
}

.app-card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.app-card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.app-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
    display: none;
}

.empty-state.visible {
    display: block;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-logo {
    height: 1.5rem;
    width: auto;
}

.footer-links a {
    font-size: 0.875rem;
}

.footer-copy small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .hero {
        padding: var(--spacing-xl) 0;
    }

    .hero-content {
        padding: var(--spacing-lg);
    }

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

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

    .hero-ascii {
        width: 100%;
        overflow-x: auto;
    }

    .ascii-art {
        font-size: 0.35rem;
    }

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

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-ascii {
        display: none;
    }
}
