/* =========================================================================
   Forecourt — marketing site stylesheet
   Mobile-first, monochrome, system fonts, automatic dark mode.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------------- */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

    /* Type scale */
    --text-xs:   0.8125rem;
    --text-sm:   0.9375rem;
    --text-base: 1.0625rem;
    --text-lg:   1.25rem;
    --text-xl:   1.5rem;
    --text-2xl:  2rem;
    --text-3xl:  2.5rem;
    --text-4xl:  3.25rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;

    /* Layout */
    --content-max:    64rem;
    --content-narrow: 44rem;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Light mode palette */
    --bg:            #ffffff;
    --bg-muted:      #f5f5f7;
    --bg-elevated:   #ffffff;
    --text:          #1d1d1f;
    --text-muted:    #6e6e73;
    --text-subtle:   #86868b;
    --border:        #d2d2d7;
    --border-subtle: #e8e8ed;
    --link:          #1d1d1f;
    --link-hover:    #000000;
    --shadow:        0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Auto dark mode (no explicit user override) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:            #000000;
        --bg-muted:      #1d1d1f;
        --bg-elevated:   #1d1d1f;
        --text:          #f5f5f7;
        --text-muted:    #a1a1a6;
        --text-subtle:   #86868b;
        --border:        #424245;
        --border-subtle: #2c2c2e;
        --link:          #f5f5f7;
        --link-hover:    #ffffff;
        --shadow:        0 4px 16px rgba(0, 0, 0, 0.5);
    }
}

/* Explicit user override: dark */
:root[data-theme="dark"] {
    --bg:            #000000;
    --bg-muted:      #1d1d1f;
    --bg-elevated:   #1d1d1f;
    --text:          #f5f5f7;
    --text-muted:    #a1a1a6;
    --text-subtle:   #86868b;
    --border:        #424245;
    --border-subtle: #2c2c2e;
    --link:          #f5f5f7;
    --link-hover:    #ffffff;
    --shadow:        0 4px 16px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 600;
}

p { margin: 0 0 1em; }

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 120ms ease;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
    border-radius: 2px;
}

ul, ol {
    padding-left: 1.25em;
    margin: 0 0 1em;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    margin: var(--space-7) 0;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-muted);
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--text);
    color: var(--bg);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    left: var(--space-3);
    top: var(--space-3);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------------
   3. Layout primitives
   ------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.section { padding: var(--space-8) 0; }

@media (min-width: 48rem) {
    .section { padding: var(--space-9) 0; }
}

.section--muted { background: var(--bg-muted); }

/* -------------------------------------------------------------------------
   4. Site header
   ------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-block: var(--space-3);
}

.wordmark {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    margin-right: auto;
}

/* Theme toggle (injected by global.js) */
.theme-toggle {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: var(--space-2);
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle img {
    width: 18px;
    height: 18px;
}

/* Toggle and mobile-menu icons are baked-black SVGs; invert in dark mode. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle img,
    :root:not([data-theme="light"]) .site-nav-mobile summary img {
        filter: invert(1);
    }
}

:root[data-theme="dark"] .theme-toggle img,
:root[data-theme="dark"] .site-nav-mobile summary img {
    filter: invert(1);
}

.site-nav { display: none; }

.site-nav ul {
    display: flex;
    gap: var(--space-5);
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--text);
}

/* Primary CTA — first item in either nav */
.site-nav li:first-child a,
.site-nav-mobile__menu li:first-child a {
    font-weight: 700;
    color: var(--text);
}

@media (min-width: 40rem) {
    .site-nav { display: block; }
    .site-nav-mobile { display: none; }
}

/* Mobile nav: <details>, no JS */
.site-nav-mobile { position: relative; }

.site-nav-mobile summary {
    list-style: none;
    cursor: pointer;
    padding: var(--space-2);
    user-select: none;
    line-height: 0;
}

.site-nav-mobile summary::-webkit-details-marker { display: none; }

.site-nav-mobile summary img {
    width: 24px;
    height: 24px;
}

.site-nav-mobile__menu {
    position: absolute;
    right: 0;
    top: calc(100% + var(--space-2));
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: var(--space-3);
    min-width: 12rem;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.site-nav-mobile__menu a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
}

.site-nav-mobile__menu a:hover {
    background: var(--bg-muted);
}

/* -------------------------------------------------------------------------
   5. Site footer
   ------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-7) 0 var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.site-footer__columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 40rem) {
    .site-footer__columns { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li { margin: 0 0 var(--space-2); }

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

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

.site-footer address { font-style: normal; }

/* -------------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------------- */

.hero {
    padding: var(--space-8) 0 var(--space-7);
    text-align: center;
}

@media (min-width: 48rem) {
    .hero { padding: var(--space-9) 0 var(--space-8); }
}

.hero > .container > img {
    /* App icon — direct child only, so the App Store badge's <img>
       (nested inside .app-store-badge > picture) doesn't pick these up. */
    width: 128px;
    height: 128px;
    margin: 0 auto var(--space-3);
}

.hero h1 {
    /* "Forecourt" — the brand name, page's primary heading */
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 var(--space-1);
}

.hero h1 + p {
    /* "For iPhone" eyebrow — the p directly after the h1 */
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
}

.hero h2 {
    /* The slogan — the claim ("what does it do"). Subheading-sized,
       not hero-sized: this section is explanatory, not a second hero. */
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    max-width: 28ch;
    margin: 0 auto var(--space-3);
}

.hero > .container > strong {
    /* "£250+" — the proof. The visual focal point of this section,
       but proportional to the supporting role of the section overall. */
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    display: block;
    margin-bottom: var(--space-3);
}

.hero p:last-of-type {
    /* the 10p/week caption — body-text size, the explanation behind the £250 number */
    font-size: var(--text-base);
    color: var(--text-muted);
    max-width: 42ch;
    margin: 0 auto var(--space-6);
    line-height: 1.5;
}

.hero p strong {
    color: var(--text);
    font-weight: 600;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}

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

.app-store-badge img {
    height: 3rem;
    width: auto;
}

/* -------------------------------------------------------------------------
   7. Section heading (eyebrow + h2 + optional subtitle)
   ------------------------------------------------------------------------- */

.section-heading {
    text-align: center;
    margin-bottom: var(--space-7);
}

.section-heading > p:first-of-type {
    /* eyebrow */
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

.section-heading h2 {
    font-size: clamp(var(--text-2xl), 3vw + 1rem, var(--text-3xl));
    max-width: 22ch;
    margin: 0 auto var(--space-4);
    letter-spacing: -0.02em;
}

.section-heading h2 + p {
    /* subtitle */
    font-size: var(--text-lg);
    color: var(--text-muted);
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.4;
}

/* -------------------------------------------------------------------------
   8. Six search modes
   ------------------------------------------------------------------------- */

.search-modes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--border-subtle);
    counter-reset: mode;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 48rem) {
    .search-modes { grid-template-columns: repeat(2, 1fr); }
    .search-modes > li:nth-child(odd) { border-right: 1px solid var(--border-subtle); }
}

