/* ==========================================================================
   WidgetScreen: shared tokens & chrome for the legal pages (privacy / terms).
   Mirrors the design system in index.html: warm neutrals, coral brand,
   Apple system type, quiet confidence.
   ========================================================================== */

:root {
    --coral: oklch(0.76 0.16 35);
    --coral-pale: oklch(0.95 0.045 35);
    --coral-deep: oklch(0.49 0.14 27);
    --ink: oklch(0.18 0.025 310);
    --ink-soft: oklch(0.39 0.03 310);
    --muted: oklch(0.46 0.02 310);
    --white: oklch(0.995 0.002 35);
    --mist: oklch(0.975 0.009 35);
    --line: oklch(0.3 0.025 310 / 0.14);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    --z-nav: 20;
}

* { box-sizing: border-box; }

html { background: var(--white); scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    font-family: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; font: inherit; }
::selection { background: oklch(0.82 0.14 35 / .55); }
:focus-visible { outline: 3px solid oklch(0.48 0.16 260); outline-offset: 4px; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(1440px, calc(100% - 64px)); margin-inline: auto; }
.narrow { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

/* ---------- nav (matches index) ---------- */
.site-nav { position: relative; z-index: var(--z-nav); color: var(--ink); }
.nav-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    font-weight: 760;
    letter-spacing: -.025em;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links > a:not(.nav-download) {
    text-decoration: none;
    font-size: .92rem;
    font-weight: 650;
}
.nav-links > a:not(.nav-download)::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: 3px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 220ms var(--ease);
}
.nav-links > a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 21px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    text-decoration: none;
    font-weight: 740;
    font-size: .9rem;
    letter-spacing: -.015em;
    transition: opacity 180ms ease;
}
.nav-download:hover { opacity: .82; }
.apple { width: 14px; height: 17px; fill: currentColor; }

/* ---------- legal hero ---------- */
.legal-hero {
    padding: clamp(56px, 8vw, 104px) 0 clamp(30px, 4vw, 48px);
    text-align: center;
}
.legal-hero h1 {
    max-width: 16ch;
    margin-inline: auto;
    font-family: var(--display);
    font-size: clamp(2.6rem, 5vw, 3.9rem);
    line-height: 1;
    letter-spacing: -.035em;
    font-weight: 720;
    text-wrap: balance;
}
.last-updated {
    display: inline-flex;
    margin-top: 18px;
    color: var(--muted);
    font-weight: 600;
    font-size: .92rem;
}

/* ---------- legal body ---------- */
.legal-shell {
    width: min(720px, 100%);
    margin: clamp(26px, 4vw, 44px) auto 0;
    padding-bottom: clamp(64px, 8vw, 110px);
}
.legal-shell section + section {
    margin-top: 34px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}
.legal-shell h2 {
    font-family: var(--display);
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.18;
}
.legal-shell p,
.legal-shell ul {
    margin-top: 13px;
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 68ch;
    text-wrap: pretty;
}
.legal-shell ul { padding-left: 1.15rem; }
.legal-shell li + li { margin-top: 8px; }
.legal-shell a { font-weight: 650; text-underline-offset: 3px; }

/* ---------- footer (matches index) ---------- */
footer { background: var(--ink); color: white; }
.footer-inner {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 720; }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
    color: oklch(1 0 0 / .65);
    font-size: .86rem;
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: white; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
    .shell, .narrow { width: min(100% - 36px, 620px); }
    .nav-inner { min-height: 68px; }
    .nav-links > a:not(.nav-download) { display: none; }
    .brand { font-size: .95rem; }
    .brand img { width: 32px; height: 32px; }
    .nav-download { width: 42px; min-height: 42px; padding: 0; }
    .nav-download span { display: none; }
    .legal-hero { text-align: left; }
    .legal-hero h1 { margin-inline: 0; }
    .footer-inner { padding: 28px 0; align-items: flex-start; flex-direction: column; }
    .footer-links { justify-content: flex-start; }
}

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