:root {
    --bg: #f7f9fb;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --text: #1d1d1f;
    --muted: #6b7280;
    --primary: #2b6cb0;
    --primary-hover: #1e4e8c;
    --accent: #ed8936;
    --border: #e5e7eb;
    --max-width: 720px;
    --max-width-wide: 1080px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d11;
        --bg-alt: #11151b;
        --surface: #161b22;
        --text: #e6e9ef;
        --muted: #9aa3b2;
        --primary: #6aa9e9;
        --primary-hover: #93c0f2;
        --accent: #f6ad55;
        --border: #232a33;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

/* ============================================================
   Inner (legal/support) pages — backward compat with the original
   ============================================================ */

body:not(.home) {
    padding: 24px 20px 80px;
}

body:not(.home) main {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--surface);
    padding: 32px 28px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body:not(.home) header {
    max-width: var(--max-width);
    margin: 0 auto 18px;
    padding: 4px 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

body:not(.home) header a { color: var(--muted); text-decoration: none; }
body:not(.home) header a:hover { color: var(--primary); }

body:not(.home) h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
body:not(.home) h2 { margin: 32px 0 10px; font-size: 20px; line-height: 1.3; font-weight: 600; }
body:not(.home) h3 { margin: 22px 0 6px; font-size: 17px; font-weight: 600; }
body:not(.home) p { margin: 0 0 14px; }
body:not(.home) ul, body:not(.home) ol { margin: 0 0 14px; padding-left: 22px; }
body:not(.home) li { margin-bottom: 6px; }
body:not(.home) hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
body:not(.home) .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

body:not(.home) footer {
    max-width: var(--max-width);
    margin: 24px auto 0;
    padding: 12px 4px;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

body:not(.home) footer a { color: var(--muted); }
body:not(.home) footer a:hover { color: var(--primary); }

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

@media (max-width: 480px) {
    body:not(.home) { padding: 16px 12px 60px; }
    body:not(.home) main { padding: 24px 20px; border-radius: 10px; }
    body:not(.home) h1 { font-size: 24px; }
}

/* ============================================================
   Home page
   ============================================================ */

.home { background: var(--bg); }

.topnav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .topnav { background: rgba(11, 13, 17, 0.85); }
}

.topnav-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
}

.brand:hover { color: var(--text); text-decoration: none; }
.brand-icon { border-radius: 7px; }

.topnav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 15px;
}

.topnav-links a { color: var(--muted); }
.topnav-links a:hover { color: var(--primary); text-decoration: none; }

.appstore-mini {
    background: var(--text);
    color: var(--bg) !important;
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
}

.appstore-mini:hover { color: var(--bg) !important; opacity: 0.85; }

/* Hero */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 64px 24px 56px;
    text-align: center;
}

.hero-icon {
    width: 120px;
    height: 120px;
    /* iOS uses a 22.37% squircle radius — clip the raw square icon's white corners */
    border-radius: 27px;
    box-shadow: 0 12px 32px rgba(43, 108, 176, 0.18), 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    background: #fff;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: 56px;
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.hero-tagline {
    margin: 0 auto 28px;
    max-width: 540px;
    font-size: 19px;
    line-height: 1.45;
    color: var(--muted);
}

.appstore-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--text);
    color: var(--bg);
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.appstore-button:hover {
    color: var(--bg);
    text-decoration: none;
    opacity: 0.9;
    transform: translateY(-1px);
}

.appstore-button-large {
    padding: 16px 32px;
    font-size: 18px;
}

