/* Veronata app shell — shared by /, /privacy and /terms.
   Mobile first: everything below is the phone layout; the min-width
   blocks at the bottom only widen it. */

@font-face {
    font-family: 'Inter';
    src: url('/assets/InterVariable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #08080a;
    --bg-surface: #111114;
    --bg-elevated: #1a1a1f;
    --bg-press: #222228;
    --separator: rgba(255, 255, 255, 0.08);
    --border: #222228;
    --text-primary: #f2f2f4;
    --text-secondary: #a1a1aa;
    --text-tertiary: #7c7c86;
    --accent: #818cf8;
    --accent-strong: #5b5ef0; /* white text on it: 4.9:1 */
    --accent-tint: rgba(129, 140, 248, 0.16);
    --live: #10b981;
    --danger: #f87171;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --appbar-h: 48px;
    --tabbar-h: 56px;
    --gutter: 16px;
    --col: 720px;

    --r-row: 14px;
    --r-icon: 22.5%;
    --spring: cubic-bezier(0.32, 0.72, 0, 1);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    background: var(--bg);
    scroll-padding-top: calc(var(--appbar-h) + var(--safe-top) + 8px);
}
html.sheet-open { overflow: hidden; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100dvh;
    overscroll-behavior-y: none;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent-strong); color: #fff; }

/* App chrome (bars, tabs, buttons) behaves like UI, not like a document. */
.appbar, .tabbar, .btn, .pill, .row-main, .sheet-handle {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.skip-link {
    position: absolute;
    left: 12px; top: calc(var(--safe-top) + 8px);
    padding: 8px 12px;
    background: var(--accent-strong);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    transform: translateY(-200%);
    z-index: 2000;
}
.skip-link:focus { transform: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

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

/* ---------- App bar ---------- */
.appbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    padding: var(--safe-top) calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
    background: rgba(8, 8, 10, 0);
    border-bottom: 0.5px solid transparent;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.appbar-inner {
    height: var(--appbar-h);
    max-width: var(--col);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.appbar.is-condensed {
    background: rgba(12, 12, 15, 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: var(--separator);
}
.appbar-brand { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 44px; }
.appbar-brand .mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c83f6, #5457e6);
    display: grid; place-items: center;
}
.appbar-brand .mark svg { width: 18px; height: 18px; color: #fff; }
.appbar-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
    white-space: nowrap;
}
.appbar.is-condensed .appbar-title { opacity: 1; transform: none; }
.appbar-end { justify-self: end; display: flex; align-items: center; gap: 4px; }

.back {
    display: inline-flex; align-items: center; gap: 2px;
    min-height: 44px; padding-right: 8px;
    color: var(--accent);
    font-size: 17px;
    justify-self: start;
}
.back svg { width: 22px; height: 22px; margin-left: -6px; }

/* ---------- Layout ---------- */
.screen {
    max-width: var(--col);
    margin: 0 auto;
    padding:
        calc(var(--appbar-h) + var(--safe-top) + 4px)
        var(--gutter)
        calc(var(--tabbar-h) + var(--safe-bottom) + 40px);
}

.large-title { padding: 6px 0 20px; }
.large-title h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.large-title p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.45;
    max-width: 36ch;
}

.status {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 16px;
    padding: 7px 12px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-secondary);
    font-feature-settings: 'tnum';
}
.status b { color: var(--text-primary); font-weight: 500; }
.pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--live);
    animation: pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.group-label {
    margin: 28px 4px 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.group-label:first-child { margin-top: 4px; }
.group-foot {
    margin: 8px 4px 0;
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.45;
}

/* Inset grouped list (iOS Settings / App Store style) */
.list {
    background: var(--bg-surface);
    border-radius: var(--r-row);
    overflow: hidden;
}
.list > li { position: relative; }
.list > li + li::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    left: var(--sep-inset, 16px);
    border-top: 0.5px solid var(--separator);
}

/* Plain navigation/info row */
.cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    transition: background 0.15s;
}
a.cell:active, button.cell:active { background: var(--bg-press); }
.cell .label { flex: 1; min-width: 0; }
.cell .value { color: var(--text-secondary); text-align: right; font-size: 15px; }
.cell .chev { width: 8px; height: 13px; color: var(--text-tertiary); flex-shrink: 0; }
.cell .ext { width: 13px; height: 13px; color: var(--text-tertiary); flex-shrink: 0; }

