/* ------------------------------------------------------------------
   Christopher Mitchell — portfolio
   Tokens
   ------------------------------------------------------------------ */
:root {
  --paper: #f5f7f6;
  --paper-deep: #e9eeec;
  --ink: #141e26;
  --slate: #52626f;
  --rule: #d3dad6;
  --accent: #0c6b61;
  --accent-soft: #dcebe7;
  --accent-ink: #084f48;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --measure: 62ch;
  --gutter: clamp(20px, 6vw, 96px);
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10171c;
    --paper-deep: #182229;
    --ink: #eef2f0;
    --slate: #a4b1ba;
    --rule: #2a373f;
    --accent: #4fc3b3;
    --accent-soft: #163730;
    --accent-ink: #8fe0d3;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "wdth" 100;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.skip {
  position: absolute;
  left: 12px; top: -48px;
  background: var(--ink); color: var(--paper);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 28px var(--gutter) 0;
  max-width: var(--max);
  margin: 0 auto;
}

.wordmark {
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 15px;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--ink); }

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter) 0;
}

.hero-role {
  color: var(--slate);
  font-size: 15px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(32px, 5.2vw, 64px);
  font-weight: 700;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.025em;
  line-height: 1.02;
  max-width: 18ch;
  text-wrap: balance;
}

.hero-lead {
  margin-top: 28px;
  max-width: var(--measure);
  font-size: 19px;
  color: var(--slate);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 4px;
}
.button:hover { background: var(--accent); color: #fff; }

.link-plain { color: var(--ink); }

/* Pipeline figure ------------------------------------------------- */
.pipeline {
  margin: clamp(56px, 8vw, 96px) 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.pipeline svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pipeline .node rect {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.pipeline .node text { fill: var(--ink); font-weight: 600; }
.pipeline .node .sub { fill: var(--slate); font-size: 12px; font-weight: 400; }

.pipeline .node-accent rect { fill: var(--accent-soft); stroke: var(--accent); }
.pipeline .node-accent text { fill: var(--accent-ink); }
.pipeline .node-accent .sub { fill: var(--accent-ink); opacity: .8; }

.pipeline .loop-label { fill: var(--slate); }

.pipeline figcaption {
  margin-top: 20px;
  color: var(--slate);
  font-size: 15px;
  max-width: var(--measure);
}

/* One orchestrated load animation: the pipes draw, then nodes land. */
.pipeline .pipe path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}
.pipeline .pipe-loop path {
  stroke-dasharray: 5 6;
  stroke-dashoffset: 0;
  opacity: 0;
}
.pipeline .node { opacity: 0; }

.pipeline.is-ready .pipe-main path {
  animation: draw 0.55s ease-out forwards;
}
.pipeline.is-ready .pipe-main path:nth-child(1) { animation-delay: .25s; }
.pipeline.is-ready .pipe-main path:nth-child(2) { animation-delay: .55s; }
.pipeline.is-ready .pipe-main path:nth-child(3) { animation-delay: .85s; }
.pipeline.is-ready .pipe-main path:nth-child(4) { animation-delay: 1.15s; }

.pipeline.is-ready .node { animation: land .4s ease-out forwards; }
.pipeline.is-ready .node:nth-child(1) { animation-delay: .05s; }
.pipeline.is-ready .node:nth-child(2) { animation-delay: .45s; }
.pipeline.is-ready .node:nth-child(3) { animation-delay: .75s; }
.pipeline.is-ready .node:nth-child(4) { animation-delay: 1.05s; }
.pipeline.is-ready .node:nth-child(5) { animation-delay: 1.35s; }

.pipeline.is-ready .pipe-loop path {
  animation: fade .5s ease-out 1.7s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes land { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pipeline .pipe path, .pipeline .pipe-loop path { stroke-dashoffset: 0; opacity: 1; }
  .pipeline .node { opacity: 1; }
  .pipeline.is-ready * { animation: none !important; }
}

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter) 0;
}

.section-title {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}

.section-intro {
  color: var(--slate);
  max-width: var(--measure);
  margin: -16px 0 36px;
}

/* Focus ----------------------------------------------------------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  column-gap: 36px;
  row-gap: 36px;
}
.focus h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}
.focus p { color: var(--slate); font-size: 16px; }

/* Work ------------------------------------------------------------ */
.work-list { list-style: none; }
.work {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}
.work:first-child { padding-top: 0; }

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.work-org { font-weight: 600; }
.work-year { color: var(--slate); font-size: 15px; }

.work-body h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  max-width: 30ch;
}
.work-body p { max-width: var(--measure); }
.work-stack {
  margin-top: 14px;
  color: var(--accent-ink);
  font-size: 14px;
}

/* Timeline -------------------------------------------------------- */
.timeline { list-style: none; }
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 28px 0;
  position: relative;
}
.job:first-child { padding-top: 0; }

/* the running vertical rule between the date column and content */
.job::before {
  content: "";
  position: absolute;
  left: 216px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--rule);
}
.job:first-child::before { top: 8px; }
.job:last-child::before { bottom: auto; height: 8px; }

/* the tick on the rule */
.job::after {
  content: "";
  position: absolute;
  left: 212px;
  top: 36px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.job:first-child::after { top: 8px; }

.job-when {
  color: var(--slate);
  font-size: 15px;
  padding-top: 2px;
}
.job-what h3 { font-size: 19px; font-weight: 600; }
.job-org { font-weight: 400; color: var(--slate); }
.job-org::before { content: " at "; }
.job-where { color: var(--slate); font-size: 14px; margin-top: 4px; }

.job-what ul {
  margin-top: 14px;
  padding-left: 18px;
  max-width: var(--measure);
  color: var(--ink);
  font-size: 16px;
}
.job-what li + li { margin-top: 6px; }

/* Skills ---------------------------------------------------------- */
.skills { margin: 0; }
.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.skill-row dt { font-weight: 600; }
.skill-row dd { margin: 0; color: var(--slate); }

/* Education ------------------------------------------------------- */
.education { list-style: none; }
.education li + li { margin-top: 8px; }
.education strong { font-weight: 600; }

/* Contact --------------------------------------------------------- */
.contact { padding-bottom: 96px; }
.contact-lead { max-width: var(--measure); font-size: 19px; }
.contact-list { list-style: none; margin-top: 28px; }
.contact-list li + li { margin-top: 10px; }
.contact-list a { font-size: 18px; }

/* Footer ---------------------------------------------------------- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  color: var(--slate);
  font-size: 14px;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-nav { gap: 16px; }

  .hero-actions { flex-wrap: wrap; }

  .work, .job, .skill-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .work-meta { flex-direction: row; gap: 12px; align-items: baseline; }

  .job { padding-left: 22px; }
  .job::before { left: 4px; }
  .job::after { left: 0; top: 4px; }
  .job:first-child::after { top: 4px; }
  .job:first-child::before { top: 4px; }

  .pipeline svg { min-width: 760px; }
  .pipeline { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
