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

:root {
    --primary: #D4875A;
    --primary-deep: #9A5630;
    --primary-soft: #F4B893;
    --accent-mint: #A8D5BA;
    --accent-pink: #F4B8A9;
    --accent-sky: #B6D7E8;
    --text: #3E2723;
    --text-muted: #876347;
    --text-light: #7B6450;
    --bg: #FFF8F0;
    --surface: #FFFFFF;
    --surface-warm: #FDF4ED;
    --surface-sunset: #FBEADB;
    --border: #F0D9C3;
    --border-soft: #F7E6D4;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --shadow-soft: 0 4px 20px rgba(212, 135, 90, 0.08);
    --shadow-warm: 0 12px 32px rgba(212, 135, 90, 0.12);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(circle at 10% 0%, rgba(244, 184, 147, 0.25) 0%, transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(182, 215, 232, 0.2) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
}

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

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

/* Hero */
.hero {
    padding: 40px 24px 64px;
    position: relative;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 3rem;
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
}

.lang-switcher {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
}

.lang-switcher a {
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

.lang-switcher a:hover {
    background: var(--surface-sunset);
    color: var(--primary-deep);
}

.hero-badge-pill {
    background: var(--primary-deep);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-badge-pill:hover {
    color: #fff;
    background: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-warm);
}

.hero-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
    max-width: 1040px;
    margin: 0 auto;
}

.hero-icon {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    box-shadow: var(--shadow-warm);
    flex-shrink: 0;
}

.hero-text {
    min-width: 0;
}

.app-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 3.25rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-deep);
    margin-bottom: 1rem;
}

.description {
    font-size: 1.0625rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 680px;
}

.species-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1.75rem;
}

.species-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(212, 135, 90, 0.05);
}

.species-pill .emoji {
    margin-right: 4px;
}

/* Main */
main {
    padding: 16px 24px 64px;
}

