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

/* Theme variables */
:root {
    --background: #ffffff;
    --foreground: #1c1c1e;
    --secondary: #6e6e73;
    --accent: #34C759;
    --border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    --background: #000000;
    --foreground: #f2f2f7;
    --secondary: #aeaeb2;
    --accent: #30d158;
    --border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #000000;
        --foreground: #f2f2f7;
        --secondary: #aeaeb2;
        --accent: #30d158;
        --border: rgba(255, 255, 255, 0.1);
        --nav-bg: rgba(0, 0, 0, 0.8);
    }
}

/* Base */
html {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--background);
    color: var(--foreground);
    font-size: 16px;
    line-height: 1.5;
}

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

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

a:hover {
    text-decoration: underline;
}

/* Nav */
nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-brand img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.nav-brand span {
    font-size: 17px;
    font-weight: 600;
    color: var(--foreground);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--secondary);
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        opacity: 0;
        transform: rotate(90deg);
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        opacity: 1;
        transform: rotate(0deg);
    }
}

/* Main */
main {
    flex: 1;
}

/* Landing page */
.hero {
    text-align: center;
    padding: 80px 24px 48px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.hero h1 {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero p {
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 32px;
}

.features {
    font-size: 15px;
    color: var(--secondary);
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.features .dot {
    color: var(--accent);
}

.app-store-badge {
    display: inline-block;
}

.app-store-badge img {
    height: 44px;
    width: auto;
}

/* Prose pages */
.prose-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.prose-wrap h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.prose-wrap .updated {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 40px;
}

.prose-wrap h2 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 10px;
}

.prose-wrap p {
    font-size: 16px;
    color: var(--secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

.prose-wrap a {
    color: var(--accent);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

footer a {
    color: var(--secondary);
}

footer a:hover {
    color: var(--foreground);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 56px 20px 40px;
    }

    .hero-icon {
        width: 96px;
        height: 96px;
        border-radius: 21px;
    }

    .prose-wrap {
        padding: 40px 20px 60px;
    }
}
