/* ==========================================================================
   TESIAVAULT — base.css
   Design tokens, reset, typography, links, focus, layout + a11y helpers.
   Loaded first on every page (public and auth).
   ========================================================================== */

:root {
  /* Palette */
  --c-black: #111111;
  --c-red: #E82127;
  --c-red-dark: #C2181D;          /* hover / pressed */
  --c-red-tint: #FDECEC;
  --c-white: #FFFFFF;
  --c-graphite: #30343B;
  --c-gray-50: #F3F4F6;
  --c-muted: #6B7280;
  --c-border: #E5E7EB;
  --c-ink-2: #1B1D21;             /* raised surface on black */
  --c-ink-line: rgba(255, 255, 255, 0.12);
  --c-on-dark-muted: #A7ABB3;     /* 7.6:1 on #111 */
  --c-success: #0F7B4A;
  --c-success-tint: #E7F5EE;
  --c-warn: #8A5A00;
  --c-warn-tint: #FFF6E0;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.75rem, 1.35rem + 1.6vw, 2.75rem);
  --fs-hero: clamp(2.375rem, 1.5rem + 3.6vw, 4.5rem);
  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  /* Space (4px scale) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --section-y: clamp(4rem, 2.8rem + 5vw, 7.5rem);

  /* Shape + depth */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(17, 17, 17, 0.14);
  --shadow-lg: 0 24px 60px -20px rgba(17, 17, 17, 0.28);

  /* Layout */
  --container: 1240px;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 150ms;
  --t-med: 260ms;

  --focus-ring: 0 0 0 3px var(--c-white), 0 0 0 5px var(--c-red);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-black);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, picture, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; } /* the one justified !important: `hidden` must always win */

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p { text-wrap: pretty; }
strong { font-weight: 700; }
small { font-size: var(--fs-xs); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-red); }

.eyebrow {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: var(--sp-3);
}
.eyebrow--light { color: var(--c-red); }
.muted { color: var(--c-muted); }

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

/* ---------- Icons (SVG sprite) ---------- */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Button foundation (variants live in components.css) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;                 /* touch target */
  padding: 0.625rem 1.25rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- Layout utilities ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  padding: var(--sp-3) var(--sp-4); background: var(--c-black); color: var(--c-white);
  border-radius: var(--r-md); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--sp-4); }

.placeholder-link { color: inherit; opacity: 0.75; }
.placeholder-link em { font-style: normal; font-size: 0.85em; opacity: 0.8; }

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