.hero-meta {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* Section common */
.eyebrow {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 14px;
}

.eyebrow-left { text-align: left; }

.section-title {
    text-align: center;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
    color: var(--text);
}

.section-sub {
    text-align: center;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 36px;
}

/* Features */
.features {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 56px 24px;
}

.features .section-title { margin-bottom: 36px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 14px;
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.feature p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

/* Screenshots */
.screenshots {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.preview-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto 36px;
}

.preview-video {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(43, 108, 176, 0.08);
    background: #000;
}

@media (max-width: 480px) {
    .preview-video { max-width: 240px; border-radius: 26px; }
}

.screenshot-strip {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.screenshot-strip img {
    width: 100%;
    max-width: 230px;
    height: auto;
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

@media (max-width: 760px) {
    .screenshot-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 24px 18px;
        margin: 0 -24px;
        -webkit-overflow-scrolling: touch;
    }
    .screenshot-strip img {
        scroll-snap-align: center;
        flex: 0 0 auto;
        max-width: none;
        width: 200px;
    }
}

/* Watch section */
.watch-section {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 64px 24px;
}

.watch-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
}

.watch-copy {
    flex: 1;
}

.watch-copy h2 {
    margin: 0 0 14px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.watch-copy p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
    margin-bottom: 18px;
}

.watch-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.watch-bullets li {
    padding: 6px 0 6px 24px;
    position: relative;
    color: var(--text);
    font-size: 15px;
}

.watch-bullets li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.watch-shots {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.watch-shots img {
    width: 180px;
    height: auto;
    border-radius: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

@media (max-width: 760px) {
    .watch-inner { flex-direction: column; gap: 28px; }
    .watch-shots img { width: 150px; }
}

/* Pro section */
.pro-section {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 64px 24px;
}

.pro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
}

.plan {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.plan-pro {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    position: relative;
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan h3 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 600;
}

.plan ul {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.plan li {
    padding: 6px 0 6px 24px;
    position: relative;
    color: var(--text);
    font-size: 15px;
}

.plan li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.plan-price {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
}

/* Trust */
.trust {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 64px 24px;
}

.trust-inner {
    max-width: 720px;
    margin: 0 auto;
}

.trust .section-title { text-align: center; }

.trust-bullets {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
}

.trust-bullets li {
    padding: 14px 0 14px 28px;
    position: relative;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}

.trust-bullets li:last-child { border-bottom: none; }

.trust-bullets li::before {
    content: "🔒";
    position: absolute;
    left: 0;
    top: 14px;
}

.trust-bullets strong { color: var(--text); font-weight: 600; }

.trust-cta {
    text-align: center;
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 15px;
}

/* Download CTA */
.download-section {
    text-align: center;
    padding: 64px 24px;
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.download-meta {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* Footer */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 48px 24px 32px;
    color: var(--muted);
    font-size: 14px;
}

.site-footer-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

@media (max-width: 600px) {
    .site-footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

.site-footer-inner strong {
    display: block;
    color: var(--text);
    margin-bottom: 10px;
    font-size: 15px;
}

.site-footer-inner p {
    margin: 0;
    max-width: 320px;
    line-height: 1.5;
}

.site-footer-inner a {
    display: block;
    color: var(--muted);
    padding: 4px 0;
}

.site-footer-inner a:hover { color: var(--primary); text-decoration: none; }

.site-footer-meta {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 600px) {
    .hero { padding: 48px 20px 40px; }
    .hero h1 { font-size: 38px; }
    .hero-tagline { font-size: 17px; }
    .section-title { font-size: 26px; }
    .topnav-links { gap: 14px; font-size: 14px; }
    .topnav-links a:not(.appstore-mini) { display: none; }
}

/* ============================================================
   First-visit welcome burst (sheep + sparkles)
   ============================================================ */

#welcome-burst {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%,
        rgba(43, 108, 176, 0.18) 0%,
        rgba(159, 122, 234, 0.10) 30%,
        rgba(255, 255, 255, 0.85) 60%,
        rgba(255, 255, 255, 1) 100%);
    transition: opacity 0.7s ease;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    #welcome-burst {
        background: radial-gradient(circle at 50% 50%,
            rgba(106, 169, 233, 0.22) 0%,
            rgba(159, 122, 234, 0.12) 30%,
            rgba(11, 13, 17, 0.85) 60%,
            rgba(11, 13, 17, 1) 100%);
    }
}

#welcome-burst.fade { opacity: 0; }

#welcome-burst .particle {
    position: absolute;
    left: 50%;
    top: 50%;
    will-change: transform, opacity;
    user-select: none;
    pointer-events: none;
    animation: sheepBurst 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

@keyframes sheepBurst {
    0%   { transform: translate(-50%, -50%) rotate(0deg) scale(0); opacity: 0; }
    15%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1); opacity: 0; }
}

#welcome-burst .welcome-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    animation: welcomeTitle 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#welcome-burst .welcome-title strong {
    display: block;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

#welcome-burst .welcome-title span {
    display: block;
    margin-top: 8px;
    font-size: 16px;
    color: var(--muted);
    font-weight: 500;
}

@keyframes welcomeTitle {
    0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    50%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@media (max-width: 480px) {
    #welcome-burst .welcome-title strong { font-size: 28px; }
    #welcome-burst .welcome-title span { font-size: 14px; }
}
