/* ReceiptStreet landing page.
   Spacing and radii follow the app's DesignTokens.swift (4/8/12/16/24, radius 12). The brand green is the light
   value of the app's SelectedCategoryButton color; it passes AA both behind white button text and as link text. */

:root {
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-section: clamp(64px, 10vw, 120px);
    --radius: 12px;

    --background: #faf9f7;
    --tint: #f3f1ec;
    --text: #222222;
    --secondary-text: #6a6a6a;
    --border: #e4e1da;
    --brand: #15803d;
    --brand-pressed: #116a33;
    --brand-text: #15803d;       /* 4.8:1 on the background */
    --phone: #121212;            /* the app's dark background */

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
}

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

p {
    margin: 0;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--brand-text);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.narrow {
    max-width: 720px;
}

.center {
    text-align: center;
}

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

.skip-link {
    position: absolute;
    left: var(--space-lg);
    top: -100px;
    padding: var(--space-sm) var(--space-lg);
    background: var(--text);
    color: #fff;
    border-radius: var(--radius);
    z-index: 10;
}

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

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.wordmark {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    text-decoration: none;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 var(--space-xl);
    background: var(--brand);
    color: #ffffff;                  /* white on green: 5.0:1 */
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.15s ease;
}

/* Stands in for the TestFlight button until the beta link exists. */
.button-soon {
    background: var(--border);
    color: var(--secondary-text);
    cursor: default;
}

.button:hover {
    background: var(--brand-pressed);
}

.button-small {
    min-height: 44px;
    padding: 0 var(--space-lg);
    font-size: 0.9375rem;
}

.text-link {
    color: var(--brand-text);
    font-weight: 600;
    text-underline-offset: 3px;
}

/* Hero */
.hero {
    padding: clamp(40px, 8vw, 96px) 0 var(--space-section);
}

.hero-grid {
    display: grid;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.125rem, 1.4rem + 3.2vw, 3.5rem);
    max-width: 14ch;
}

.lead {
    margin-top: var(--space-xl);
    max-width: 34ch;
    color: var(--secondary-text);
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
}

.cta-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
    margin-top: 32px;
}

.cta-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.facts {
    margin-top: var(--space-xl);
    color: var(--secondary-text);
    font-size: 0.9375rem;
}

/* Phone frames around the screenshots */
.phone {
    margin: 0 auto;
    width: min(280px, 78vw);
    aspect-ratio: 9 / 19.5;
    padding: 10px;
    background: #1c1c1c;
    border-radius: 44px;
    box-shadow: 0 24px 60px rgba(34, 34, 34, 0.18);
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 100%;
    padding: var(--space-xl);
    background: var(--phone);
    border-radius: 34px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
}

/* A screen holding a screenshot: the picture fills it edge to edge. */
.screen-shot {
    padding: 0;
    overflow: hidden;
}

.screen-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;   /* the share picture is a hair taller; trim its empty bottom margin */
}

/* Sections */
.section {
    padding: var(--space-section) 0;
}

.section-tinted {
    background: var(--tint);
}

.section-title {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
    max-width: 22ch;
}

.center .section-title {
    margin: 0 auto;
}

.body-large {
    margin-top: var(--space-xl);
    font-size: 1.1875rem;
}

.section .text-link {
    display: inline-block;
    margin-top: var(--space-xl);
}

/* How it works */
.steps {
    list-style: none;
    margin: 56px 0 0;
    padding: 0;
    display: grid;
    gap: 72px;
}

.step {
    display: grid;
    gap: 32px;
    align-items: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9375rem;
}

.step h3 {
    font-size: 1.5rem;
}

.step p {
    margin-top: var(--space-md);
    max-width: 42ch;
    color: var(--secondary-text);
}

/* Fair details */
.details {
    display: grid;
    gap: 40px;
    margin-top: 48px;
}

.detail {
    padding-top: var(--space-xl);
    border-top: 2px solid var(--text);
}

.detail h3 {
    font-size: 1.25rem;
}

.detail p {
    margin-top: var(--space-sm);
    color: var(--secondary-text);
}

/* FAQ */
.faq {
    margin: 40px 0 0;
}

.faq > div {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border);
}

.faq > div:last-child {
    border-bottom: 1px solid var(--border);
}

.faq dt {
    font-weight: 600;
}

.faq dd {
    margin: var(--space-xs) 0 0;
    color: var(--secondary-text);
}

/* Final call to action */
.final-cta .button {
    margin-top: 32px;
}

/* Footer */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    color: var(--secondary-text);
    font-size: 0.9375rem;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: space-between;
}

.footer-row nav {
    display: flex;
    gap: var(--space-xl);
}

/* Wider screens */
@media (min-width: 720px) {
    .details {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .step {
        grid-template-columns: 1fr 1fr;
        gap: 64px;
    }

    /* Alternate text and screenshot sides. */
    .step:nth-child(even) .step-text {
        order: 2;
    }
}

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

/* Privacy policy */
.policy {
    margin: var(--space-xl) 0;
    padding-left: var(--space-xl);
}

.policy li {
    margin-bottom: var(--space-md);
}

.policy-page h2 {
    margin-top: 40px;
    margin-bottom: var(--space-md);
    font-size: 1.375rem;
}

.policy-page p + p,
.policy-page .facts + p {
    margin-top: var(--space-lg);
}
