/* ui/css/base.css
   Reset, scrollbar, typography, containers/grid/flex utilities, page hero + prose.
   Loaded: every page. Registered in core/assets.php. */

/* ═══════════════════════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; }
/* Only glyph-style SVGs without their own fill inherit text colour; stroke icons keep fill="none". */
svg:not([fill]) { fill: currentColor; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--bg-card); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

::selection { background: rgba(249,115,22,0.28); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ═══════════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.15;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

p { color: var(--text-secondary); line-height: 1.7; text-wrap: pretty; }

/* Highlight word inside a heading: a single confident brand colour (no rainbow gradient). */
.text-gradient {
    color: var(--text-accent);
    -webkit-text-fill-color: currentColor;
}

.text-gradient-blue { color: #7aa7ff; }

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
═══════════════════════════════════════════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 12px 24px;
}

.container-sm {
    width: 100%;
    max-width: var(--container-sm);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: var(--gap-2xl) 0; }
.section-sm { padding: var(--gap-xl) 0; }
.section-alt,
.section-band {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto var(--gap-lg);
}

/* Eyebrow label above section titles. Quiet by design: small caps text, no pill. */
.section-badge,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-accent);
    margin-bottom: 14px;
}
.section-badge::before,
.section-eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.section-title { margin-bottom: 14px; }

.section-desc {
    max-width: 580px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PAGE HERO (inner pages: pricing, docs, downloads, legal, about, contact)
═══════════════════════════════════════════════════════════════════════════════ */
.page-hero {
    position: relative;
    padding: 72px 0 56px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(640px 280px at 50% 42%, rgba(249,115,22,0.075) 0%, transparent 70%),
        var(--bg-base);
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(50% 70% at 50% 45%, #000 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(50% 70% at 50% 45%, #000 0%, transparent 100%);
    pointer-events: none;
}
.page-hero > .container { position: relative; }
.page-hero h1 { margin: 0 auto 14px; max-width: 820px; }
.page-hero-desc { font-size: 1.08rem; max-width: 600px; margin: 0 auto; }
.page-hero-meta { font-size: 0.875rem; color: var(--text-muted); }
.page-hero--flush { border-bottom: 0; padding-bottom: 32px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   PROSE (legal, about, billing)
═══════════════════════════════════════════════════════════════════════════════ */
.prose {
    max-width: 740px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.8;
}
.prose > * + * { margin-top: 16px; }
.prose h2 {
    font-size: 1.3rem;
    margin-top: 48px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.02rem; margin-top: 28px; }
.prose h2 + p, .prose h3 + p, .prose h2 + ul, .prose h3 + p { margin-top: 12px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose a { color: var(--text-accent); text-decoration: underline; text-decoration-color: rgba(249,115,22,0.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul { display: flex; flex-direction: column; gap: 8px; padding-left: 4px; }
.prose ul li { position: relative; padding-left: 20px; }
.prose ul li::before { content: ''; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.8; }
.prose-links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 36px !important; padding-top: 24px; border-top: 1px solid var(--border); }
.prose-links a { text-decoration: none; font-weight: 500; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .container, .container-sm { padding: 0 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-hero { padding: 48px 0 40px; }
}
