/* ═══════════════════════════════════════════════
   TRUST WIZARD: SHARED SITE STYLES
   Tokens, type, buttons, nav, footer. Every page loads this first;
   home.css, support.css and blog/blog.css add page-specific styles.
   ═══════════════════════════════════════════════ */

/* Warm dark paper-and-ink palette, gold accent; Lora for headings, Inter for text, Caveat for notes. */
:root {
    color-scheme: dark;
    --ink: #0f0d0b;            /* page */
    --ink-2: #16130f;          /* raised */
    --ink-3: #1e1a15;          /* cards */
    --line: rgba(236, 226, 205, 0.1);
    --line-strong: rgba(236, 226, 205, 0.18);
    --text: #ece6da;
    --text-2: #b5ad9f;
    --text-3: #857d70;
    --gold: #d4af37;
    --gold-2: #e8c860;
    --gold-soft: rgba(212, 175, 55, 0.12);
    --paper: #f3eee3;
    --paper-ink: #2a251e;
    --ok: #8fd18f;
    --warn: #f0b35a;
    --err: #f0907a;
    --serif: 'Lora', 'Iowan Old Style', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --hand: 'Caveat', 'Segoe Print', cursive;
    --wrap: 1160px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 14px;
    --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
/* Film grain: keeps the dark from looking like flat digital black. */
body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none; z-index: 100;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.menu-open { overflow: hidden; }
/* backdrop-filter would make the fixed menu sheet size itself to the bar, so drop it while open */
body.menu-open .navbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; border-bottom-color: transparent; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: rgba(212, 175, 55, 0.35); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--gold-2); }
p { margin: 0 0 1em; }

.kicker {
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.hand { font-family: var(--hand); color: var(--gold-2); font-size: 1.45rem; line-height: 1.2; }

/* ── buttons ───────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px; border-radius: 999px;
    font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent; transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: #17130a; }
.btn-gold:hover { background: var(--gold-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

/* ── nav ───────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 0 var(--gutter);
    transition: background .3s ease, border-color .3s ease;
    border-bottom: 1px solid transparent;
}
.navbar.scrolled, .navbar.solid { background: rgba(15, 13, 11, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; position: relative; z-index: 60; }
.nav-logo-img { width: 28px; height: 28px; }
.nav-logo-text { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-link { position: relative; font-size: 15px; color: var(--text-2); text-decoration: none; transition: color .2s; padding: 6px 0; }
/* gold rule that draws in under the link; stays under the current page */
.nav-link:not(.nav-link-cta)::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
    background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link-cta { color: #17130a; background: var(--gold); padding: 10px 18px; border-radius: 999px; font-weight: 600; }
.nav-link-cta:hover { color: #17130a; background: var(--gold-2); }
.nav-sheet-note { display: none; }

.hamburger { display: none; position: relative; z-index: 60; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer; }
.hamburger span { position: absolute; left: 11px; width: 22px; height: 1.5px; background: var(--text); transition: transform .3s ease, opacity .2s ease, top .3s ease; }
.hamburger span:nth-child(1) { top: 16px; }
.hamburger span:nth-child(2) { top: 21.5px; width: 14px; left: 19px; }
.hamburger span:nth-child(3) { top: 27px; }
.hamburger.active span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 21.5px; transform: rotate(-45deg); }

/* ── footer ────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 36px; color: var(--text-2); font-size: 15px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-brand .row { display: flex; align-items: center; gap: 10px; }
.footer-brand p { margin: 0; }
.footer-logo { width: 30px; height: 30px; }
.footer-brand-name { font-family: var(--serif); font-size: 22px; color: var(--text); }
.footer-heading { font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; font-weight: 600; }
.footer-link { display: block; text-decoration: none; padding: 4px 0; }
.footer-link:hover { color: var(--gold-2); }
.footer-disclaimer { margin: 40px 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; color: var(--text-3); }
.footer-disclaimer p { margin: 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-3); }
.footer-bottom p { margin: 0; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--gold-2); }

/* ── toast (script.js) ─────────────────────── */
.toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--ink-3); border: 1px solid var(--line-strong); color: var(--text); padding: 12px 18px; border-radius: 10px; font-size: 14.5px; animation: toastIn .3s ease; }
.toast.success { border-color: rgba(143, 209, 143, .45); }
.toast.error { border-color: rgba(240, 144, 122, .5); }
.toast.hide { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ── reveal on scroll (script.js adds .visible) ── */
/* Content is readable at rest; the reveal only adds a short lift as it scrolls in. */
.reveal { transform: translateY(14px); transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { transform: none; }

/* ── page header used by support and the blog ── */
.page-head { padding: calc(var(--nav-h) + clamp(48px, 7vw, 88px)) 0 clamp(28px, 4vw, 48px); position: relative; overflow: clip; }
.page-head::after {
    content: ''; position: absolute; z-index: -1; right: -12vw; top: -20vh; width: min(60vw, 760px); aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(212, 175, 55, 0.12), transparent 70%);
}
.page-head h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 400; margin-top: 10px; }
.page-head .lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); max-width: 38em; margin: 18px 0 0; }

@media (prefers-reduced-motion: reduce) {
    .reveal { transform: none; transition: none; }
    html { scroll-behavior: auto; }
    .nav-links, .nav-link::after, .hamburger span { transition: none !important; }
}

/* ── phone & tablet: the menu becomes a sheet ── */
@media (max-width: 900px) {
    body { font-size: 16.5px; }
    .hamburger { display: block; }
    .nav-links {
        position: fixed; inset: 0; z-index: 55;
        flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
        padding: calc(var(--nav-h) + 24px) var(--gutter) max(28px, env(safe-area-inset-bottom, 0px));
        background: radial-gradient(120% 60% at 100% 0%, rgba(212, 175, 55, 0.12), transparent 60%), var(--ink);
        opacity: 0; visibility: hidden; transform: translateY(-10px);
        transition: opacity .25s ease, transform .3s ease, visibility 0s linear .3s;
        overflow-y: auto;
    }
    .nav-links.open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .3s ease; }
    .nav-link {
        font-family: var(--serif); font-size: 30px; color: var(--text);
        padding: 14px 0; border-bottom: 1px solid var(--line);
    }
    .nav-link:not(.nav-link-cta)::after { display: none; }
    .nav-link[aria-current="page"] { color: var(--gold-2); }
    .nav-link[aria-current="page"]::before { content: '— '; color: var(--gold); }
    .nav-link.nav-link-cta {
        color: #17130a;
        margin-top: 28px; border-bottom: 0; text-align: center;
        font-family: var(--sans); font-size: 17px; padding: 16px 20px;
    }
    .nav-sheet-note { display: block; margin-top: 16px; color: var(--text-3); font-size: 14px; text-align: center; }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
