/* Base — reset, type, layout primitives, nav, footer, badge. Shared by every page. */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    background: var(--ground);
    color: var(--text);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Sprite icons: <use> inherits these from the host svg. */
.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
}
a { color: inherit; }
::selection { background: rgb(255 153 51 / 28%); }

:focus-visible {
    outline: 2px solid var(--sunset-b);
    outline-offset: 3px;
    border-radius: 6px;
}

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: var(--radius-control);
    background: var(--ink);
    color: var(--ground);
    text-decoration: none;
    font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---- Layout ---- */

.container {
    width: 100%;
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container-narrow { max-width: 760px; }

.section { padding-block: var(--section-space); position: relative; }
.section-raised { background: var(--ground-raised); }

.section-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto clamp(48px, 7vw, 72px);
}

/* ---- Type ---- */

.headline {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.25rem, 5.2vw, 3.75rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    /* WONK 0: at display sizes Fraunces swaps in leaning n, m and h that read as italic. */
    font-variation-settings: 'opsz' 144, 'WONK' 0, 'SOFT' 0;
    color: var(--ink);
    text-wrap: balance;
}

.headline-sm { font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; }

/* The accent phrase: upright Fraunces in the icon's sunset ink, with no italic, so the
   headline reads as one modern line. Large sizes only (#ED5B2E on paper is ~3.2:1,
   large-text AA). */
.accent {
    font-style: normal;
    background: var(--sunset);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    margin: 22px auto 0;
    max-width: 38em;
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.footnote {
    margin: 40px auto 0;
    max-width: 40em;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-tertiary);
}

.text-link {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px solid var(--sunset-b);
    padding-bottom: 1px;
    transition: border-color 0.2s;
}
.text-link:hover { border-bottom-color: transparent; }

/* The sunset thread — the store canvas's opening line, used at a section's top. */
.thread {
    display: block;
    width: min(560px, 80%);
    height: 18px;
    margin: 0 auto 36px;
}
.thread path { stroke: url(#thread-gradient); }

/* ---- Wordmark (Constants.wordmarkGradient) ---- */

.wordmark {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.005em;
    background: linear-gradient(90deg,
        var(--wm-warm) 0%, var(--wm-warm) 18%,
        var(--wm-silver) 58%, var(--wm-silver) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---- Nav: a floating glass bar ---- */

.site-nav {
    position: fixed;
    inset: 12px 0 auto;
    z-index: 100;
    padding-inline: 12px;
    pointer-events: none;
}

.site-nav-bar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 980px;
    margin: 0 auto;
    padding: 8px 8px 8px 22px;
    border-radius: var(--radius-control);
    transition: box-shadow 0.3s var(--ease-out);
}
.site-nav-bar.is-scrolled {
    box-shadow:
        inset 0 1px 0 var(--glass-edge),
        inset 0 0 0 1px var(--glass-rim),
        0 1px 2px rgb(0 0 0 / 6%), 0 18px 40px -16px rgb(0 0 0 / 28%);
}

.site-nav-logo {
    font-size: 1.375rem;
    text-decoration: none;
    line-height: 1;
    padding-block: 4px;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav-links a:not(.btn) {
    padding: 8px 14px;
    border-radius: var(--radius-control);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.site-nav-links a:not(.btn):hover { color: var(--text); background: var(--hairline); }
.site-nav-links a[aria-current="page"] { color: var(--text); }

.site-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.site-nav-toggle svg { margin: auto; }

.site-nav-menu {
    pointer-events: auto;
    max-width: 980px;
    margin: 8px auto 0;
    padding: 8px;
    border-radius: 22px;
}
.site-nav-menu a {
    display: block;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
}
.site-nav-menu a:hover { background: var(--hairline); }

@media (max-width: 734px) {
    .site-nav-links { display: none; }
    .site-nav-toggle { display: grid; }
}
@media (min-width: 735px) {
    .site-nav-menu { display: none; }
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 18px;
    border: 0;
    border-radius: var(--radius-control);
    font: 600 0.875rem/1 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), filter 0.2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-ink {
    background: var(--ink);
    color: var(--ground);
}
.btn-ink:hover { filter: brightness(1.15); }

/* ---- App Store badge — Apple artwork, unmodified; variant swaps by scheme ---- */

.appstore-badge {
    display: inline-block;
    line-height: 0;
    border-radius: 9px;
    transition: transform 0.2s var(--ease-out);
}
.appstore-badge img { height: 54px; width: auto; }
.appstore-badge:hover { transform: translateY(-1px); }

/* Apple's 40px minimum badge height; 48 keeps clear of it on phones. */
@media (max-width: 480px) {
    .appstore-badge img { height: 48px; }
}

/* ---- Download CTA (shared by Home and How It Works) ---- */

.download { text-align: center; }
.download-icon {
    width: 112px;
    height: 112px;
    margin: 0 auto 22px;
    border-radius: 25px;
    box-shadow: 0 24px 48px -20px rgb(27 31 61 / 45%);
}
.download-badge { margin-top: 32px; }
.download-badge .appstore-badge img { height: 60px; }
.download-fine {
    margin: 22px 0 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-tertiary);
}

/* ---- Reveal on scroll ---- */

.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---- Footer ---- */

.site-footer {
    padding: 56px var(--gutter) 48px;
    border-top: 1px solid var(--hairline);
    text-align: center;
}
.site-footer-brand { font-size: 1.5rem; line-height: 1; }
.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin: 22px 0 18px;
    padding: 0;
    list-style: none;
}
.site-footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.site-footer-links a:hover { color: var(--text); }
.site-footer p {
    margin: 4px auto 0;
    max-width: 40em;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ---- Reduced motion ---- */

@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;
    }
    .js .reveal { opacity: 1; transform: none; }
}

@media print {
    .site-nav, .site-footer { display: none; }
    body { background: #fff; color: #000; }
}