.search-modes > li {
    counter-increment: mode;
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
    position: relative;
}

.search-modes > li::before {
    content: counter(mode, decimal-leading-zero);
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-subtle);
    margin-bottom: var(--space-2);
    letter-spacing: 0.05em;
}

.search-modes h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.search-modes p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

/* -------------------------------------------------------------------------
   9. Feature grid
   ------------------------------------------------------------------------- */

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    list-style: none;
    padding-left: 0;
    margin: 0;
}

@media (min-width: 40rem) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 60rem) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-grid li {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.feature-grid h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

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

/* -------------------------------------------------------------------------
   10. Screenshot gallery
   ------------------------------------------------------------------------- */

.gallery {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--space-2) 0 var(--space-5);
    margin: 0 calc(-1 * var(--space-5));
}

.gallery::-webkit-scrollbar { display: none; }

.gallery__track {
    display: flex;
    width: max-content;
    padding: 0 2rem;
}

.gallery figure {
    flex: 0 0 auto;
    width: 240px;
    scroll-snap-align: center;
    margin: 1rem;
}

.gallery img {
    aspect-ratio: 720 / 1485;
    object-fit: contain;
}

.gallery figcaption {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}

/* -------------------------------------------------------------------------
   11. Privacy callout & embedded full policy
   ------------------------------------------------------------------------- */

.privacy-callout {
    text-align: center;
    max-width: var(--content-narrow);
    margin: 0 auto;
}

.privacy-pillars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    margin: var(--space-6) 0 0;
    padding: 0;
}

@media (min-width: 40rem) {
    .privacy-pillars { grid-template-columns: repeat(4, 1fr); }
}

.privacy-pillars > div {
    text-align: center;
    font-size: var(--text-sm);
}

.privacy-pillars dt {
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.privacy-pillars dd {
    color: var(--text-muted);
    margin: 0;
}

.privacy-policy {
    max-width: var(--content-narrow);
    margin: var(--space-7) auto 0;
}

.privacy-policy__body > :first-child { margin-top: 0; }

.privacy-policy__body h3 {
    color: var(--text);
    font-size: var(--text-base);
    margin: var(--space-5) 0 var(--space-2);
}

.privacy-policy__body h4 {
    color: var(--text);
    font-size: var(--text-sm);
    margin: var(--space-4) 0 var(--space-1);
}

.privacy-policy__body ul {
    margin: 0 0 var(--space-3);
    padding-left: 1.25em;
}

.privacy-policy__body li {
    margin: 0 0 var(--space-1);
}

.privacy-policy__updated {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-subtle);
    font-size: var(--text-xs);
}

/* -------------------------------------------------------------------------
   12. FAQ — also used by the privacy-policy disclosure
   ------------------------------------------------------------------------- */

