/* chmald.github.io — single stylesheet, no external fonts or frameworks.
   Colour tokens are contrast-checked by scripts/check.mjs (WCAG AA). */

:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --card: #ffffff;
  --border: #d8dee4;
  --border-strong: #8c959f;
  --text: #1f2328;
  --muted: #555f6b;
  --link: #0a58b8;
  --focus: #0a58b8;
  --button-bg: #0a58b8;
  --button-bg-hover: #084a9c;
  --button-fg: #ffffff;
  --chip-bg: #eef1f4;
  --chip-fg: #353c44;
  --apps-bg: #ddf0ff;
  --apps-fg: #08468f;
  --data-bg: #f1e8ff;
  --data-fg: #5b2a9e;
  --infra-bg: #fff0d4;
  --infra-fg: #6b4100;
  --type-bg: #eef1f4;
  --type-fg: #424a53;
  --deploy-bg: #dcf7e3;
  --deploy-fg: #0f5a26;
  --guided-bg: #eef1f4;
  --guided-fg: #424a53;
  --filter-on-bg: #1f2328;
  --filter-on-fg: #ffffff;
  --hero-glow-1: rgba(10, 88, 184, 0.14);
  --hero-glow-2: rgba(130, 80, 223, 0.12);
  --thumb-frame: #ffffff;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 8px 24px rgba(31, 35, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(31, 35, 40, 0.08), 0 14px 32px rgba(31, 35, 40, 0.12);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #11161d;
    --card: #161b22;
    --border: #2a313a;
    --border-strong: #6e7681;
    --text: #e6edf3;
    --muted: #a3acb7;
    --link: #74b9ff;
    --focus: #74b9ff;
    --button-bg: #74b9ff;
    --button-bg-hover: #9ccdff;
    --button-fg: #0d1117;
    --chip-bg: #21262d;
    --chip-fg: #d0d7de;
    --apps-bg: #0c2d4f;
    --apps-fg: #a5d2ff;
    --data-bg: #2c1a4d;
    --data-fg: #d6bcff;
    --infra-bg: #3a2905;
    --infra-fg: #f5cd6a;
    --type-bg: #21262d;
    --type-fg: #c3cbd4;
    --deploy-bg: #0f3320;
    --deploy-fg: #86e3a6;
    --guided-bg: #21262d;
    --guided-fg: #c3cbd4;
    --filter-on-bg: #e6edf3;
    --filter-on-fg: #0d1117;
    --hero-glow-1: rgba(116, 185, 255, 0.12);
    --hero-glow-2: rgba(170, 120, 255, 0.10);
    --thumb-frame: #f6f8fa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 32px rgba(0, 0, 0, 0.45);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.nowrap { white-space: nowrap; }

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--button-bg);
  color: var(--button-fg);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.monogram {
  display: inline-grid; place-items: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 9px;
  background: linear-gradient(135deg, #0a58b8, #6f3fc6);
  color: #ffffff;
  font-size: 0.85rem; letter-spacing: 0.02em;
}
.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav-links a:hover { background: var(--chip-bg); }
@media (max-width: 640px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-links a { padding: 0.45rem 0.5rem; }
}
@media (max-width: 380px) {
  .nav-github span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.button--primary { background: var(--button-bg); color: var(--button-fg); }
.button--primary:hover { background: var(--button-bg-hover); }
.button--secondary { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.button--secondary:hover { background: var(--chip-bg); }
.button:active { transform: translateY(1px); }

/* Hero */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(60rem 28rem at 8% -10%, var(--hero-glow-1), transparent 65%),
    radial-gradient(48rem 26rem at 95% 0%, var(--hero-glow-2), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted); font-weight: 600; font-size: 0.95rem;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.025em; }
.lede {
  max-width: 40ch;
  margin: 1rem 0 0.75rem;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 600; line-height: 1.35;
}
.hero-bio { max-width: 68ch; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.stats {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem;
  margin: 2.5rem 0 0;
}
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); font-size: 0.9rem; }
.stats dd { margin: 0; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); font-weight: 800; }
.section-head p { margin: 0.5rem 0 0; color: var(--muted); max-width: 70ch; }
.section-head .section-note { font-size: 0.92rem; font-weight: 600; }