/* ---------- Product rows ---------- */
.products { --sep-inset: 86px; }
.product { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 0; }
.row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 12px 16px;
    text-align: left;
    border-radius: 0;
    transition: opacity 0.15s;
}
.row-main:active { opacity: 0.55; }
.app-icon {
    width: 58px; height: 58px;
    border-radius: var(--r-icon);
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg-elevated);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}
.row-text { min-width: 0; flex: 1; }
.row-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}
.row-sub {
    margin-top: 1px;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.row-meta { margin-top: 3px; font-size: 12px; color: var(--text-tertiary); }
.row-desc { display: none; }

.pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-tint);
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: transform 0.15s var(--ease), background 0.15s;
}
.pill:active { transform: scale(0.94); background: rgba(129, 140, 248, 0.26); }

/* ---------- Buttons & forms ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 14px;
    background: var(--accent-strong);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: transform 0.15s var(--ease), opacity 0.15s;
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn[disabled] { opacity: 0.5; }

.form .list > li { --sep-inset: 16px; }
.field { display: block; padding: 10px 16px 12px; }
.field span {
    display: block;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}
.field input, .field textarea {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 17px; /* >= 16px: iOS Safari won't zoom the page on focus */
    line-height: 1.4;
    padding: 2px 0;
    caret-color: var(--accent);
}
.field textarea { min-height: 120px; resize: none; display: block; field-sizing: content; }
.field input::placeholder, .field textarea::placeholder { color: #71717a; }
.form .btn { margin-top: 16px; }
.form-note { margin-top: 10px; font-size: 13px; color: var(--text-tertiary); text-align: center; }
.form-result {
    display: none;
    text-align: center;
    padding: 36px 20px;
    background: var(--bg-surface);
    border-radius: var(--r-row);
}
.form-result svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--live); }
.form-result h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.form-result p { color: var(--text-secondary); font-size: 15px; }
.form.is-sent .form-fields { display: none; }
.form.is-sent .form-result { display: block; }
.form-error { display: none; margin-top: 10px; color: var(--danger); font-size: 14px; text-align: center; }
.form.has-error .form-error { display: block; }

/* ---------- Prose (legal pages) ---------- */
.prose { color: var(--text-secondary); font-size: 16px; line-height: 1.6; }
.prose h2 {
    margin: 32px 0 8px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
}
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul:not(.list) { margin-top: 8px; padding-left: 0; }
.prose ul:not(.list) li { position: relative; padding-left: 18px; margin-top: 6px; }
.prose ul:not(.list) li::before {
    content: '';
    position: absolute; left: 4px; top: 0.7em;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--text-tertiary);
}
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose a { color: var(--accent); }
.prose .updated { font-size: 14px; color: var(--text-tertiary); }
.prose .caps { text-transform: uppercase; font-size: 14px; letter-spacing: 0.01em; }
.prose .list { margin-top: 12px; }
.prose .list a { color: var(--text-primary); }

/* ---------- Tab bar ---------- */
.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 100;
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: rgba(12, 12, 15, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--separator);
}
.tabbar ul {
    height: var(--tabbar-h);
    max-width: 480px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.tab {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.15s;
}
.tab svg { width: 25px; height: 25px; transition: transform 0.2s var(--spring); }
.tab:active svg { transform: scale(0.88); }
.tab[aria-current="page"] { color: var(--accent); }

/* ---------- Views (JS on: one screen at a time) ---------- */
.js .view { display: none; }
.js .view.is-active { display: block; animation: view-in 0.28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Without JS every view stacks into one long page. */
html:not(.js) .view + .view { border-top: 0.5px solid var(--separator); margin-top: 24px; padding-top: 24px; }

/* ---------- Bottom sheet ---------- */
.sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - var(--safe-top) - 24px);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: var(--bg-elevated);
    color: var(--text-primary);
    overflow: hidden;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up 0.42s var(--spring); }