section {
    margin-bottom: 72px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.85rem;
    color: var(--text);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

h2 .emoji {
    margin-right: 8px;
    font-size: 0.9em;
}

.section-lede {
    color: var(--text-muted);
    font-size: 1.0625rem;
    max-width: 520px;
    margin-bottom: 2rem;
}

/* Screenshot gallery — staggered, not uniform grid */
.screenshots {
    margin-top: 8px;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.shot {
    background: var(--surface-warm);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    aspect-ratio: 9 / 19;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}

.shot-caption {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 600;
}

.shot-item {
    display: flex;
    flex-direction: column;
}

/* Stagger on wider screens */
@media (min-width: 900px) {
    .shot-item:nth-child(even) {
        margin-top: 28px;
    }
}

/* Feature sections — non-uniform, cozy */
.feature-stack {
    display: grid;
    gap: 20px;
}

.feature-row {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: start;
}

.feature-row-emoji {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--surface-sunset);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    flex-shrink: 0;
}

.feature-row h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.feature-row ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-row li {
    padding: 0.35rem 0 0.35rem 1.5rem;
    position: relative;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.feature-row li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 8px;
    height: 8px;
    background: var(--primary-soft);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(244, 184, 147, 0.25);
}

/* Accent rows — alternating warm tones */
.feature-row--peach {
    background: var(--surface-warm);
}

.feature-row--peach .feature-row-emoji {
    background: #fff;
}

.feature-row--mint .feature-row-emoji {
    background: #E7F3EC;
}

.feature-row--sky .feature-row-emoji {
    background: #E5F0F7;
}

.feature-row--pink .feature-row-emoji {
    background: #FCE8E2;
}

/* Family sharing highlight */
.spotlight {
    background: linear-gradient(135deg, var(--primary) 0%, #E39C70 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-warm);
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.spotlight::after {
    content: "";
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.spotlight-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.spotlight h2 {
    color: #fff;
    font-size: 2rem;
}

.spotlight p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    line-height: 1.7;
}

.spotlight-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Stats strip */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

.stat-item {
    text-align: center;
}

.stat-item .num {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--primary-deep);
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-item .label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Download */
.download-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.download-card .app-icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    margin: 0 auto 1rem;
    display: block;
    box-shadow: var(--shadow-warm);
}

.download-card h3,
.download-card h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.download-card .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.coming-soon-badge {
    display: inline-block;
    background: var(--surface-sunset);
    border: 1px dashed var(--primary);
    color: var(--primary-deep);
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.download-requirements {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 1.25rem;
}

/* Support */
.support-card {
    background: var(--surface-warm);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
}

.support-card p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.support-card a {
    color: var(--primary-deep);
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: 80px;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-warm);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer p {
    margin: 0.25rem 0;
}

footer a {
    color: var(--text-muted);
}

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

/* Privacy page — centered hero variant */
.hero-inner--centered {
    grid-template-columns: 1fr;
    text-align: center;
}

.hero-inner--centered .hero-text {
    max-width: 720px;
    margin: 0 auto;
}

/* 404 / standalone centered content */
.error-content {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

.error-card {
    max-width: 520px;
    width: 100%;
}

.error-card .actions {
    margin-top: 1.5rem;
}

.error-card .actions a {
    display: inline-block;
    text-decoration: none;
}

.privacy-content {
    max-width: 820px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.privacy-content h1 {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--text);
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.privacy-content .last-updated {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.privacy-content h2 {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--primary-deep);
    font-size: 1.5rem;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.privacy-content h3 {
    color: var(--text);
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.privacy-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9625rem;
    line-height: 1.75;
}

.privacy-content ul, .privacy-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9625rem;
    line-height: 1.75;
}

.privacy-content li {
    margin-bottom: 0.5rem;
}

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

.privacy-content .contact-info {
    background: var(--surface-sunset);
    padding: 20px 24px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin: 1.5rem 0;
}

.privacy-content .contact-info p {
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--primary-deep);
    font-weight: 700;
}

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

.lang-switcher-inline {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 760px) {
    .hero {
        padding: 24px 24px 48px;
    }

    .hero-top {
        margin-bottom: 2rem;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .hero-icon {
        margin: 0 auto;
        width: 96px;
        height: 96px;
    }

    .description, .species-pills {
        max-width: none;
    }

    .species-pills {
        justify-content: center;
    }

    .app-name {
        font-size: 2.5rem;
    }

    section {
        margin-bottom: 56px;
    }

    h2 {
        font-size: 1.55rem;
    }

    .feature-row {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 16px;
    }

    .feature-row-emoji {
        width: 56px;
        height: 56px;
    }

    .screenshot-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }

    .stat-item {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .stat-item:last-child {
        border-bottom: none;
    }

    .spotlight {
        padding: 36px 24px;
    }

    .spotlight h2 {
        font-size: 1.55rem;
    }

    .download-card {
        padding: 32px 20px;
    }

    .privacy-content {
        padding: 28px 20px;
    }

    .privacy-content h1 {
        font-size: 1.85rem;
    }
}

@media (max-width: 460px) {
    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-name {
        font-size: 2.1rem;
    }
}

/* Dark mode — applied via .theme-dark class on <html> by js/theme.js.
   Default: system preference. User can override via the in-page toggle. */
:root.theme-dark {
    --text: #F0E5D8;
    --text-muted: #C8A988;
    --text-light: #A88B6D;
    --bg: #1A130E;
    --surface: #241B14;
    --surface-warm: #2A1F17;
    --surface-sunset: #3A2A1F;
    --border: #3A2A1F;
    --border-soft: #2F2218;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-warm: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.theme-dark body {
    background-image:
        radial-gradient(circle at 10% 0%, rgba(212, 135, 90, 0.10) 0%, transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(168, 213, 186, 0.05) 0%, transparent 40%);
}

/* On dark surfaces, --primary-deep is too dark for text — switch to a brighter warm tone. */
.theme-dark a,
.theme-dark .stat-item .num,
.theme-dark .support-card a,
.theme-dark .back-link,
.theme-dark .privacy-content h2,
.theme-dark .coming-soon-badge {
    color: #E89D6A;
}

.theme-dark a:hover,
.theme-dark .lang-switcher a:hover,
.theme-dark .back-link:hover {
    color: #F4B893;
}

/* Hero pill: keep white text by anchoring to dark backgrounds in both modes. */
.theme-dark .hero-badge-pill:hover {
    background: #6B3D1F;
}

/* Feature row accent emoji backgrounds — dark variants of the light tints. */
.theme-dark .feature-row--peach .feature-row-emoji { background: #2D1F15; }
.theme-dark .feature-row--mint .feature-row-emoji  { background: #1F2A22; }
.theme-dark .feature-row--sky .feature-row-emoji   { background: #1A2730; }
.theme-dark .feature-row--pink .feature-row-emoji  { background: #2A1A18; }

.theme-dark .privacy-content .contact-info {
    border-left-color: #E89D6A;
}

.theme-dark .coming-soon-badge {
    border-color: #E89D6A;
}

/* Theme toggle button — hidden until js/theme.js marks it ready, so no-JS users
   never see a non-functional control. */
.theme-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    align-items: center;
    justify-content: center;
}

.theme-toggle.theme-toggle--ready {
    display: inline-flex;
}

.theme-toggle:hover {
    background: var(--surface-sunset);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-deep);
    outline-offset: 3px;
    border-radius: 4px;
}

a:focus-visible,
.hero-badge-pill:focus-visible,
.species-pill:focus-visible {
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
