/* unignosis — base.css
   Design tokens, reset, typography, layout primitives.
   Inter (UI) + Fraunces (display) self-hosted. System fallback covers
   the case where fonts haven't been fetched yet. */

/* ---------- Fonts (self-hosted, fetched by scripts/fetch-fonts.sh) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2-variations"),
       url("/assets/fonts/Inter-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2-variations"),
       url("/assets/fonts/Fraunces-Variable.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour — brand */
  --ink:        #0A0A0F;
  --ink-2:      #1F2024;
  --ink-3:      #4A4D55;
  --ink-mute:   #767982;
  --paper:      #FFFFFF;
  --paper-2:    #FAFAF9;
  --paper-3:    #F1F1F0;
  --line:       #E6E5E1;

  --orange:     #F58220;
  --orange-2:   #E16F0E;
  --orange-pale:#FFEEDB;

  --navy:       #0D2B4A;
  --navy-2:     #163A60;
  --navy-pale:  #E6EEF8;

  --ok:         #1F8A4C;
  --warn:       #B26B00;
  --err:        #B43A2A;

  /* Type */
  --font-ui:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-disp:  "Fraunces", ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono:  ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Type scale (clamp for fluid responsive) */
  --fs-xs:   0.8125rem;                            /* 13 */
  --fs-sm:   0.9375rem;                            /* 15 */
  --fs-base: 1rem;                                 /* 16 */
  --fs-md:   1.0625rem;                            /* 17 */
  --fs-lg:   clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  --fs-xl:   clamp(1.375rem, 1vw + 1.1rem, 1.6875rem);
  --fs-2xl:  clamp(1.75rem, 1.6vw + 1.2rem, 2.25rem);
  --fs-3xl:  clamp(2.25rem, 2.5vw + 1.4rem, 3.125rem);
  --fs-4xl:  clamp(2.75rem, 3.6vw + 1.6rem, 4.375rem);

  /* Spacing — 4px base, 1.5x rhythm at upper end */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;
  --s-32: 128px;

  /* Radius */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(10, 10, 15, 0.04), 0 1px 1px rgba(10, 10, 15, 0.03);
  --shadow-2: 0 4px 12px rgba(10, 10, 15, 0.06), 0 2px 4px rgba(10, 10, 15, 0.04);
  --shadow-3: 0 12px 32px rgba(10, 10, 15, 0.08), 0 4px 8px rgba(10, 10, 15, 0.04);
  --shadow-orange: 0 6px 20px rgba(245, 130, 32, 0.25);

  /* Layout */
  --container: 1200px;
  --container-narrow: 880px;
  --gutter: clamp(20px, 4vw, 40px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 150ms;
  --t-med: 280ms;
  --t-slow: 480ms;
}

/* ---------- Reset (modern, minimal) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; tab-size: 4; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 3px; }

/* ---------- Base typography & body ---------- */
html {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
  background: var(--paper);
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-family: var(--font-disp); font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { font-size: var(--fs-md); color: var(--ink-2); }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-2);
}

a.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color var(--t-fast) var(--ease-out);
}
a.text-link:hover { text-decoration-color: var(--ink); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: clamp(64px, 8vw, 112px);
}
.section-tight {
  padding-block: clamp(48px, 6vw, 80px);
}
.stack > * + * { margin-top: var(--s-stack, var(--s-6)); }
.stack-sm { --s-stack: var(--s-3); }
.stack-md { --s-stack: var(--s-6); }
.stack-lg { --s-stack: var(--s-12); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}

.grid { display: grid; gap: var(--s-6); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Visually hidden but accessible to screen readers */
.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;
}

/* Skip-link for keyboard users */
.skip-link {
  position: absolute; top: -40px; left: 16px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: var(--r-2);
  z-index: 1000;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus { top: 12px; }

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