/* ============================================================
   AllGravi V1 — Base & Typography
   Reset + body styling. Pure custom CSS, no framework deps.
   ============================================================ */

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

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-800);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv11', 'ss01';
}

/* ── Headings ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.h-display {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.h-display em { font-style: italic; }

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0; }

/* ── Links ────────────────────────────────────────────────── */
a {
    color: var(--ink-900);
    text-decoration: none;
    transition: color 120ms ease;
}
a:hover { color: var(--ink-600); }

/* ── Mono helpers ─────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ── Eyebrow / kicker patterns ────────────────────────────── */
.kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-500);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.kicker::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--signal);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-500);
    font-weight: 500;
}

/* ── Layout primitives ────────────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-px);
    padding-right: var(--container-px);
    width: 100%;
}

.stack > * + * { margin-top: var(--gap-4); }

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
    background: var(--signal);
    color: var(--signal-ink);
}

/* ── Scrollbar (subtle) ───────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--ink-150);
    border-radius: 999px;
    border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ── Utility helpers (minimal, only what's actually used) ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-muted   { color: var(--ink-500); }
.text-soft    { color: var(--ink-400); }
.text-ink     { color: var(--ink-900); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

.text-xs { font-size: 12px; line-height: 1.4; }
.text-sm { font-size: 13px; line-height: 1.5; }
.text-md { font-size: 15px; line-height: 1.55; }
.text-lg { font-size: 17px; line-height: 1.5; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.strong { font-weight: 600; }

.ta-left   { text-align: left; }
.ta-center { text-align: center; }
.ta-right  { text-align: right; }

/* ── Form controls ──────────────────────────────────────── */
.v1-form input[type="text"],
.v1-form input[type="email"],
.v1-form input[type="password"],
.v1-form input[type="url"],
.v1-form input[type="number"],
.v1-form input[type="tel"],
.v1-form input[type="search"],
.v1-form input[type="date"],
.v1-form input[type="datetime-local"],
.v1-form select,
.v1-form textarea,
input.v1-input,
select.v1-input,
textarea.v1-input,
/* opportunistic: pick up legacy Tailwind-flavoured form classes */
input.input,
select.select,
textarea.textarea,
input[class*="px-4"],
select[class*="px-4"],
textarea[class*="px-4"] {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink-900);
    line-height: 1.4;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.v1-form input[type="text"]:focus,
.v1-form input[type="email"]:focus,
.v1-form input[type="password"]:focus,
.v1-form input[type="url"]:focus,
.v1-form input[type="number"]:focus,
.v1-form input[type="tel"]:focus,
.v1-form input[type="search"]:focus,
.v1-form input[type="date"]:focus,
.v1-form input[type="datetime-local"]:focus,
.v1-form select:focus,
.v1-form textarea:focus,
input.v1-input:focus,
select.v1-input:focus,
textarea.v1-input:focus,
input.input:focus,
select.select:focus,
textarea.textarea:focus,
input[class*="px-4"]:focus,
select[class*="px-4"]:focus,
textarea[class*="px-4"]:focus {
    outline: none;
    border-color: var(--ink-900);
    box-shadow: 0 0 0 3px rgba(200, 248, 73, 0.35);
}

.v1-form textarea,
textarea.v1-input,
textarea.textarea {
    resize: vertical;
    min-height: 96px;
    font-family: var(--font-body);
}

.v1-form-group + .v1-form-group { margin-top: 16px; }

.v1-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.v1-help {
    font-size: 12px;
    color: var(--ink-500);
    margin-top: 4px;
}

.v1-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* ── Auth card (centered single-column page) ───────────── */
.v1-auth-shell {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.v1-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--ink-150);
    border-radius: var(--radius-md);
    padding: 32px 28px;
}

.v1-auth-card .v1-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.v1-auth-card .v1-auth-header .kicker { display: block; margin-bottom: 8px; }

.v1-auth-card h1 {
    font-family: var(--font-display);
    font-size: 30px;
    color: var(--ink-900);
    line-height: 1.1;
    margin-bottom: 6px;
}

.v1-auth-card .v1-auth-sub {
    color: var(--ink-500);
    font-size: 14px;
}

.v1-auth-card .v1-auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ink-100);
    text-align: center;
    font-size: 13px;
    color: var(--ink-500);
}

.v1-auth-card .v1-auth-footer a {
    color: var(--ink-900);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--signal);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* ── Extra utilities ───────────────────────────────────── */
.mx-auto { margin-left: auto; margin-right: auto; }
.block { display: block; }
.inline-block { display: inline-block; }

.max-w-sm { max-width: 360px; }
.max-w-md { max-width: 440px; }
.max-w-lg { max-width: 560px; }
.max-w-xl { max-width: 720px; }
.max-w-2xl { max-width: 880px; }
.max-w-3xl { max-width: 1040px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }

.mt-1 { margin-top: 4px; }
.mt-12 { margin-top: 48px; }
.mb-1 { margin-bottom: 4px; }
.mb-12 { margin-bottom: 48px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }

.justify-center { justify-content: center; }
.gap-5 { gap: 20px; }

.h-200 { height: 200px; }
.h-320 { height: 320px; }

.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-2xl { border-radius: var(--radius-lg); }
.rounded-pill { border-radius: var(--radius-pill); }

.border { border: 1px solid var(--ink-150); }
.border-t { border-top: 1px solid var(--ink-150); }
.border-b { border-bottom: 1px solid var(--ink-150); }

.bg-surface { background: var(--surface); }
.bg-paper   { background: var(--paper); }

.shadow-sm { box-shadow: 0 1px 2px rgba(20, 22, 26, 0.04); }