.sheet.is-closing { animation: sheet-down 0.26s var(--ease) forwards; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.55); animation: fade-in 0.3s var(--ease); }
.sheet.is-closing::backdrop { animation: fade-out 0.26s var(--ease) forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet-handle {
    flex-shrink: 0;
    padding: 8px 0 4px;
    display: grid;
    place-items: center;
    touch-action: none;
    cursor: grab;
}
.sheet-handle::before {
    content: '';
    width: 36px; height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.22);
}
.sheet-close {
    position: absolute;
    top: 10px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: grid; place-items: center;
    color: var(--text-secondary);
}
.sheet-close svg { width: 14px; height: 14px; }
.sheet-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 20px calc(var(--safe-bottom) + 24px);
}
.sheet-head { display: flex; gap: 16px; align-items: center; padding: 8px 0 20px; touch-action: none; }
.sheet-head .app-icon { width: 96px; height: 96px; }
.sheet-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.sheet-head p { margin-top: 4px; font-size: 15px; color: var(--text-secondary); line-height: 1.35; }
.sheet-desc { margin: 20px 0 4px; font-size: 16px; line-height: 1.55; color: var(--text-secondary); }
.sheet .list { background: rgba(255, 255, 255, 0.04); margin-top: 20px; }

/* ---------- Footer line ---------- */
.legal-line {
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-tertiary);
}

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
    :root { --gutter: 24px; }
    .large-title { padding: 32px 0 28px; }
    .large-title h1 { font-size: 44px; }
    .large-title p { font-size: 18px; max-width: 44ch; }
    .row-desc {
        display: block;
        margin-top: 6px;
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-tertiary);
    }
    .row-sub { -webkit-line-clamp: 1; }
    .products { --sep-inset: 108px; }
    .app-icon { width: 76px; height: 76px; }
    .row-main { padding: 18px 0 18px 18px; gap: 16px; }
    .product { padding-right: 18px; }
    .btn { width: auto; }
    .form .btn { min-width: 160px; }
    .form-note { text-align: left; }

    /* Sheet becomes a centered card */
    .sheet {
        inset: 0;
        margin: auto;
        width: min(520px, calc(100% - 48px));
        height: fit-content;
        max-height: min(720px, calc(100dvh - 48px));
        border-radius: 20px;
    }
    .sheet[open] { animation: pop-in 0.3s var(--spring); }
    .sheet.is-closing { animation: pop-out 0.2s var(--ease) forwards; }
    .sheet-handle { visibility: hidden; padding-top: 12px; }
    @keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
    @keyframes pop-out { to { opacity: 0; transform: scale(0.97); } }

    /* Tab bar floats as a pill */
    .tabbar {
        inset: auto 0 calc(16px + var(--safe-bottom)) 0;
        width: max-content;
        margin: 0 auto;
        padding: 0 8px;
        border: 0.5px solid var(--separator);
        border-radius: 999px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    }
    .tabbar ul { height: 56px; grid-template-columns: repeat(3, 96px); }
}

@media (hover: hover) {
    a.cell:hover, button.cell:hover { background: rgba(255, 255, 255, 0.03); }
    .row-main:hover .row-name { color: var(--accent); }
    .pill:hover { background: rgba(129, 140, 248, 0.24); }
    .tab:hover { color: var(--text-secondary); }
    .tab[aria-current="page"]:hover { color: var(--accent); }
    .btn:hover { background: #5558e8; }
}

/* Installed as an app: no bounce into page chrome */
@media (display-mode: standalone) {
    body { overscroll-behavior: none; }
}

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

/* ---------- Not found ---------- */
.empty { text-align: center; padding: 18vh 8px 0; }
.empty .app-icon { width: 72px; height: 72px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--text-tertiary); }
.empty .app-icon svg { width: 32px; height: 32px; }
.empty h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.empty p { margin: 8px auto 24px; color: var(--text-secondary); max-width: 30ch; }
.empty .btn { width: auto; }
