/* Shared base for the portfolio replicas. Plain CSS, no build step, no fonts to download.
   Every replica links this file, then adds its own small <style> block.
   Theme: pure white canvas in light, near-black in dark. Set by _base.js on <html data-theme>. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --surface: #f4f5f7;
  --container: #eceef1;
  --fg: #0a0a0b;
  --fg2: #2b2d31;
  --fg3: #4b4e55;
  --fg4: #62666d;
  --fg5: #71767e;
  --line: #eceef1;
  --line2: #e2e4e8;
  --line3: #cfd2d8;
  --on-fg: #ffffff;
  --accent: #1d4fd8;
  --accent-soft: rgba(29, 79, 216, 0.1);
  --ok: #0f6b35;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --warn: #964306;
  --warn-soft: rgba(180, 83, 9, 0.11);
  --bad: #c62828;
  --bad-soft: rgba(198, 40, 40, 0.1);
  --violet: #6d4bd8;
  --violet-soft: rgba(109, 75, 216, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 10, 11, 0.04), 0 8px 24px rgba(10, 10, 11, 0.06);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --panel: #111114;
  --surface: #17171b;
  --container: #212126;
  --fg: #f5f5f7;
  --fg2: #dcdde2;
  --fg3: #b3b5bd;
  --fg4: #9598a2;
  --fg5: #80838d;
  --line: rgba(255, 255, 255, 0.06);
  --line2: rgba(255, 255, 255, 0.1);
  --line3: rgba(255, 255, 255, 0.2);
  --on-fg: #0b0b0d;
  --accent: #6c95ff;
  --accent-soft: rgba(108, 149, 255, 0.16);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.015em; font-weight: 600; line-height: 1.2; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--fg); color: var(--bg); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--fg4); }
.tnum { font-variant-numeric: tabular-nums; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }

/* Surfaces */
.card {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
}
.card-pad { padding: 16px; }
.hair { border: 1px solid var(--line); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line3); border-radius: 999px;
  background: var(--panel); color: var(--fg);
  font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--surface); }
.btn-primary { background: var(--fg); color: var(--on-fg); border-color: var(--fg); }
.btn-primary:hover:not(:disabled) { background: var(--fg); opacity: 0.86; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 36px; padding: 0; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 500; color: var(--fg3); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--line3); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--fg); font-size: 14px;
}
.textarea { min-height: 84px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--fg5); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--fg4); }
.error { font-size: 12px; color: var(--bad); }

/* Badges and chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface); color: var(--fg3);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 999px;
  background: var(--panel); color: var(--fg3);
  font-size: 12.5px; font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--surface); color: var(--fg); }
.chip[aria-pressed="true"], .chip.on { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line2); border-radius: 999px; background: var(--panel); }
.seg button { min-height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--fg4); font-size: 12.5px; font-weight: 500; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg5); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[tabindex] { cursor: pointer; }
.table tbody tr[tabindex]:hover, .table tbody tr[aria-selected="true"] { background: var(--surface); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 18px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 28px); padding: 10px 16px;
  border-radius: 999px; background: var(--fg); color: var(--on-fg);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Small tag that marks every replica as sample data */
.demo-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px dashed var(--line3); color: var(--fg4);
  font-size: 11px; font-weight: 500; white-space: nowrap;
}

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