/* =========================================================================
   snazel • PGP — unified light/dark styles with consistent card accents
   ======================================================================= */

/* --- Theme variables ---------------------------------------------------- */
:root {
  color-scheme: light dark;

  --bg: #f7f7f7;
  --fg: #0f172a;
  --muted: #3d556b;
  --card: #ffffff;
  --border: #e2e8f0;

  --brand: #005689;     /* snazel blue */
  --brand-2: #197CAA;   /* lighter blend for header gradient */
  --accent: #0ea5e9;
  --accent-strong: #0284c7;

  --pill-bg: #0f172a;
  --knob: #ffffff;

  --btn-primary-bg: #0ea5e9;
  --btn-primary-fg: #ffffff;
  --btn-ghost-bg: transparent;
  --btn-ghost-fg: #0f172a;
  --btn-ghost-border: #cbd5e1;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;

  /* unified card shadow for all cards */
  --card-shadow: 0 2px 8px rgba(0,0,0,.05), 0 8px 28px rgba(0,0,0,.08);
  --card-shadow-hover: 0 4px 10px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.10);
}

/* Dark theme */
html[data-theme="dark"] {
  --bg: #0b1220;
  --fg: #e5e7eb;
  --muted: #a7b0bd;
  --card: #111827;
  --border: #1f2937;

  --brand: #0b2540;
  --brand-2: #0d2f52;

  --accent: #38bdf8;
  --accent-strong: #22a5e2;

  --pill-bg: #111827;
  --knob: #38bdf8;

  --btn-primary-bg: #38bdf8;
  --btn-primary-fg: #0b1220;
  --btn-ghost-bg: transparent;
  --btn-ghost-fg: #e5e7eb;
  --btn-ghost-border: #374151;
}

/* --- Base layout -------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 18px 40px;
}

/* --- Header ------------------------------------------------------------- */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(0deg, var(--brand-2), var(--brand));
  border-radius: var(--radius);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,.08);
}
.header-right { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 700; letter-spacing: .2px; }
.badge {
  font-size: .85rem; opacity: .95;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.12);
}

/* --- Cards: now ALL have the blue accent bar --------------------------- */
.card {
  margin-top: 18px;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  /* blue accent on every card */
  border-left: 6px solid var(--brand);

  box-shadow: var(--card-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

/* no special casing for .card.intro anymore */
/* .card.intro { } */

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.card h1 { margin: 6px 0 10px; font-size: 1.8rem; }
.card h2 { margin: 0 0 8px; font-size: 1.4rem; }
.card p { color: var(--muted); line-height: 1.6; }

/* --- Details grid ------------------------------------------------------- */
.meta {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin-top: 8px;
}
.meta > div:first-child { color: var(--muted); }
.kmono { font-family: var(--mono); letter-spacing: .02em; }
.kpill {
  display: inline-block;
  background: var(--pill-bg);
  color: #fff;
  font-family: var(--mono);
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* --- Buttons ------------------------------------------------------------ */
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-ghost-border);
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-fg);
  font-weight: 600; text-decoration: none;
  cursor: pointer;
  transition: transform .02s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

/* --- Code / pre --------------------------------------------------------- */
.code {
  background: var(--pill-bg);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
  font-family: var(--mono);
  font-size: .9rem;
}

/* --- Theme toggle pill -------------------------------------------------- */
.theme-toggle {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  width: 56px; height: 28px;
  padding: 0 8px;
  border: 0; border-radius: 999px;
  background: var(--pill-bg);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.25) inset;
  transition: background .2s ease;
}
.theme-toggle .sun,
.theme-toggle .moon { font-size: 14px; opacity: .7; }
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--knob);
  transform: translateX(0);
  transition: transform .2s ease, background-color .2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.theme-toggle[aria-pressed="true"] .knob { transform: translateX(28px); }

/* --- Small screens ------------------------------------------------------ */
@media (max-width: 760px) {
  .meta { grid-template-columns: 130px 1fr; }
  .card h1 { font-size: 1.5rem; }
}

/* --- Utility ------------------------------------------------------------ */
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.notice { color: var(--muted); }
