/* mitchgardner.cv: one stylesheet for the site. The resume page has its own,
   inline (src/_includes/css/resume.css), so it can print straight from disk. */
:root {
  --paper: #fafaf9;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #b45309;      /* 5:1 on --paper and on white */
  --accent-ink: #ffffff;  /* text on an accent background */
  /* Fire, red to yellow, for the moving lines only. Text and buttons keep --accent.
     resume.css has the same tokens (that page carries its own CSS). */
  --fire-1: #b91c1c;
  --fire-2: #dc2626;
  --fire-3: #ea580c;
  --fire-4: #f59e0b;
  --fire-5: #eab308;
  --fire: linear-gradient(90deg, var(--fire-1), var(--fire-2), var(--fire-3), var(--fire-4), var(--fire-5), var(--fire-4), var(--fire-3), var(--fire-2), var(--fire-1));
  --fire-top: linear-gradient(90deg, var(--fire-1), var(--fire-2), var(--fire-3), var(--fire-1), var(--fire-2), var(--fire-1), var(--fire-3), var(--fire-2), var(--fire-1));
  --fire-bottom: linear-gradient(90deg, var(--fire-4), var(--fire-5), var(--fire-3), var(--fire-5), var(--fire-4), var(--fire-5), var(--fire-3), var(--fire-4), var(--fire-5));
  --fire-time: 14s;
  --max: 68rem;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171412;
    --card: #201c19;
    --ink: #f5f5f4;
    --muted: #c7c2bd;
    --line: #3a3430;
    --accent: #f59e0b;
    --accent-ink: #1c1917;
    --fire-1: #dc2626;
    --fire-2: #ea580c;
    --fire-3: #f97316;
    --fire-4: #f59e0b;
    --fire-5: #facc15;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--font-body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2.75rem; }
h3 { font-size: 1.2rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card); padding: 0.5rem 1rem; }

/* Fire lines: red along the top of the page, yellow along the bottom, the full
   range in between, all drifting slowly side to side. */
@keyframes fire { from { background-position-x: 0%; } to { background-position-x: 100%; } }
.top, .foot { position: relative; }
.top::after, .foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  pointer-events: none;
  background-size: 300% 100%;
  animation: fire var(--fire-time) ease-in-out infinite alternate;
}
.top::after { bottom: 0; background-image: var(--fire-top); }
.foot::before { top: 0; background-image: var(--fire-bottom); animation-direction: alternate-reverse; }

.top__end { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.motion-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.js .motion-toggle { display: inline-flex; }
.motion-toggle:hover { color: var(--accent); border-color: var(--accent); }
.motion-toggle svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }
.motion-toggle .i-play, [data-motion="paused"] .motion-toggle .i-pause { display: none; }
[data-motion="paused"] .motion-toggle .i-play { display: block; }
:root[data-motion="paused"] *, :root[data-motion="paused"] *::before, :root[data-motion="paused"] *::after {
  animation-play-state: paused !important;
}

.top__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; padding: 0.25rem 0 calc(0.25rem + 2px); }
.nav a:hover, .nav a[aria-current="page"] {
  background: var(--fire) 0 100% / 300% 2px no-repeat;
  animation: fire var(--fire-time) ease-in-out infinite alternate;
}

main { padding-bottom: 4rem; }

.hero { padding-top: 3.5rem; }
.eyebrow { color: var(--muted); font-weight: 600; margin: 0 0 0.35rem; }
.lede { font-size: 1.25rem; max-width: 44rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  border: 2px solid var(--accent);
  border-radius: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { text-decoration: underline; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.75rem;
}
.stat {
  padding-top: calc(0.75rem + 3px);
  background: var(--fire) 0 0 / 300% 3px no-repeat;
  animation: fire var(--fire-time) ease-in-out infinite alternate;
}
.stat:nth-child(2) { animation-delay: -5s; }
.stat:nth-child(3) { animation-delay: -10s; }
.stat__num { display: block; font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.stat__label { color: var(--muted); }

.cards {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
}
.card:hover, .card:focus-within { border-color: var(--accent); }
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1;
  pointer-events: none;
  background: var(--fire) 0 0 / 300% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover::before, .card:focus-within::before {
  opacity: 1;
  animation: fire var(--fire-time) ease-in-out infinite alternate;
}
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.card__body { padding: 1rem; }
.card h2, .card h3 { font-size: 1.2rem; margin: 0 0 0.35rem; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.card p { margin: 0; color: var(--muted); font-size: 1rem; }
.card__tag { display: inline-block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--accent); }

.article { padding-top: 2rem; }
.crumb { margin: 0 0 0.5rem; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.25rem; }
.prose li + li { margin-top: 0.35rem; }
.prose code { font-size: 0.95em; background: var(--line); padding: 0.05em 0.3em; border-radius: 0.25em; }
.gallery figure, .project-figure { margin: 1.75rem 0; }
.gallery img, .project-figure img { border: 1px solid var(--line); border-radius: 0.4rem; }
.project-figure--small { max-width: 26rem; }
figcaption { color: var(--muted); font-size: 1rem; margin-top: 0.5rem; }
.meta { color: var(--muted); font-size: 1rem; margin-top: 2rem; }

.about p, .contact p { max-width: 44rem; }

.foot { padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 1rem; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; }
.foot p { margin: 0; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; margin: 0; padding: 0; }

/* Reduced motion: the fire lines stay, standing still, and there's nothing to pause. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .js .motion-toggle { display: none; }
}