/* Thumbnails */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  overflow: hidden;
  color: #ffffff;
}
.thumb--g1 { background: linear-gradient(135deg, #0a58b8 0%, #3a3fc0 55%, #6f3fc6 100%); }
.thumb--g2 { background: linear-gradient(135deg, #0b6e77 0%, #0a58b8 100%); }
.thumb--g3 { background: linear-gradient(135deg, #6f3fc6 0%, #b03a8a 100%); }
.thumb--g4 { background: linear-gradient(135deg, #1f4e8c 0%, #0b6e77 60%, #157347 100%); }
.thumb::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.thumb-icon { width: 3.5rem; height: 3.5rem; opacity: 0.95; }
.thumb img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 0.6rem;
  background: var(--thumb-frame);
}

/* Badges & chips */
.badges, .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.badge {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge--apps-ai { background: var(--apps-bg); color: var(--apps-fg); }
.badge--data { background: var(--data-bg); color: var(--data-fg); }
.badge--infra { background: var(--infra-bg); color: var(--infra-fg); }
.badge--type { background: var(--type-bg); color: var(--type-fg); font-weight: 600; }
.badge--license { background: var(--chip-bg); color: var(--chip-fg); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-strong); }
.chips li {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--chip-bg); color: var(--chip-fg);
  font-size: 0.8rem; line-height: 1.4;
}
.chips--lg li { font-size: 0.9rem; padding: 0.3rem 0.7rem; }
.deploy {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 600;
}
.deploy code { font-weight: 700; }
.deploy--azd { background: var(--deploy-bg); color: var(--deploy-fg); }
.deploy--guided { background: var(--guided-bg); color: var(--guided-fg); }

/* Featured */
.features { display: grid; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.feature-inner {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.feature:nth-child(even) .feature-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.feature:nth-child(even) .thumb { order: 2; }
.feature .thumb { aspect-ratio: auto; min-height: 100%; }
.feature .thumb img { padding: 1rem; }
.feature-body { padding: clamp(1.25rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 0.85rem; }
.feature-body h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 800; }
.feature-body p { margin: 0; color: var(--muted); }
.highlights { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.highlights li { position: relative; padding-left: 1.4rem; }
.highlights li::before {
  content: "";
  position: absolute; left: 0.2rem; top: 0.62em;
  width: 0.5rem; height: 0.5rem;
  border-radius: 2px;
  background: var(--link);
  transform: rotate(45deg);
}
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: auto; padding-top: 0.5rem; }
@media (max-width: 820px) {
  .feature-inner, .feature:nth-child(even) .feature-inner { grid-template-columns: 1fr; }
  .feature:nth-child(even) .thumb { order: 0; }
  .feature .thumb { aspect-ratio: 16 / 9; min-height: 0; }
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filters[hidden] { display: none; }
.filter {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer;
}
.filter:hover { background: var(--chip-bg); }
.filter[aria-pressed="true"] { background: var(--filter-on-bg); color: var(--filter-on-fg); border-color: var(--filter-on-bg); }
.filter .count {
  min-width: 1.5rem; padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-fg);
  font-size: 0.78rem; text-align: center;
}
.filter[aria-pressed="true"] .count { background: var(--filter-on-fg); color: var(--filter-on-bg); }

/* Project grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 1.25rem;
  list-style: none; margin: 0; padding: 0;
}
.card[hidden] { display: none; }
.card-inner {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card-inner:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card-inner:focus-within { border-color: var(--focus); }
.card-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem 1.2rem 1.2rem; flex: 1; }
.card h3 { font-size: 1.15rem; font-weight: 750; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--link); text-decoration: underline; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.stretched:focus-visible { outline: none; }
.stretched:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius); }
.use-case { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: auto; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.repo-hint {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--muted); font-size: 0.8rem;
  overflow-wrap: anywhere;
}

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.about h2 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: 1rem; }
.about p { max-width: 68ch; }
.about-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.about-card h3 { font-size: 1.05rem; margin-bottom: 0.9rem; }
.about-links { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.about-links a { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

/* 404 */
.not-found { padding: clamp(4rem, 12vw, 8rem) 0; min-height: 60vh; }
.not-found h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0 2.5rem; }
.footer-inner { display: grid; gap: 0.75rem; }
.disclaimer { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 80ch; }
.footer-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.92rem; }
.footer-meta a { display: inline-flex; align-items: center; gap: 0.4rem; }

@media print {
  .site-header, .filters, .hero-actions { display: none; }
  .card-inner, .feature-inner { box-shadow: none; break-inside: avoid; }
}
