:root {
    --bg: #f5f2eb;
    --paper: #fffdf8;
    --ink: #1e1e1e;
    --muted: #595959;
    --line: #d9d1c5;
    --accent: #14532d;
    --accent-soft: #d7f1dd;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
    color: var(--ink);
    background: transparent;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 15%, #efe6d6 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, #e3f3e7 0%, transparent 35%),
        var(--bg);
}

.top-nav {
    width: min(980px, calc(100% - 2rem));
    margin: 1rem auto 0;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(30, 30, 30, 0.05);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.dropdown {
    position: relative;
}

.dropbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--line);
    background: #f4eee3;
    color: var(--ink);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.dropbtn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.dropbtn:active {
    opacity: 0.8;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 220px;
    max-width: min(280px, calc(100vw - 2rem));
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
    z-index: 20;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.dropdown.is-open .dropdown-menu,
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.page {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    flex: 1;
}

header {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(30, 30, 30, 0.06);
    animation: rise 500ms ease-out;
}

.hero {
    margin-bottom: 2.5rem;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: 0.03em;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

h3 {
    margin: 0;
    font-size: 1.12rem;
}

p {
    margin: 0.75rem 0 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f4eee3;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 200ms ease;
}

.back-button:hover,
.back-button:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.lead {
    margin: 0.8rem 0 0;
    max-width: 60ch;
    color: var(--muted);
}

.grid {
    margin-top: 1.25rem;
    display: grid;
    gap: 1rem;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(30, 30, 30, 0.04);
    animation: rise 550ms ease-out;
}

.section-title {
    display: inline-block;
    margin: 2rem 0 0.75rem;
    padding: 0.28rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f4eee3;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.support-item {
    margin-top: 0.9rem;
    padding: 0.8rem;
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft);
}

a {
    color: var(--accent);
    font-weight: 600;
}

.app-links {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f4eee3;
    text-decoration: none;
    font-size: 0.9rem;
}

.pill-link:hover,
.pill-link:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.pill-link:active {
    opacity: 0.8;
}

.muted {
    color: var(--muted);
}

.privacy-text {
    margin-top: 0.85rem;
}

.app-store-info {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f9f7f3;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-version,
.app-rating,
.app-release {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
}

.app-store-links {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-store-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 200ms ease;
}

.app-store-button:hover,
.app-store-button:focus-visible {
    background: #0d3a21;
    outline: none;
}

.app-store-button:active {
    opacity: 0.9;
}

.rating-count {
    color: var(--muted);
    font-size: 0.85rem;
}

.app-description {
    margin: 1rem 0 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-line;
}

footer {
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.94rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
}

.footer-content {
    padding: 1rem;
}

.contact-info a {
    color: var(--accent);
    text-decoration: none;
}

.contact-info a:hover,
.contact-info a:focus-visible {
    text-decoration: underline;
}

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

.app-store-error {
    background-color: #fee8e8 !important;
    border-color: #d9a5a5 !important;
}

.app-store-error p {
    margin: 0;
    color: #a14a4a;
    font-size: 0.9rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .top-nav {
        width: calc(100% - 1rem);
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .brand-link {
        justify-content: center;
    }

    .dropdown {
        width: 100%;
    }

    .dropbtn {
        width: 100%;
    }

    .dropdown-menu {
        left: 0;
        right: 0;
        top: calc(100% + 0.5rem);
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .page {
        padding: 1rem 0.75rem 2rem;
    }

    .card {
        padding: 1rem;
    }

    .grid {
        gap: 1.25rem;
    }

    .app-links {
        flex-direction: column;
    }

    .pill-link,
    .app-store-button {
        width: 100%;
        justify-content: center;
    }

    .app-store-info {
        gap: 0.75rem;
    }

    .app-icon {
        width: 72px;
        height: 72px;
    }
}

@media (min-width: 760px) {
    .grid.two {
        grid-template-columns: 1fr 1fr;
    }
}
