:root {
    /* Modern Color Palette */
    --bg-color: #f5f5f7;
    --surface-color: rgba(255, 255, 255, 0.8);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --brand-color: #0071e3;
    --brand-hover: #0077ed;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius-lg: 20px;
    --radius-md: 16px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --surface-color: rgba(28, 28, 30, 0.8);
        --text-primary: #f5f5f7;
        --text-secondary: #86868b;
        --brand-color: #2997ff;
        --brand-hover: #47a3ff;
        --card-bg: rgba(28, 28, 30, 0.6);
        --card-border: rgba(255, 255, 255, 0.1);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
    }
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-image:
        radial-gradient(at 0% 0%, rgba(var(--brand-color), 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(var(--brand-color), 0.03) 0px, transparent 50%);
}

.container {
    width: 100%;
    max-width: 800px;
    margin-top: clamp(10px, 4vh, 20px);
    padding: 0 20px;
}

/* Home page specific container override if needed, but keeping consistent for now as per user request */
/* If index.html needs more space, we can add a specific class to it */

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease-out;
}

/* Index page header margin override */
body.home header {
    margin-bottom: 60px;
}

/* Index page container margin override */
body.home .container {
    margin-top: clamp(40px, 8vh, 80px);
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Index page h1 override */
body.home h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem); /* Unified size */
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 32px; /* Unified margin */
}

/* Index page subtitle margin override */
body.home .subtitle {
    margin-bottom: 0; /* Reset margin for home as it's handled by header margin-bottom */
}


.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

/* App Page Specifics */
.app-hero {
    text-align: center;
    margin-bottom: 60px;
    animation: slideUp 0.6s ease-out backwards;
}

.app-icon-large {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.download-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.download-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    fill: currentColor;
}

.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
    animation: slideUp 0.6s ease-out 0.2s backwards;
}

.screenshot-placeholder {
    aspect-ratio: 9/19.5;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.screenshot-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.description {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    margin-bottom: 40px;
    animation: slideUp 0.6s ease-out 0.3s backwards;
}

.description h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.description p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.description ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.description li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.description li::before {
    content: "•";
    color: var(--brand-color);
    position: absolute;
    left: 8px;
    font-weight: bold;
}

/* Index Page Specifics */
.apps-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.app-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out backwards;
}

/* Staggered animation delays */
.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

.app-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
    background: var(--surface-color);
    border-color: rgba(var(--brand-color), 0.2);
}

.app-card:active {
    transform: translateY(-2px) scale(0.99);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-name::after {
    content: "→";
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    color: var(--brand-color);
    font-weight: 700;
}

.app-card:hover .app-name::after {
    opacity: 1;
    transform: translateX(0);
}

.app-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 40px 0;
    border-top: 1px solid var(--card-border);
    width: 100%;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

.contact a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-secondary);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.contact a:hover {
    color: var(--brand-color);
    border-color: var(--brand-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 600px) {
    .container {
        margin-top: 40px; /* Fallback or specific mobile override if needed */
    }
    
    /* Index specific mobile override */
    body.home .container {
        margin-top: 40px;
    }

    h1 {
        font-size: 2rem;
    }

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