/* ============================================================
   Matt Huffman — civic systems & mobility tools
   Blueprint plan-view: drafting grid, hairline rules, mono labels.
   ============================================================ */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --paper:      #f7f7f3;
  --panel:      #fdfdfb;
  --ink:        #15171c;
  --ink-2:      #464c57;
  --muted:      #868d99;
  --line:       rgba(21, 23, 28, .16);
  --line-soft:  rgba(21, 23, 28, .08);
  --grid:       rgba(21, 23, 28, .045);
  --grid-major: rgba(21, 23, 28, .075);
  --accent:     #a4520c;
  --accent-dim: rgba(164, 82, 12, .10);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;

  --sheet: 1080px;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --cell: 26px;   /* drafting grid pitch */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0d1014;
    --panel:      #141920;
    --ink:        #e9ebee;
    --ink-2:      #aab2be;
    --muted:      #6f7885;
    --line:       rgba(233, 235, 238, .18);
    --line-soft:  rgba(233, 235, 238, .09);
    --grid:       rgba(233, 235, 238, .05);
    --grid-major: rgba(233, 235, 238, .085);
    --accent:     #efa457;
    --accent-dim: rgba(239, 164, 87, .13);
  }
}

/* ── Base ──────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* Graph paper: fine cells over a coarser major grid. */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:
    calc(var(--cell) * 5) calc(var(--cell) * 5),
    calc(var(--cell) * 5) calc(var(--cell) * 5),
    var(--cell) var(--cell),
    var(--cell) var(--cell);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: .5rem;
  padding: .6rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  font: 600 .8rem/1 var(--mono);
  z-index: 100;
}
.skip:focus { left: .75rem; }

/* Shared mono label treatment. */
.tag, .srule__num, .srule__label, .srule__meta,
.status, .stack span, .links__k, .titleblock dt, .proj__num, .proj__host {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
}

/* ── Sheet ─────────────────────────────────────────────────── */
.sheet {
  max-width: var(--sheet);
  margin: 0 auto;
  /* Semi-transparent so the drafting grid reads faintly through the sheet
     while staying well clear of text contrast. */
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.topbar__inner {
  max-width: var(--sheet);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.mark {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  min-width: 0;
}
.mark__name { font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }

.nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.nav a {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: .35rem 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: clamp(3.5rem, 11vw, 7.5rem) var(--pad) clamp(3rem, 8vw, 5.5rem);
  border-bottom: 1px solid var(--line);
  position: relative;
}
/* Registration crosshair, bottom-left of the hero block. */
.hero::after {
  content: "";
  position: absolute;
  left: var(--pad);
  bottom: -6px;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--accent), var(--accent)) center/1px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) center/100% 1px no-repeat;
  opacity: .75;
}

.tag { color: var(--accent); margin-bottom: 1.5rem; }

.hero__title {
  /* Sized so the longer second line clears the sheet width without
     re-wrapping against the explicit <br>. */
  font-size: clamp(1.7rem, 6.4vw, 4.6rem);
  letter-spacing: -.035em;
  line-height: 1;
  max-width: 25ch;
}

.hero__lede {
  margin-top: 1.75rem;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}
.hero__lede em { font-style: italic; color: var(--ink); }

.hero__actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.2rem;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn__arrow { transition: transform .18s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ── Section rules ─────────────────────────────────────────── */
.section {
  padding: clamp(3rem, 7vw, 5rem) var(--pad);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 60px;   /* clears the sticky top bar */
}

.srule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.srule__num { color: var(--accent); }
.srule__label { color: var(--ink); font-weight: 600; }
.srule__line { flex: 1; height: 1px; background: var(--line); }
.srule__meta { color: var(--muted); }

/* ── Projects ──────────────────────────────────────────────── */
.projects { display: flex; flex-direction: column; }
.projects > li + li { border-top: 1px solid var(--line-soft); }

.proj {
  display: grid;
  grid-template-columns: 3.5rem 1fr 2rem;
  gap: 0 1.25rem;
  align-items: start;
  padding: 1.9rem 1rem 1.9rem .75rem;
  margin: 0 -1rem;
  text-decoration: none;
  position: relative;
  transition: background .18s;
}
/* Accent stripe slides in from the left edge — a lane marker. */
.proj::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .25s ease;
}
a.proj:hover, a.proj:focus-visible { background: var(--accent-dim); }
a.proj:hover::before, a.proj:focus-visible::before { transform: scaleY(1); }

