/* ---------- BarnHub design tokens ---------- */
:root {
    --bg: #faf8f2;
    --hero-start: #f4efe0;
    --hero-mid: #e4d9b8;
    --hero-end: #c9b88a;
    --brand: #2d5016;
    --brand-dark: #1f3a0e;
    --brand-mid: #3a6b1e;
    --brand-light: #5a8a3a;
    --accent: #a87c4f;
    --ink: #2a2418;
    --ink-soft: #4a4233;
    --muted: #7a7260;
    --card-bg: #ffffff;
    --card-border: #e8e0cc;
    --cta-bg: #111;
    --cta-ink: #fff;
    --banner-bg: rgba(255, 253, 247, 0.92);
    --banner-border: rgba(45, 80, 22, 0.2);
    --badge-bg: rgba(255, 255, 255, 0.6);
    --badge-border: rgba(45, 80, 22, 0.3);
    --tint-bg: rgba(45, 80, 22, 0.10);
    --check: #2d5016;
    --dash: #a89f88;
    --planned: #b8801f;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14130d;
        --hero-start: #1e1d14;
        --hero-mid: #2a2818;
        --hero-end: #3a361f;
        --brand: #a4c975;
        --brand-dark: #8ab058;
        --brand-mid: #7a9d48;
        --brand-light: #c4dd94;
        --ink: #f0ebd8;
        --ink-soft: #d4ceb8;
        --muted: #a89f88;
        --card-bg: #1f1d13;
        --card-border: #3a361f;
        --cta-bg: #f0ebd8;
        --cta-ink: #14130d;
        --banner-bg: rgba(20, 19, 13, 0.92);
        --banner-border: rgba(164, 201, 117, 0.3);
        --badge-bg: rgba(0, 0, 0, 0.35);
        --badge-border: rgba(164, 201, 117, 0.3);
        --tint-bg: rgba(164, 201, 117, 0.14);
        --check: #b8d989;
        --dash: #6f6855;
        --planned: #e0b266;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}
a { color: var(--brand-mid); }

/* ---------- Custom mobile install banner ---------- */
.install-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--banner-bg);
    border-bottom: 1px solid var(--banner-border);
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.install-banner.visible { display: flex; }
.install-banner .close {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    border-radius: 50%;
}
.install-banner .close:hover { color: var(--brand); }
.install-banner .icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.2);
}
.install-banner .info { flex: 1; min-width: 0; }
.install-banner .info strong {
    color: var(--brand);
    font-size: 0.92rem;
    display: block;
    font-weight: 700;
}
.install-banner .info span {
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.install-banner .get {
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-mid) 50%, var(--hero-end) 100%);
    text-align: center;
    padding: clamp(2.5rem, 8vw, 5rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 6vw, 3.5rem);
}
.hero .app-icon {
    width: clamp(88px, 22vw, 120px);
    height: clamp(88px, 22vw, 120px);
    border-radius: 26%;
    box-shadow: 0 8px 32px rgba(45, 80, 22, 0.25);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}
.hero h1 {
    font-size: clamp(2.4rem, 9vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand);
    line-height: 1.05;
}
.hero .tagline {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    margin-top: 0.6rem;
    color: var(--brand-dark);
    font-weight: 600;
}
.hero .subtitle {
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    margin-top: 1rem;
    color: var(--ink-soft);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.hero .cta {
    margin-top: clamp(1.5rem, 4vw, 2.2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

/* /vs/ pages reuse .hero but a smaller H1 + tighter stack */
.hero.vs {
    padding: clamp(2rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
}
.hero.vs h1 {
    font-size: clamp(1.85rem, 5.4vw, 2.8rem);
    line-height: 1.12;
    max-width: 780px;
    margin: 0 auto;
}
.hero.vs .tagline {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--ink-soft);
    font-weight: 500;
    max-width: 660px;
    margin: 0.5rem auto 0;
}
.hero.vs .pills {
    margin-bottom: 1rem;
}

/* ---------- App-styled status pills ---------- */
.pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    line-height: 1;
}
.pill.brand { color: var(--brand); background: var(--tint-bg); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.75; }

/* ---------- Apple-styled download badge ---------- */
.app-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--cta-bg);
    color: var(--cta-ink);
    text-decoration: none;
    padding: 0.85rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    min-height: 56px;
}
.app-store-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.app-store-badge:active { transform: translateY(0); }
.app-store-badge svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    fill: currentColor;
}
.app-store-badge .label {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.1;
}
.app-store-badge .label .small {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: 0.02em;
}
.app-store-badge .label .big {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 1px;
}

.hero .badge {
    display: inline-block;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    color: var(--brand);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
}

/* ---------- Screenshots ---------- */
.screenshots {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1100px;
    margin: clamp(1.5rem, 4vw, 2.5rem) auto;
    padding: 0 1rem;
}
.screenshots img {
    flex: 1;
    min-width: 0;
    max-width: 340px;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(45, 80, 22, 0.18);
    border: 1px solid var(--card-border);
}
@media (max-width: 700px) {
    .screenshots {
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
        gap: 1rem;
        padding: 0 1rem;
    }
    .screenshots::-webkit-scrollbar { display: none; }
    .screenshots img { flex: 0 0 85%; max-width: none; scroll-snap-align: start; }
}

