/* Rhinua website — one stylesheet for every page.
   Matches the iOS app's Theme.swift: the blue gradient, frosted cards (radius 16),
   iOS system blue for the one primary action, 56 px capsule buttons, SF Pro with
   rounded bold titles. Light and dark follow the device. */

:root {
    --brand: #007aff;
    --brand-press: #0062cc;
    --bg-end: rgba(255, 255, 255, 0.8);
    --bg-base: #ffffff;
    --text: #0b0b0f;
    --text-2: rgba(20, 20, 30, 0.72);
    --card: rgba(255, 255, 255, 0.55);
    --card-border: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 10px 30px rgba(0, 40, 120, 0.12);
    --bar: rgba(255, 255, 255, 0.6);
    --hairline: rgba(0, 0, 0, 0.1);
    --focus: #0062cc;
    --edge: #cfe4ff;
    --radius: 16px;
    --button: 56px;
    --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #0a84ff;
        --brand-press: #3395ff;
        --bg-end: rgba(0, 0, 0, 0.8);
        --bg-base: #000000;
        --text: #f5f5f7;
        --text-2: rgba(235, 235, 245, 0.72);
        --card: rgba(30, 30, 36, 0.5);
        --card-border: rgba(255, 255, 255, 0.12);
        --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
        --bar: rgba(10, 10, 14, 0.55);
        --hairline: rgba(255, 255, 255, 0.14);
        --focus: #66b0ff;
        --edge: #0b1830;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
    /* What shows past the page when it bounces: the gradient's mid tone. */
    background-color: var(--edge);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
    background-color: transparent; /* html paints the edges; the gradient sits between */
    -webkit-font-smoothing: antialiased;
}

/* The app's AppBackground: brand blue at 60% into white (or black) at 80%,
   top-left to bottom-right. Fixed so it stays put as the page scrolls. */
/* The gradient covers the whole screen, including under Safari's bars and
   the rounded corners (viewport-fit=cover); lvh is the tallest viewport, so
   it still reaches the bottom when the toolbar hides. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100lvh;
    z-index: -1;
    background: linear-gradient(to bottom right, rgba(0, 122, 255, 0.6), var(--bg-end)), var(--bg-base);
}

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

img { max-width: 100%; height: auto; }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
}

.topbar { padding-top: env(safe-area-inset-top); }

.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--rounded);
    font-weight: 700;
    font-size: 21px;
    letter-spacing: -0.01em;
}

.logo-circle {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.topbar nav ul {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--text);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
}
.topbar nav a:hover { background: var(--hairline); }
.topbar nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

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

h1, h2, h3 {
    font-family: var(--rounded);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(34px, 6vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 20px; }

p { margin: 0 0 1em; }

.lead {
    font-size: clamp(18px, 2.2vw, 21px);
    color: var(--text-2);
    max-width: 34em;
}

.muted { color: var(--text-2); }

/* ---------- Cards and buttons ---------- */

.card {
    background: var(--card);
    -webkit-backdrop-filter: saturate(160%) blur(24px);
    backdrop-filter: saturate(160%) blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--button);
    padding: 0 28px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}
.button:active { transform: scale(0.98); opacity: 0.85; }

.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-press); text-decoration: none; }

/* "Coming soon": the app's disabled primary button, translucent and inert. */
.button-soon {
    background: var(--hairline);
    color: var(--text);
    cursor: default;
}
.button-soon:active { transform: none; opacity: 1; }

.button svg { width: 20px; height: 20px; flex: none; }

/* ---------- Main ---------- */

main { flex: 1; padding-bottom: 72px; }

section { padding-top: 64px; }

.section-head { text-align: center; margin: 0 auto 28px; }
.section-head p { margin: 0 auto; }

/* Home hero */
.hero {
    text-align: center;
    padding-top: 72px;
}
.hero .logo-circle {
    margin: 0 auto 24px;
    box-shadow: 0 12px 32px rgba(0, 60, 160, 0.25);
}
.hero h1 { margin-bottom: 6px; }
.tagline {
    font-family: var(--rounded);
    font-weight: 600;
    font-size: clamp(19px, 2.6vw, 24px);
    margin: 0 0 18px;
}
.hero .lead { margin: 0 auto 32px; }
.hero .note { margin: 14px 0 0; font-size: 15px; }

/* Grids of cards */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-family: var(--rounded);
    font-weight: 700;
    font-size: 18px;
}

.icon {
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    color: var(--brand);
}

.grid .card p:last-child { margin-bottom: 0; }
.grid .card p { color: var(--text-2); }

/* Simple pages (About, Contact, 404) */
.page-head { text-align: center; padding-top: 56px; margin-bottom: 28px; }
.page-head .lead { margin: 0 auto; }

.narrow { max-width: 720px; margin: 0 auto; }

.prose h2 { font-size: 22px; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose p:last-child { margin-bottom: 0; }

.contact-card { text-align: center; padding: 36px 24px; }
.contact-card .button { margin: 8px 0 18px; max-width: 100%; }
.contact-card p:last-child { margin-bottom: 0; }

/* Legal pages: long text, kept readable */
.legal { max-width: 760px; margin: 40px auto 0; padding: 32px; }
.legal .updated { color: var(--text-2); margin-top: -4px; }
.legal h2 { font-size: 22px; margin: 2em 0 0.6em; scroll-margin-top: 80px; }
.legal h3 { font-size: 18px; margin: 1.5em 0 0.5em; }
.legal ul { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: 0.35em; }
.legal li, .legal p { overflow-wrap: anywhere; }

.toc {
    margin: 24px 0 8px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--hairline);
}
.toc h2 { font-size: 16px; margin: 0 0 8px; }
.toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 24px;
    font-size: 15px;
}
.toc li { break-inside: avoid; margin-bottom: 4px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

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

.footer {
    border-top: 1px solid var(--hairline);
    background: var(--bar);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    font-size: 15px;
}
.footer .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding-top: 22px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
.footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.footer a { color: var(--text); text-decoration: none; display: inline-block; padding: 6px 0; }
.footer a:hover { text-decoration: underline; }
.footer p { margin: 0; color: var(--text-2); }

/* ---------- Phone ---------- */

@media (max-width: 760px) {
    .grid { grid-template-columns: 1fr; }
    section { padding-top: 48px; }
    .hero { padding-top: 48px; }
    .legal { padding: 22px 18px; margin-top: 20px; }
    .toc ol { columns: 1; }
}

@media (max-width: 420px) {
    .wrap { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
    .brand { font-size: 19px; gap: 8px; }
    .topbar nav a { padding: 0 10px; font-size: 15px; }
    .card { padding: 20px; }
}

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

/* Older browsers without backdrop blur get a more solid card. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card, .topbar, .footer { background: var(--bg-base); }
}

ol.steps { list-style: none; padding: 0; margin: 0; }
.center { text-align: center; }

.summary {
    margin: 24px 0 8px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.summary h2 { font-size: 18px; margin: 0 0 8px; }
.summary ul { margin: 0; }
