/* StrainlessAI v1 — shared base. Tokens and components follow design-system/strainless/MASTER.md. */

/* ---------- Fonts (self-hosted, Latin subset, 600 = bold) ---------- */
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/lora-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (light only) ---------- */
:root {
  color-scheme: light;

  --bg: #F5F7F6;
  --surface: #FFFFFF;
  --text: #14232A;
  --muted: #4B5A62;
  --line: #CFDADD;
  --line-strong: #7A8B92;
  --chip: #E6EDEE;
  --accent: #0B5D73;
  --accent-hover: #094C5E;
  --accent-soft: #E0EFF2;
  --on-accent: #FFFFFF;
  --focus: #1D4ED8;
  --overlay: rgba(12, 28, 34, 0.45);

  --ok: #136B2E;      --ok-soft: #E4F3E8;   --ok-line: #9FD0AB;
  --warn: #8A5A00;    --warn-soft: #FFF4D6; --warn-line: #B7791F;
  --bad: #A3221A;     --bad-soft: #FBE9E7;  --bad-line: #EAB0A9;

  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-small: 0.95rem;
  --fs-tiny: 0.9rem;
  --fs-h1: 1.6rem;
  --fs-h2: 1.3rem;
  --fs-h3: 1.12rem;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-bar: 0 -1px 0 var(--line), 0 -4px 12px rgba(20, 35, 42, 0.06);
  --shadow-sheet: 0 12px 32px rgba(20, 35, 42, 0.18);

  --col: 728px;
  --header-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 768px) {
  :root { --fs-h1: 1.95rem; }
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (min-width: 768px) { html { font-size: 18px; } }

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.2; }
h2 { font-size: var(--fs-h2); line-height: 1.3; }
h3 { font-size: var(--fs-h3); line-height: 1.3; }

strong, b { font-weight: 600; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
svg { flex-shrink: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
/* Three columns with equal sides, so the title (wordmark or h1) in the middle
   is centered on the full width. Side items go in column 1; --header-side
   reserves room for them on both sides so the sides stay equal. */
.site-header-inner {
  max-width: var(--col);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--s4);
  display: grid;
  grid-template-columns:
    minmax(var(--header-side, 0px), 1fr)
    minmax(0, auto)
    minmax(var(--header-side, 0px), 1fr);
  align-items: center;
  column-gap: var(--s3);
}
.site-header-inner > * { grid-column: 1; justify-self: start; }
.site-header-inner > .wordmark,
.site-header-inner > h1 { grid-column: 2; justify-self: center; text-align: center; }
.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: 0 var(--s4);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.btn svg { width: 20px; height: 20px; }
.btn.big { min-height: 56px; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover, .btn-primary:active { background: var(--accent-hover); }

.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover, .btn-secondary:active { background: var(--accent-soft); }

.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover, .btn-danger:active { background: var(--bad-soft); }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--accent); }
.btn-secondary:disabled:hover { background: var(--surface); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  transition: background-color 150ms ease-out;
}
.icon-button:hover, .icon-button:active { background: var(--chip); }
.icon-button svg { width: 24px; height: 24px; }

/* ---------- Messages ---------- */
.message {
  border-radius: var(--radius-sm);
  padding: var(--s3);
  background: var(--accent-soft);
}
.message.error { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.message.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
