/* ============================================================
   PMK17labs — Colors & Type Foundations
   Inspired by xAI: dark-first, monospace-driven, brutalist-minimal.
   Two typefaces only:
     - Geist Mono   → display + buttons + tags (monospace as luxury)
     - Inter        → body + secondary headings (clean sans-serif)
   Loaded from Google Fonts as substitutes for GeistMono / universalSans.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500&family=Inter:wght@300;400;500;600&display=swap");

:root {
  /* ---------- Colors ---------- */
  /* Canvas */
  --bg:                #1f2228;        /* warm near-black, never #000 */
  --bg-elevated:       rgba(255, 255, 255, 0.05);
  --bg-hover:          rgba(255, 255, 255, 0.08);
  --bg-subtle:         rgba(255, 255, 255, 0.03);

  /* Foreground */
  --fg1:               #ffffff;        /* primary text, headings, links */
  --fg2:               rgba(255, 255, 255, 0.7);   /* secondary, descriptions */
  --fg3:               rgba(255, 255, 255, 0.5);   /* muted, hover, timestamps */
  --fg4:               rgba(255, 255, 255, 0.3);   /* placeholder, disabled */

  /* Borders */
  --border:            rgba(255, 255, 255, 0.1);   /* default */
  --border-strong:     rgba(255, 255, 255, 0.2);   /* active/emphasis */

  /* Interactive */
  --link:              #ffffff;
  --link-hover:        rgba(255, 255, 255, 0.5);   /* dim, not brighten */

  /* Inverse (for primary buttons + light surfaces) */
  --inverse-bg:        #ffffff;
  --inverse-fg:        #1f2228;
  --inverse-bg-hover:  rgba(255, 255, 255, 0.9);

  /* Focus */
  --ring:              rgba(59, 130, 246, 0.5);    /* keyboard focus only */

  /* ---------- Type ---------- */
  --font-mono:   "Geist Mono", ui-monospace, SFMono-Regular, "Roboto Mono",
                 Menlo, Monaco, "Liberation Mono", "DejaVu Sans Mono",
                 "Courier New", monospace;
  --font-sans:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;

  /* Sizes (rem-based, 1rem = 16px) */
  --t-display:   20rem;       /* 320px — the brand statement */
  --t-h1:        4.5rem;      /* 72px  — section opener */
  --t-h2:        3rem;        /* 48px  — sub-section */
  --t-h3:        1.875rem;    /* 30px  — block heading */
  --t-h4:        1.375rem;    /* 22px  — card title */
  --t-body:      1rem;        /* 16px  — reading */
  --t-button:    0.875rem;    /* 14px  — buttons, nav */
  --t-label:     0.875rem;    /* 14px  — form labels, captions */
  --t-meta:      0.75rem;     /* 12px  — tags, footnotes */

  /* Line heights */
  --lh-tight:    1.2;
  --lh-display:  1.5;
  --lh-body:     1.5;

  /* Letter-spacing */
  --ls-button:   0.1em;       /* ~1.4px at 14px */
  --ls-tag:      0.083em;     /* ~1px  at 12px */

  /* ---------- Spacing (8px grid, sparse) ---------- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  16px;
  --s-4:  24px;
  --s-5:  32px;
  --s-6:  48px;
  --s-7:  64px;
  --s-8:  96px;
  --s-9:  128px;

  /* ---------- Radii (sharp by default) ---------- */
  --r-0:  0px;        /* default — brutalist sharp */
  --r-1:  4px;        /* secondary containers only */
  --r-pill: 999px;    /* used very sparingly */

  /* ---------- Layout ---------- */
  --container:   1200px;
  --gutter:      24px;
}

/* ============================================================
   Element baselines
   ============================================================ */
html, body {
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--fg1); color: var(--bg); }

/* Headings */
.t-display {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 14vw, var(--t-display));
  font-weight: 300;
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
}
h1, .t-h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 6vw, var(--t-h1));
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0;
}
h2, .t-h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, var(--t-h2));
  font-weight: 400;
  line-height: var(--lh-tight);
  margin: 0;
}
h3, .t-h3 {
  font-family: var(--font-sans);
  font-size: var(--t-h3);
  font-weight: 400;
  line-height: var(--lh-tight);
  margin: 0;
}
h4, .t-h4 {
  font-family: var(--font-sans);
  font-size: var(--t-h4);
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
}

p, .t-body {
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--fg2);
  margin: 0;
}

.t-mono {
  font-family: var(--font-mono);
  font-weight: 400;
}

.t-tag {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--ls-tag);
  color: var(--fg2);
}

.t-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--ls-tag);
  color: var(--fg3);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-hover); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-6) 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-button);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--ls-button);
  padding: 12px 24px;
  border-radius: var(--r-0);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
}
.btn--primary:hover {
  background: var(--inverse-bg-hover);
  color: var(--inverse-fg);
}
.btn--ghost {
  background: transparent;
  color: var(--fg1);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg1);
}
.btn--link {
  background: transparent;
  color: var(--fg1);
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
}
.btn--link:hover { color: var(--link-hover); }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label {
  font-family: var(--font-sans);
  font-size: var(--t-label);
  color: var(--fg2);
}
.input, .textarea, .select {
  background: transparent;
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-0);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--fg4); }
.input:hover, .textarea:hover, .select:hover { border-color: rgba(255, 255, 255, 0.35); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--fg1);
  box-shadow: 0 0 0 2px var(--ring);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-0);
  padding: var(--s-4);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover { border-color: var(--border-strong); }

/* ============================================================
   Tags / Badges
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--ls-tag);
  color: var(--fg1);
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-0);
  background: transparent;
}