/* ---------- Content ---------- */
.content {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1rem, 4vw, 1.5rem);
}
.features { margin-top: clamp(0.5rem, 2vw, 1rem); }
.features h2 {
    color: var(--brand);
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    margin-bottom: 1.2rem;
    text-align: center;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.feature {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.1rem;
    border: 1px solid var(--card-border);
}
.feature strong { color: var(--brand); font-size: 1rem; }
.feature p { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.35rem; }

.privacy-callout {
    background: var(--card-bg);
    border-left: 4px solid var(--brand-mid);
    border-radius: 8px;
    padding: 1.1rem 1.3rem;
    margin: clamp(1.5rem, 4vw, 2rem) 0;
    color: var(--ink-soft);
    border: 1px solid var(--card-border);
    border-left-width: 4px;
}
.privacy-callout strong {
    color: var(--brand);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}
.privacy-callout ul { margin: 0.5rem 0 0 1.2rem; font-size: 0.9rem; }
.privacy-callout li { margin-bottom: 0.2rem; }

.mid-cta {
    text-align: center;
    margin: clamp(2rem, 6vw, 3rem) 0 1rem;
}

.links {
    text-align: center;
    margin: 2rem 0 1rem;
    font-size: 0.9rem;
}
.links a {
    color: var(--brand-mid);
    text-decoration: none;
    margin: 0 0.8rem;
}
.links a:hover { text-decoration: underline; }

footer {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: 1rem 1rem 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--card-border);
    margin-top: 1rem;
}
.footer-langs { line-height: 2; margin: 0.75rem 0; }
.footer-langs a {
    color: var(--brand-mid);
    text-decoration: none;
    margin: 0 0.2rem;
    font-size: 0.8rem;
}
.footer-langs a:hover { text-decoration: underline; }
.footer-copy { color: var(--muted); margin-top: 1rem; font-size: 0.78rem; }

/* ---------- /vs/ comparison page styles ---------- */
.vs-section {
    margin: clamp(2rem, 5vw, 3rem) 0;
}
.vs-section h2 {
    color: var(--brand);
    font-size: clamp(1.25rem, 3.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.9rem;
}
.vs-section p {
    color: var(--ink-soft);
    margin-bottom: 0.8rem;
}
.vs-section ul.bullets {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 0.7rem;
    margin: 0.6rem 0 0;
}
.vs-section ul.bullets li {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.5;
}
.vs-section ul.bullets li strong {
    color: var(--brand);
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

/* Comparison table */
.compare-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
}
table.compare {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 0.92rem;
}
table.compare th,
table.compare td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    vertical-align: top;
}
table.compare thead th {
    background: var(--tint-bg);
    color: var(--brand);
    font-weight: 700;
    letter-spacing: -0.005em;
}
table.compare tbody tr:last-child th,
table.compare tbody tr:last-child td {
    border-bottom: none;
}
table.compare tbody th {
    font-weight: 500;
    color: var(--ink);
}
table.compare td.bh   { color: var(--ink); }
table.compare td.them { color: var(--ink-soft); }
table.compare .yes    { color: var(--check); font-weight: 700; }
table.compare .no     { color: var(--dash); }
table.compare .partial{ color: var(--planned); font-weight: 600; }
table.compare caption {
    caption-side: bottom;
    text-align: left;
    font-size: 0.78rem;
    color: var(--muted);
    padding: 0.6rem 0.9rem;
    line-height: 1.45;
}

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.faq details {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--brand);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
    color: var(--muted);
    font-weight: 400;
    transition: transform 0.15s ease;
}
.faq details[open] summary::after {
    content: "–";
}
.faq details[open] {
    background: var(--tint-bg);
    border-color: rgba(45, 80, 22, 0.25);
}
@media (prefers-color-scheme: dark) {
    .faq details[open] {
        border-color: rgba(164, 201, 117, 0.30);
    }
}
.faq details p {
    color: var(--ink-soft);
    margin-top: 0.55rem;
    font-size: 0.95rem;
}

/* /vs/ page sub-nav */
.vs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: 1.5rem 0 0;
    font-size: 0.85rem;
}
.vs-nav a {
    text-decoration: none;
    color: var(--brand);
    background: var(--tint-bg);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
}
.vs-nav a:hover { text-decoration: underline; }
.vs-nav a[aria-current="page"] {
    background: var(--brand);
    color: #fff;
}
@media (prefers-color-scheme: dark) {
    .vs-nav a[aria-current="page"] {
        color: #14130d;
    }
}

/* Pricing comparison cards */
.pricing-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 0.9rem;
}
.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
}
.pricing-card.bh { border-color: rgba(45, 80, 22, 0.35); }
@media (prefers-color-scheme: dark) {
    .pricing-card.bh { border-color: rgba(164, 201, 117, 0.40); }
}
.pricing-card h3 {
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.pricing-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.2rem;
}
.pricing-card .note {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Home page "Compared to other barn apps" section */
.compare-hub {
    margin: clamp(1.5rem, 4vw, 2.5rem) 0;
}
.compare-hub h2 {
    color: var(--brand);
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    text-align: center;
    margin-bottom: 0.6rem;
}
.compare-hub p {
    color: var(--ink-soft);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
