/* davebrody.tech — one stylesheet for every page */

:root {
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-2: #eceff3;
  --text: #15181d;
  --muted: #586070;
  --line: #e2e6ec;
  --accent: #0e5c6b;
  --accent-hover: #0a4652;
  --accent-soft: #e3f0f2;
  --chip: #eef1f4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --maxw: 1080px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #161a20;
    --surface-2: #1d222a;
    --text: #e7eaef;
    --muted: #9aa3b1;
    --line: #262c35;
    --accent: #5ec2d0;
    --accent-hover: #86d4de;
    --accent-soft: #15333a;
    --chip: #1f252d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1d222a;
  --text: #e7eaef;
  --muted: #9aa3b1;
  --line: #262c35;
  --accent: #5ec2d0;
  --accent-hover: #86d4de;
  --accent-soft: #15333a;
  --chip: #1f252d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  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; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--text); text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); }
@media (max-width: 640px) {
  .nav { gap: 14px; }
  .nav .hide-sm { display: none; }
  .brand span { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero h1 { font-size: clamp(40px, 6vw, 60px); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 20px; }
.lede { font-size: clamp(18px, 2.1vw, 21px); line-height: 1.55; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.lede strong { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid var(--line); color: var(--text); background: var(--bg);
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #0b1a1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .btn.primary:hover { color: #0b1a1d; } }

.portrait {
  justify-self: end; width: 100%; max-width: 380px; aspect-ratio: 1 / 1;
  border-radius: 24px; overflow: hidden; background: #fff; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

@media (max-width: 820px) {
  .hero { padding: 40px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; justify-self: start; max-width: 160px; border-radius: 18px; }
}

/* ---------- stats ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 26px 20px 24px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.stat span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.45; margin-top: 4px; }
@media (max-width: 820px) {
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat { padding: 20px 14px 18px 0; }
  .stat + .stat { padding-left: 0; border-left: 0; }
  .stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- sections ---------- */
section.block { padding: 72px 0 8px; scroll-margin-top: 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 40em; font-size: 16px; }
@media (max-width: 560px) { section.block { padding-top: 52px; } }

/* ---------- work cards ---------- */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 760px) { .work { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 10px;
}
.card.feature { grid-column: 1 / -1; background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kind { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.status { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.status.live { background: var(--accent-soft); color: var(--accent); }
.card h3 { margin: 0; font-size: 21px; letter-spacing: -.01em; line-height: 1.25; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.card p strong { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.chips li { font-size: 12.5px; font-family: var(--mono); background: var(--chip); color: var(--muted); padding: 3px 8px; border-radius: 6px; }

/* ---------- experience ---------- */
.roles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.role .when { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.role h3 { margin: 0 0 2px; font-size: 18px; letter-spacing: -.01em; }
.role h3 small { font-weight: 500; color: var(--muted); font-size: 16px; }
.role p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
@media (max-width: 640px) { .role { grid-template-columns: 1fr; gap: 4px; } }
.edu { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; color: var(--muted); font-size: 15.5px; }
.edu b { color: var(--text); font-weight: 600; }

/* ---------- about + contact ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about p { margin: 0 0 14px; color: var(--muted); }
.about p strong { color: var(--text); }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; gap: 0; } }

.contact { margin: 80px 0 0; padding: 48px 0 56px; background: var(--surface); border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; margin: 0 0 10px; }
.contact p { color: var(--muted); margin: 0 0 22px; max-width: 36em; }

.site-footer { padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ---------- 404 ---------- */
.notfound { padding: 120px 0 80px; }
.notfound h1 { font-size: clamp(34px, 6vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; }
@media (max-width: 560px) { .notfound { padding: 64px 0 48px; } }
.notfound p { color: var(--muted); margin: 0 0 24px; }

/* ---------- Selected work: "also built" line ---------- */
.also { margin: 22px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.also strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .stat b { font-size: 19px; letter-spacing: -.025em; } .stat span { font-size: 13.5px; } }
