/* ===================================================================
   Chris Mangum — site styles
   Neutral / zinc base with a red accent. Vanilla CSS, no framework.
   =================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --surface: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --text: #18181b;
  --text-soft: #3f3f46;
  --text-muted: #71717a;

  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --accent-soft: #fef2f2;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow: 0 4px 16px rgba(24, 24, 27, 0.07);
  --shadow-lg: 0 18px 48px rgba(24, 24, 27, 0.12);

  --container: 1120px;
  --nav-h: 68px;

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-muted: #111114;
    --surface: #141417;
    --border: #26262b;
    --border-strong: #34343a;

    --text: #fafafa;
    --text-soft: #d4d4d8;
    --text-muted: #a1a1aa;

    --accent: #f05252;
    --accent-dark: #ef4444;
    --accent-soft: #1f1416;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pulse {
    animation: none;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-dark);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

strong {
  font-weight: 700;
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.nav__brand:hover {
  color: var(--text);
}

.nav__brand .dot {
  color: var(--accent);
}

.nav__brand small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav__links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.nav__social {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.nav__social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.nav__social a:hover {
  color: var(--accent);
  background: var(--bg-muted);
}

.nav__social svg {
  width: 19px;
  height: 19px;
}

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.nav__toggle svg {
  width: 24px;
  height: 24px;
}

.nav__toggle:hover {
  background: var(--bg-muted);
}

/* ---------- Mobile menu (CSS :target) ---------- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  z-index: 49;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px 0;
}

.mobile-menu ul {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.mobile-menu a {
  display: block;
  padding: 12px 8px;
  color: var(--text-soft);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:hover {
  color: var(--accent);
}

.mobile-menu__social {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px 8px 4px;
}

.mobile-menu__social a {
  border: none;
  padding: 0;
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-muted);
}

.btn--sm {
  padding: 9px 15px;
  font-size: 0.9rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 88px);
  background:
    radial-gradient(60rem 30rem at 75% -10%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-muted), var(--bg));
}

.hero__inner {
  max-width: 820px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 22px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.035em;
}

.hero__role {
  margin-top: 14px;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--accent);
}

.hero__lead {
  margin-top: 18px;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--text-soft);
  max-width: 680px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 8vw, 96px) 0;
  border-top: 1px solid var(--border);
}

.section--muted {
  background: var(--bg-muted);
}

.section__eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  max-width: 760px;
}

.section__lead {
  margin-top: 16px;
  margin-bottom: 44px;
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 680px;
}

/* ---------- Grid + cards ---------- */
.grid {
  display: grid;
  gap: 22px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.card h3 {
  font-size: 1.22rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-soft);
  font-size: 0.98rem;
  margin-bottom: 0;
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

/* ---------- Feature (AgentFarm) ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.feature__body {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.feature__kicker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.feature__body h3 {
  font-size: 1.7rem;
  margin-bottom: 12px;
}

.feature__body > p {
  color: var(--text-soft);
}

.feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}

.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.feature__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.feature__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat__num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.stat__label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Projects ---------- */
.project__head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.project__org {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.project__org--dooders {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.project h3 {
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.project h3 a {
  color: var(--text);
}

.project h3 a:hover {
  color: var(--accent);
}

.project p {
  flex: 1;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}

.project__links {
  display: flex;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- Writing / posts ---------- */
.posts {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.post {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.post:hover {
  background: var(--bg-muted);
  background: color-mix(in srgb, var(--bg-muted) 60%, transparent);
}

.post__date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 3px;
}

.post__title {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.post__title a {
  color: var(--text);
}

.post__title a:hover {
  color: var(--accent);
}

.post__excerpt {
  color: var(--text-soft);
  font-size: 0.97rem;
  margin-bottom: 0;
}

.writing__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  font-weight: 600;
}

.writing__more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.writing__more:hover svg {
  transform: translateX(3px);
}

/* ---------- About ---------- */
.about__prose {
  max-width: 720px;
  font-size: 1.08rem;
  color: var(--text-soft);
}

.about__prose strong {
  color: var(--text);
}

.about__quote {
  margin: 28px 0 0;
  padding: 16px 0 16px 22px;
  border-left: 3px solid var(--accent);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
}

/* ---------- Footer ---------- */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer__social {
  display: flex;
  gap: 6px;
}

.footer__social a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.footer__social a:hover {
  color: var(--accent);
  background: var(--surface);
}

.footer__social svg {
  width: 19px;
  height: 19px;
}

.footer__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature {
    grid-template-columns: 1fr;
  }

  .feature__aside {
    flex-direction: row;
  }
}

@media (max-width: 720px) {
  .nav__links,
  .nav__social {
    display: none;
  }

  .nav__toggle {
    display: inline-flex;
  }

  .mobile-menu:target {
    display: block;
  }

  .grid--3 {
    grid-template-columns: 1fr;
  }

  .feature__aside {
    flex-direction: column;
  }

  .post {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero__actions .btn {
    flex: 1;
    justify-content: center;
  }
}
