/* Shared design system for maharanay22.github.io
   Layout: one centered column (max 1120px) with a sticky top bar; sections stack with
   generous spacing; data lives in cards and tables, never in decorative panels. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --text: #13202f;
  --text-2: #3d4b5c;
  --muted: #627284;
  --line: #e2e7ee;
  --line-strong: #cfd7e2;
  --accent: #1d58b8;
  --accent-strong: #15448f;
  --accent-soft: #e9f0fb;
  --good: #1b7a4b;
  --good-soft: #e5f4ec;
  --warn: #8f5b00;
  --warn-soft: #fbf0d9;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --shadow: 0 1px 2px rgba(19, 32, 47, 0.05), 0 2px 8px rgba(19, 32, 47, 0.04);

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --gutter: 20px;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141b; --surface: #151d27; --surface-2: #1a2430; --text: #e7edf4; --text-2: #c3cdd8;
    --muted: #93a2b2; --line: #243142; --line-strong: #31415a; --accent: #7aaefc; --accent-strong: #a7c8ff;
    --accent-soft: #172a45; --good: #5ccb92; --good-soft: #13291f; --warn: #f0bd5e; --warn-soft: #2e2512;
    --bad: #f28b82; --bad-soft: #33191a; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141b; --surface: #151d27; --surface-2: #1a2430; --text: #e7edf4; --text-2: #c3cdd8;
  --muted: #93a2b2; --line: #243142; --line-strong: #31415a; --accent: #7aaefc; --accent-strong: #a7c8ff;
  --accent-soft: #172a45; --good: #5ccb92; --good-soft: #13291f; --warn: #f0bd5e; --warn-soft: #2e2512;
  --bad: #f28b82; --bad-soft: #33191a; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; color: var(--text); text-wrap: balance; }
p { margin: 0; }
.mono, code { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: 56px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; max-width: 70ch; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; letter-spacing: -0.01em; }
.section-sub { color: var(--muted); font-size: 1rem; max-width: 65ch; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid > * { min-width: 0; }

/* top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; color: var(--text); }
.brand strong { font-weight: 600; font-size: 1rem; }
.brand span { font-size: 0.78rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text-2); font-size: 0.9rem; font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.85rem; padding: 6px 10px; cursor: pointer; margin-left: 4px;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--text); }

/* hero */
.hero { padding-block: 64px 40px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 14px; }
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 62ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.95rem; font-weight: 500;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0e141b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0e141b; } }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* cards and stats */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 0.95rem; }
.card .meta { color: var(--muted); font-size: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 1.9rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.85rem; color: var(--muted); }
.stat.is-accent b { color: var(--accent); }
.stat.is-good b { color: var(--good); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-merged { color: var(--good); background: var(--good-soft); }
.badge-review { color: var(--accent); background: var(--accent-soft); }
.badge-waiting { color: var(--warn); background: var(--warn-soft); }
.badge-closed { color: var(--muted); background: var(--surface-2); }
.badge-bad { color: var(--bad); background: var(--bad-soft); }
.tag { display: inline-block; font-size: 0.78rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* progress bar */
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 3px; }

/* form controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.input, .select {
  font: inherit; font-size: 0.92rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; min-width: 0;
}
.input { flex: 1 1 260px; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* footer */
.footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 0.88rem; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--text-2); }

@media (max-width: 640px) {
  .section { padding-block: 40px; }
  .hero { padding-block: 40px 24px; }
  .nav a { padding: 6px 8px; font-size: 0.85rem; }
}
