/* ============================================================
   <jag/> base.css — reset + body + element defaults
   Depends on tokens.css (loaded before this file)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  background: var(--bg-desktop) fixed, var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* On a dark window interior, drop the desktop gradient for a flat fill. */
[data-theme="dark"] body { background: var(--bg); }

/* ---- Headings ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--w-medium);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  margin: 0 0 var(--s-4);
}
h1 { font-size: var(--t-display-md); }
h2 { font-size: var(--t-display-sm); }
h3 { font-size: var(--t-body-lg); line-height: 1.3; }
h4 { font-size: var(--t-body); }

/* ---- Body copy ---- */
p {
  margin: 0 0 var(--s-4);
  max-width: 65ch;
}

/* ---- Links — signal underline, fill on hover ---- */
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: background var(--motion-fast);
}
a:hover {
  background: var(--accent);
  color: var(--surface);
}

/* ---- Brand mark ---- */
.jag-mark {
  font-family: var(--font-mono);
  font-weight: var(--w-medium);
  letter-spacing: var(--tr-mark);
}

/* ---- Buttons ----
   .btn         solid ink button
   .btn-ghost   outlined
   .btn-bracket the site's signature: light fill, thin border, < label /> */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  padding: var(--s-3) var(--s-5);
  background: var(--fg);
  color: var(--surface);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: opacity var(--motion-fast);
  text-decoration: none;
}
.btn:hover { opacity: 0.85; background: var(--fg); color: var(--surface); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg);
}
.btn-ghost:hover { background: transparent; color: var(--fg); opacity: 0.6; }

/* The site's actual buttons: light chip with a thin border and orange brackets. */
.btn-bracket {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  font-family: var(--font-mono);
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  padding: var(--s-3) var(--s-5);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--motion-fast), background var(--motion-fast);
  text-decoration: none;
}
.btn-bracket::before { content: "<"; color: var(--accent); }
.btn-bracket::after  { content: "/>"; color: var(--accent); }
.btn-bracket:hover { border-color: var(--accent); background: var(--surface); }

/* ---- Code ---- */
pre {
  font-family: var(--font-mono);
  font-size: var(--t-body-sm);
  line-height: var(--lh-mono);
  background: var(--c-ink);
  color: var(--c-paper);
  padding: var(--s-4);
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 0 0 var(--s-4);
}
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(14, 14, 14, 0.06);
  padding: 0.1em 0.3em;
  border-radius: var(--r-sm);
}
[data-theme="dark"] code { background: rgba(255, 255, 255, 0.10); }
pre code { background: transparent; padding: 0; font-size: 1em; }

/* ---- Pull quote ---- */
.pullquote {
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding-left: var(--s-4);
  margin: var(--s-6) 0;
  font-size: var(--t-body-lg);
  color: var(--fg-muted);
  max-width: 65ch;
}

/* ---- Meta strip ---- */
.meta {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* ---- Dividers ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--s-8) 0;
  border: none;
}
.divider-signal {
  height: 2px;
  width: 48px;
  background: var(--accent);
  margin: var(--s-5) 0;
  border: none;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

/* The window + construction-tape motif (.window / .tape / .win-chip /
   .win-dot / .win-body) is part of the canonical design system but
   intentionally NOT used on jag3d or works — those projects keep the
   flat-editorial composition. The motif specs live in
   --documentacion/jag-design-system/project/base.css if needed later. */

/* ---- Form inputs ---- */
input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--t-body);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--motion-fast);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--s-2);
  text-transform: lowercase;
}

/* ---- Tags ---- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  padding: 2px 8px;
  background: var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  letter-spacing: 0.02em;
}

/* ---- Containers ---- */
.container       { max-width: 720px;  margin: 0 auto; padding: 0 var(--s-5); }
.container-wide  { max-width: 960px;  margin: 0 auto; padding: 0 var(--s-5); }
.container-full  { max-width: 1200px; margin: 0 auto; padding: 0 var(--s-5); }

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

/* ---- Selection ---- */
::selection { background: var(--accent); color: var(--surface); }
