/* Preprints.ai — Design Tokens
   Warm paper-forward system derived from the logo palette.
   Sans-only, semantic color, subtle surfaces. */

:root {
  /* ── Neutrals ─ warm, paper-leaning ─────────────────── */
  --ink-900: #1a1613;   /* primary text */
  --ink-700: #322a24;   /* strong text */
  --ink-500: #5a4f45;   /* secondary text */
  --ink-400: #7a6f63;   /* muted text */
  --ink-300: #a69c8f;   /* placeholder / disabled */
  --ink-200: #cfc5b6;   /* strong rule */
  --ink-100: #e8e0d4;   /* rule / border */
  --ink-50:  #f2ede4;   /* subtle fill */

  --paper:     #faf6f0; /* page background */
  --paper-2:   #f4ede1; /* deeper paper (headers, etc) */
  --surface:   #fefcf8; /* card */
  --surface-2: #fbf7f0; /* inset / muted card */

  /* ── Brand: terracotta (from the logo) ─────────────── */
  --clay-700: #8a3d27;
  --clay-600: #a8482f;
  --clay-500: #b8553a;  /* primary accent — CTAs, focus, concerns */
  --clay-400: #cb7656;
  --clay-200: #eec8b3;
  --clay-100: #f6dcc8;
  --clay-50:  #fbf0e5;

  /* ── Support: teal (cool complement for 'good') ────── */
  --teal-700: #2f5146;
  --teal-600: #3a6557;
  --teal-500: #4a7566;  /* good / strong / pass */
  --teal-300: #8ab0a4;
  --teal-100: #d4e3dc;
  --teal-50:  #e9f1ec;

  /* ── Grade scale: teal → terracotta (two-tone) ─────── */
  --grade-a: #3a6557;   /* strong teal */
  --grade-b: #5c8277;
  --grade-c: #9a8567;   /* neutral midpoint */
  --grade-d: #b67152;
  --grade-e: #a8482f;   /* deep terracotta */

  /* Grade tint backgrounds (8% alpha on paper) */
  --grade-a-bg: #e4ede7;
  --grade-b-bg: #eaeee9;
  --grade-c-bg: #efe9de;
  --grade-d-bg: #f3e0d3;
  --grade-e-bg: #f0d9cc;

  /* ── Semantic states (muted, newsprint-y) ──────────── */
  --state-pass: #4a7566;
  --state-warn: #a87a2f;
  --state-fail: #a8482f;
  --state-info: #4a6a85;

  /* ── Radii, spacing, shadow ────────────────────────── */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  --shadow-1: 0 1px 0 rgba(26, 22, 19, 0.03), 0 1px 2px rgba(26, 22, 19, 0.04);
  --shadow-2: 0 1px 0 rgba(26, 22, 19, 0.04), 0 4px 14px rgba(26, 22, 19, 0.05);
  --shadow-focus: 0 0 0 3px rgba(184, 85, 58, 0.18);

  /* ── Type ──────────────────────────────────────────── */
  --font-sans: "Söhne", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Scale — restrained, denser than the current site */
  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base: 15px;
  --text-md:  17px;
  --text-lg:  20px;
  --text-xl:  26px;
  --text-2xl: 34px;
  --text-3xl: 44px;
  --text-4xl: 56px;

  --lh-tight: 1.12;
  --lh-snug:  1.3;
  --lh-body:  1.55;

  --tracking-tight: -0.02em;
  --tracking-normal: -0.01em;
  --tracking-wide: 0.06em;
}

/* ── Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--ink-900);
  background: var(--paper);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle paper gradient — very restrained */
body.paper-gradient {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(184, 85, 58, 0.035), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(74, 117, 102, 0.025), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(184, 85, 58, 0.2); }

/* ── Utilities ───────────────────────────────────────── */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-400);
}
.rule { height: 1px; background: var(--ink-100); border: 0; }

/* ── Components ──────────────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 var(--text-sm) / 1 var(--font-sans);
  letter-spacing: -0.005em;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  min-height: 36px;
}
.btn-primary {
  background: var(--ink-900);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink-700); }
.btn-accent {
  background: var(--clay-500);
  color: #fff;
}
.btn-accent:hover { background: var(--clay-600); }
.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border-color: var(--ink-100);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-200); }
.btn-link {
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--clay-600);
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--clay-200);
}
.btn-link:hover { text-decoration-color: var(--clay-500); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

/* Inputs */
.input {
  font: 400 var(--text-base) / 1.4 var(--font-sans);
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 10px 12px;
  min-height: 40px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-300); }
.input:focus { outline: none; border-color: var(--clay-500); box-shadow: var(--shadow-focus); }

/* Grade badge */
.grade {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.grade-lg { font-size: 56px; line-height: 1; }
.grade-md { font-size: 22px; line-height: 1; padding: 6px 12px; border-radius: var(--r-md); }
.grade-sm { font-size: 13px; line-height: 1; padding: 3px 7px; border-radius: var(--r-sm); font-weight: 600; }

.grade-A { color: var(--grade-a); }
.grade-B { color: var(--grade-b); }
.grade-C { color: var(--grade-c); }
.grade-D { color: var(--grade-d); }
.grade-E { color: var(--grade-e); }

.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--ink-100);
  background: var(--surface);
}

/* Tag / chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--ink-50);
  color: var(--ink-700);
  border: 1px solid var(--ink-100);
}
.tag-pass { background: var(--teal-50); color: var(--teal-700); border-color: #cfe0d7; }
.tag-warn { background: #f5ecd9; color: #7a5820; border-color: #e4d3b0; }
.tag-fail { background: var(--clay-100); color: var(--clay-700); border-color: var(--clay-200); }
.tag-info { background: #e6ecf2; color: #2f4a63; border-color: #c9d6e2; }

/* Section header */
.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  color: var(--ink-900);
  margin: 0 0 4px;
}
.section-sub {
  font-size: var(--text-sm);
  color: var(--ink-400);
}
