/* ==========================================================================
   VERBATIMLY — PREMIUM REFINEMENT LAYER
   Mobile-first polish on top of main.css. Colour tokens are unchanged;
   this layer only tunes type, spacing, radii, depth, and touch ergonomics.
   Philosophy: calm, editorial, quiet — hairlines over shadows, no glow.
   ========================================================================== */

:root {
    --vb-radius-sm: 10px;
    --vb-radius-md: 14px;
    --vb-radius-lg: 20px;
    --vb-hairline: 1px solid var(--vb-border-subtle);
    --vb-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
    --vb-tap: 44px;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 5rem;
    -webkit-tap-highlight-color: transparent;
}

html body {
    font-feature-settings: "ss01", "cv11", "kern";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Typography ---------------------------------------------------------- */
html body h1,
html body h2,
html body h3 {
    letter-spacing: -0.022em;
    text-wrap: balance;
}

html body h1 { line-height: 1.08; }
html body h2 { line-height: 1.15; }
html body h3 { line-height: 1.25; }
html body p, html body li { text-wrap: pretty; }

/* Figures (balances, tokens, counts) align in columns */
html body [class*="font-mono"],
html body .vb-mono-pill,
html body table td,
html body table th {
    font-variant-numeric: tabular-nums;
}

html body ::selection {
    background: rgba(37, 99, 235, 0.22);
}

/* ---- Header: quiet frosted bar, hairline instead of shadow ---------------- */
html body > header[role="banner"],
html body header[role="banner"] {
    background: var(--vb-surface-elevated) !important;
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    box-shadow: none !important;
    border-bottom: 1px solid var(--vb-border-subtle) !important;
}

/* ---- Surfaces: hairline borders, softer depth ----------------------------- */
html body .rounded-3xl { border-radius: var(--vb-radius-lg); }
html body .rounded-2xl { border-radius: var(--vb-radius-md); }

html body .shadow-xl,
html body .shadow-2xl,
html body .shadow-lg {
    box-shadow: var(--vb-shadow-card);
}

html.dark body .border-slate-200,
html.dark body .border-slate-100 {
    border-color: var(--vb-border-subtle);
}

/* ---- Buttons: confident, tactile, no gradients bleeding ------------------- */
html body .vb-btn,
html body button[type="submit"],
html body a.bg-blue-600,
html body a.bg-emerald-600,
html body a.bg-purple-600,
html body a.bg-slate-900 {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    min-height: var(--vb-tap);
}

html body a.bg-blue-600,
html body button.bg-blue-600 {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 14px -8px rgba(37, 99, 235, 0.65);
}

@media (hover: hover) and (pointer: fine) {
    html body a.bg-blue-600:hover,
    html body button.bg-blue-600:hover {
        transform: translateY(-1px);
    }
}

html body a.bg-blue-600:active,
html body button.bg-blue-600:active,
html body .vb-btn:active {
    transform: scale(0.98);
    transition-duration: 90ms;
}

/* ---- Forms: 16px text prevents iOS zoom, generous targets ----------------- */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html body select,
html body textarea {
    font-size: 16px;
    min-height: var(--vb-tap);
    border-radius: 12px;
    transition: border-color 160ms var(--ease-out-quart), box-shadow 160ms var(--ease-out-quart), background-color 160ms var(--ease-out-quart);
}

html body input:focus,
html body select:focus,
html body textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--vb-focus-ring);
}

html body :focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (min-width: 768px) {
    html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    html body select,
    html body textarea { font-size: 15px; }
}

/* ---- Mobile bottom nav: floating, rounded dock --------------------------- */
@media (max-width: 767px) {
    html body .vb-mobile-bottom-nav {
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        padding-bottom: 0;
        border: 1px solid var(--vb-border-subtle);
        border-radius: 22px;
        background: var(--vb-surface-elevated);
        backdrop-filter: saturate(170%) blur(20px);
        -webkit-backdrop-filter: saturate(170%) blur(20px);
        box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.32), 0 2px 6px rgba(15, 23, 42, 0.05);
    }

    html.dark body .vb-mobile-bottom-nav {
        box-shadow: 0 18px 40px -16px rgba(2, 6, 23, 0.9), 0 0 0 1px rgba(148, 163, 184, 0.06);
    }

    html body .vb-mobile-bottom-nav-grid {
        padding: 0.3rem;
    }

    html body .vb-mobile-nav-item {
        border-radius: 16px;
        min-height: 3.4rem;
    }

    html body .vb-mobile-nav-item::before { display: none; }

    html body .vb-mobile-nav-item.is-active .vb-mobile-nav-icon {
        transform: none;
        width: 3rem;
        border-radius: 12px;
    }

    html body .vb-mobile-nav-label {
        font-size: 0.65rem;
        letter-spacing: 0.005em;
    }

    /* Give content room above the floating dock */
    html body main#main-content {
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    }

    html body .vb-toast-stack {
        bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    }

    /* Comfortable reading gutters on small screens */
    html body main .max-w-7xl,
    html body main .max-w-6xl,
    html body main .max-w-5xl,
    html body main .max-w-4xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ---- Tables: scroll gracefully on phones --------------------------------- */
html body .overflow-x-auto,
html body .vb-table-wrap {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: var(--vb-radius-md);
}

/* ---- Scrollbars (desktop) ------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
    html { scrollbar-width: thin; scrollbar-color: var(--vb-border) transparent; }
}

/* ---- Footer: calmer ------------------------------------------------------ */
html body footer[role="contentinfo"] {
    border-top: 1px solid var(--vb-border-subtle);
}

/* ---- Respect user motion preferences ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html body *,
    html body *::before,
    html body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
