/* ===========================================================================
   base.css — design tokens, reset, typography, primitives
   Identity: slate ink on a cool paper canvas, one amber accent, editorial
   spacing. Deliberately unlike either reference site (no centered template
   hero, no purple gradient, no card-with-huge-radius look).
   ========================================================================= */

:root {
  /* surfaces */
  --canvas: #f4f6f9;
  --canvas-deep: #eceff5;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e2e7f0;

  /* ink */
  --ink: #151a22;
  --ink-2: #495464;
  --ink-3: #77828f;
  --ink-inv: #f7f9fc;

  /* lines */
  --line: #dde3ec;
  --line-2: #c3ccd9;

  /* accent — amber, darkened so text keeps AA contrast on paper */
  --accent: #b4530d;
  --accent-bright: #f59e0b;
  --accent-deep: #8a3d05;
  --accent-soft: #fdf0e0;
  --accent-line: #f0cfa4;

  /* structural slate */
  --slate: #2b3a52;
  --slate-2: #405473;
  --slate-soft: #e6ecf5;

  /* status */
  --ok: #14663a;
  --ok-soft: #e2f3e8;
  --bad: #a91f1f;
  --bad-soft: #fbe9e9;
  --warn: #97650a;

  /* category hues (chip + tile accents) */
  --cat-amber: #b4530d;   --cat-amber-bg: #fdf0e0;
  --cat-teal: #0f6b6b;    --cat-teal-bg: #dff1ef;
  --cat-violet: #5b3d94;  --cat-violet-bg: #ece6f8;
  --cat-rose: #9d2a55;    --cat-rose-bg: #fbe6ec;
  --cat-cyan: #1a5f82;    --cat-cyan-bg: #e0eff7;
  --cat-slate: #3b4a61;   --cat-slate-bg: #e7ebf1;
  --cat-lime: #4b6b13;    --cat-lime-bg: #eaf3da;
  --cat-orange: #a4470f;  --cat-orange-bg: #fceadf;

  /* type */
  --font-display: "Space Grotesk", "Segoe UI Semibold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;

  /* rhythm */
  --wrap: 1180px;
  --gutter: clamp(18px, 4vw, 44px);
  --section-gap: clamp(64px, 9vw, 116px);

  /* shape */
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* elevation — slate-tinted so it never looks muddy on paper */
  --sh-1: 0 1px 2px rgba(21, 26, 34, .05), 0 2px 6px rgba(21, 26, 34, .04);
  --sh-2: 0 2px 4px rgba(21, 26, 34, .06), 0 10px 24px rgba(21, 26, 34, .07);
  --sh-3: 0 18px 48px rgba(21, 26, 34, .14), 0 4px 12px rgba(21, 26, 34, .08);

  --header-h: 68px;
  --ease: cubic-bezier(.22, .68, .32, 1);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15.5px, .55vw + 14px, 17px);
  line-height: 1.62;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
[hidden] { display: none !important; }

/* The full-text print sheet is built into the page but must stay invisible on
   screen. It cannot live in print.css, because that file is linked with
   media="print" and therefore never applies while browsing. */
.print-only { display: none; }

/* ------------------------------------------------------------ typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.018em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.15rem, 5.2vw, 3.5rem); font-weight: 700; letter-spacing: -.032em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.3rem); letter-spacing: -.026em; }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.32rem); }
h4 { font-size: 1rem; }
.sub-title {
  font-family: var(--font-display);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.kicker, .eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-lede { max-width: 62ch; color: var(--ink-2); margin: 12px 0 0; }
.prose p { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  color: var(--slate);
}
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ------------------------------------------------------------- utilities */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  transform: translateY(-160%);
  background: var(--slate); color: var(--ink-inv);
  padding: 10px 16px; border-radius: var(--r); text-decoration: none; font-weight: 600;
  box-shadow: var(--sh-2);
}
.skip-link:focus { transform: none; color: var(--ink-inv); }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-deep); font: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.req { color: var(--accent); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 600; letter-spacing: .005em;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s, border-color .16s, color .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-1); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.btn-primary {
  background: var(--slate); border-color: var(--slate); color: var(--ink-inv);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, var(--sh-1);
}
.btn-primary:hover { background: #22304a; border-color: #22304a; color: var(--ink-inv); }
.btn-primary .btn-ico { color: var(--accent-bright); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.btn-quiet { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-3); color: var(--ink); }
.btn-sm { padding: 8px 13px; font-size: .85rem; }
.btn-ico { font-weight: 700; }

/* ----------------------------------------------------------------- input */
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--slate-2); }
.input:focus-visible,
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent-line);
}
.input[type="search"] { padding-left: 38px; background-image: var(--icon-search); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.55; }
.input[aria-invalid="true"] { border-color: var(--bad); background: #fffcfc; }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--bad-soft), 0 0 0 4px #e6b3b3; }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  font-size: .78rem; font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: .01em;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-btn { cursor: pointer; transition: background .14s, border-color .14s, color .14s, transform .14s var(--ease); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.chip-solid { background: var(--slate-soft); border-color: transparent; color: var(--slate); }

/* ------------------------------------------------------------------- icons */
/* One primitive for every mark in js/modules/icons.js. Colour always comes
   from currentColor, so the surrounding component decides the tint. */
.ico { display: block; width: 1em; height: 1em; flex: none; overflow: visible; }
.skill-mark .ico { width: 22px; height: 22px; }
.chip .ico { width: 13px; height: 13px; }
.cert-seal .ico { width: 20px; height: 20px; }
.award-medal .ico { width: 23px; height: 23px; }
.ach-ico .ico { width: 17px; height: 17px; }
.td-mark .ico { width: 24px; height: 24px; }

/* per-category tints */
.hue-amber  { --h: var(--cat-amber);  --hb: var(--cat-amber-bg); }
.hue-teal   { --h: var(--cat-teal);   --hb: var(--cat-teal-bg); }
.hue-violet { --h: var(--cat-violet); --hb: var(--cat-violet-bg); }
.hue-rose   { --h: var(--cat-rose);   --hb: var(--cat-rose-bg); }
.hue-cyan   { --h: var(--cat-cyan);   --hb: var(--cat-cyan-bg); }
.hue-slate  { --h: var(--cat-slate);  --hb: var(--cat-slate-bg); }
.hue-lime   { --h: var(--cat-lime);   --hb: var(--cat-lime-bg); }
.hue-orange { --h: var(--cat-orange); --hb: var(--cat-orange-bg); }
.hue-amber, .hue-teal, .hue-violet, .hue-rose,
.hue-cyan, .hue-slate, .hue-lime, .hue-orange { color: var(--h); background: var(--hb); border-color: transparent; }

/* ------------------------------------------------------ focus & motion */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible, .chip:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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