.faq {
    max-width: var(--content-narrow);
    margin: 0 auto;
}

.faq-item {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-4) 0;
}

.faq-item:last-of-type {
    border-bottom: 1px solid var(--border-subtle);
}

.faq-item summary {
    cursor: pointer;
    font-weight: 500;
    font-size: var(--text-base);
    padding-right: var(--space-5);
    position: relative;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 300;
    font-size: 1.25em;
    color: var(--text-muted);
}

.faq-item[open] summary::after { content: "−"; }

/* Answer — any non-summary direct child (a <p> for FAQs, the policy body for privacy) */
.faq-item > *:not(summary) {
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.faq-item > p { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   13. Pricing card
   ------------------------------------------------------------------------- */

.pricing-card {
    max-width: 24rem;
    margin: 0 auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    background: var(--bg-elevated);
}

.pricing-card p:first-of-type {
    /* price */
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.pricing-card p:first-of-type span {
    /* "/ month" period */
    font-size: var(--text-base);
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-card p:nth-of-type(2) {
    /* "After your free 30-day trial" */
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-5);
    text-align: left;
}

.pricing-card li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    margin: 0;
    display: flex;
    gap: var(--space-2);
}

.pricing-card li:last-child { border-bottom: none; }

.pricing-card li::before {
    content: "✓";
    color: var(--text);
    flex: 0 0 auto;
    font-weight: 600;
}

/* "Start free trial" CTA — only button-styled link on the site */
.pricing-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-base);
    font-weight: 500;
    border-radius: 999px;
    text-decoration: none;
    background: var(--text);
    color: var(--bg);
    transition: background-color 120ms ease, transform 120ms ease;
    line-height: 1.2;
}

.pricing-card a:hover {
    background: var(--link-hover);
    transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
   14. Disclaimer
   ------------------------------------------------------------------------- */

.disclaimer {
    text-align: center;
    max-width: var(--content-narrow);
    margin: 0 auto;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.disclaimer p { margin: 0 0 var(--space-3); }
.disclaimer p:last-child { margin: 0; }

/* -------------------------------------------------------------------------
   15. Long-form prose (press page)
   ------------------------------------------------------------------------- */

.prose {
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding: var(--space-7) 0;
}

.prose h1 {
    font-size: clamp(var(--text-2xl), 4vw + 1rem, var(--text-3xl));
    margin-bottom: var(--space-4);
}

.prose .lede {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-bottom: var(--space-7);
    line-height: 1.5;
}

.prose h2 {
    font-size: var(--text-xl);
    margin: var(--space-7) 0 var(--space-3);
}

.prose h3 {
    font-size: var(--text-lg);
    margin: var(--space-5) 0 var(--space-2);
}

.prose p,
.prose li {
    line-height: 1.6;
}

.prose li + li { margin-top: 0.25em; }

.prose blockquote {
    margin: var(--space-5) 0;
    padding: var(--space-2) var(--space-5);
    border-left: 3px solid var(--border);
    color: var(--text-muted);
    font-style: italic;
}

.prose dl { margin: var(--space-5) 0; }

.prose dt {
    font-weight: 600;
    margin-top: var(--space-4);
}

.prose dd {
    margin: var(--space-1) 0 0;
    color: var(--text-muted);
}

.prose address { font-style: normal; }

.prose .updated {
    margin-top: var(--space-7);
    color: var(--text-subtle);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-5);
}

/* Press kit metadata "tables" — <dl>'s laid out as 2-col grids */
.prose .meta-table {
    display: grid;
    grid-template-columns: 12rem 1fr;
    margin: var(--space-5) 0;
    padding: 0;
    font-size: var(--text-sm);
}

.prose .meta-table > div { display: contents; }

.prose .meta-table dt,
.prose .meta-table dd {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
}

.prose .meta-table dt {
    font-weight: 600;
    color: var(--text);
}

.prose .meta-table dd { color: var(--text-muted); }

.prose .meta-table ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.prose .meta-table li { margin: 0; }

/* -------------------------------------------------------------------------
   16. Page hero (press page)
   ------------------------------------------------------------------------- */

.page-hero {
    text-align: center;
    padding: var(--space-8) 0 var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.page-hero h1 {
    font-size: clamp(var(--text-2xl), 4vw + 1rem, var(--text-3xl));
    margin: 0 0 var(--space-3);
}

.page-hero p {
    font-size: var(--text-lg);
    color: var(--text-muted);
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.4;
}

/* -------------------------------------------------------------------------
   17. Press kit asset list
   ------------------------------------------------------------------------- */

.asset-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: 0;
    margin: var(--space-4) 0;
}

@media (min-width: 40rem) {
    .asset-list { grid-template-columns: repeat(2, 1fr); }
}

.asset-list > div {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.asset-list dt {
    font-weight: 600;
    margin: 0 0 var(--space-1);
    color: var(--text);
}

.asset-list dd {
    color: var(--text-muted);
    margin: 0;
}