.proj__num { color: var(--muted); padding-top: .45rem; }

.proj__body { display: block; min-width: 0; }

.proj__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 1rem;
  margin-bottom: .7rem;
}
.proj__title { font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
a.proj:hover .proj__title { color: var(--accent); }

.proj__desc {
  display: block;
  color: var(--ink-2);
  max-width: 68ch;
  font-size: .96rem;
}

/* Signal-head status pill. */
.status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  white-space: nowrap;
}
.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status--live { color: var(--accent); }
.status--live .status__dot { box-shadow: 0 0 0 3px var(--accent-dim); }

/* Complete rather than running — hollow signal head. */
.status--done { color: var(--accent); }
.status--done .status__dot {
  background: transparent;
  border: 1.5px solid currentColor;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.1rem;
}
.stack span {
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
  padding: .3rem .55rem;
  letter-spacing: .1em;
  background: var(--panel);
}

.proj__host {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  letter-spacing: .1em;
}

.proj__arrow {
  justify-self: end;
  align-self: center;
  color: var(--muted);
  font-size: 1.25rem;
  transition: transform .18s ease, color .18s;
}
a.proj:hover .proj__arrow { transform: translateX(5px); color: var(--accent); }

/* No public URL to link to — the missing arrow carries that on its own,
   so the card is not dimmed. */
.proj--nolink { cursor: default; }

@media (max-width: 640px) {
  .proj { grid-template-columns: 1fr; gap: .5rem; }
  .proj__num { padding-top: 0; }
  .proj__arrow { display: none; }
}

/* ── About ─────────────────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__body { display: flex; flex-direction: column; gap: 1.15rem; color: var(--ink-2); max-width: 62ch; }

.specs { margin: 0; display: flex; flex-direction: column; }
/* Stacked label-over-value, like a drawing schedule — holds long values
   (role titles, degrees) without cramping the narrow column. */
.specs > div {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.specs > div:first-child { border-top: 1px solid var(--line-soft); }
.specs dt {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.specs dd { margin: 0; font-size: .9rem; }

@media (max-width: 780px) {
  .about { grid-template-columns: 1fr; }
}

/* ── Contact ───────────────────────────────────────────────── */
.contact__lede { max-width: 56ch; color: var(--ink-2); margin-bottom: 2.25rem; }

.links { display: flex; flex-direction: column; }
.links a {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem .75rem;
  margin: 0 -.75rem;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  transition: background .18s;
}
.links li:last-child a { border-bottom: 1px solid var(--line-soft); }
.links a:hover, .links a:focus-visible { background: var(--accent-dim); }

.links__k { color: var(--muted); }
.links__v {
  font-family: var(--mono);
  font-size: .92rem;
  word-break: break-all;
}
.links a:hover .links__v { color: var(--accent); }
.links__arrow { color: var(--muted); transition: transform .18s ease, color .18s; }
.links a:hover .links__arrow { transform: translateX(5px); color: var(--accent); }

@media (max-width: 560px) {
  .links a { grid-template-columns: 1fr auto; gap: .3rem 1rem; }
  .links__k { grid-column: 1 / -1; }
}

/* ── Title block ───────────────────────────────────────────── */
.titleblock {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.titleblock > div {
  padding: 1.1rem var(--pad);
  border-right: 1px solid var(--line-soft);
}
.titleblock > div:last-child { border-right: 0; }
.titleblock dt { color: var(--muted); display: block; margin-bottom: .35rem; }
.titleblock dd { margin: 0; font-size: .85rem; }

@media (max-width: 700px) {
  .titleblock > div { border-right: 0; border-bottom: 1px solid var(--line-soft); padding-block: .85rem; }
}

/* ── Motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
