/* buford.bg — the record.
 *
 * Sibling to nouscraft.com: same shape (flat static HTML on Cloudflare Pages,
 * no build step, one hand-written stylesheet, a three.js background that is
 * decoration only). Different subject, so a different palette and a different
 * type stack — the two sites should read as made by the same person, not as
 * the same site.
 *
 * The organising idea is a case file. Sixteen companies over eighteen years,
 * most of them shut down, listed as a docket rather than a highlight reel.
 * Colour is not decoration here: every accent maps to a disposition, so a
 * glance down the page tells you how each one ended before you read a word.
 */

:root {
  /* ---- Surface ---- */
  --ink:        #0a0c11;   /* base — blue-black, the colour of a filed page */
  --ink-2:      #11151c;   /* raised: rows, chips, form fields */
  --ink-3:      #191f28;   /* hover */
  --rule:       rgba(230, 228, 222, 0.12);
  --rule-soft:  rgba(230, 228, 222, 0.06);

  /* ---- Text ---- */
  --paper:      #e6e4de;   /* warm off-white, not #fff: this is paper */
  --muted:      #7d8794;
  --dim:        rgba(230, 228, 222, 0.42);

  /* ---- Disposition ---- *
   * Four colours for five labels. They are the only accents on the site, and
   * they never appear on anything that is not a disposition. */
  --d-exit:     #c9a227;   /* IPO, Series A — went the distance */
  --d-live:     #59c2a5;   /* Active */
  --d-left:     #6f86a8;   /* Parted Ways */
  --d-dead:     #c8462f;   /* Shut Down */

  --link:       #8fb4e0;
  --link-hover: #cfe0f5;

  /* ---- Type ---- *
   * Archivo set wide and heavy for display: a bureaucratic poster face, the
   * opposite of the condensed sans on nouscraft. Newsreader for body, because
   * seven long-form essays need a face built for reading, not for headlines.
   * JetBrains Mono for anything that is data: years, counts, case numbers. */
  --f-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'Newsreader', Georgia, 'Times New Roman', serif;
  --f-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --measure: 68ch;   /* reading width for prose */
  --shell:   1080px; /* page width */
  --gutter:  clamp(20px, 5vw, 48px);
}

/* ------------------------------------------------------------------ reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-decoration-color: rgba(143, 180, 224, 0.4);
  text-underline-offset: 3px;
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

/* One focus ring for the whole site. Visible against every surface here. */
:focus-visible {
  outline: 2px solid var(--d-exit);
  outline-offset: 3px;
  border-radius: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* --------------------------------------------------------------- headings */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  /* The wide axis is the whole point of the face here; browsers that ignore
     font-stretch on a variable font just get the normal width, which is
     still a perfectly good grotesque. */
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
h3 { font-size: 1.2rem; font-stretch: 112%; font-variation-settings: 'wdth' 112; }

/* The eyebrow above a section. Mono, because it is a label on a document. */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

/* ----------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main { position: relative; z-index: 2; }

.band { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.band + .band { border-top: 1px solid var(--rule-soft); }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.prose li { margin-bottom: 0.5em; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose img {
  margin: 1.8em 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--d-exit);
  color: var(--muted);
  font-style: italic;
}
.prose code {
  font-family: var(--f-mono);
  font-size: 0.86em;
  background: var(--ink-2);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}
.prose pre {
  font-family: var(--f-mono);
  font-size: 0.84em;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; }
.prose hr { margin: 2.4rem 0; }

/* ----------------------------------------------------------------- header */

.site-header {
  position: relative;
  z-index: 3;
  padding: 1.6rem 0 1.4rem;
  border-bottom: 1px solid var(--rule-soft);
}

.site-header .shell {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--paper); }
.wordmark .dot { color: var(--d-exit); }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--paper); border-bottom-color: var(--rule); }
.site-nav a[aria-current='page'] {
  color: var(--paper);
  border-bottom-color: var(--d-exit);
}

/* ------------------------------------------------------------------- hero */

.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3rem); }

/* The headline is the count, spelled out. A numeral here would read as a
   dashboard stat; the word reads as a sentence someone is admitting to. */
.hero-title {
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  font-weight: 900;
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
}
.hero-title .thin {
  display: block;
  font-weight: 400;
  font-stretch: 100%;
  font-variation-settings: 'wdth' 100;
  font-size: 0.42em;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.35em;
}

.hero-sub {
  font-family: var(--f-body);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--paper);
  max-width: 46ch;
  margin: 1.6rem 0 0;
}

/* ------------------------------------------------------- the tally strip */
/*
 * Sixteen marks, one per company, left to right in the order they were
 * started. Height is how far it got and colour is how it ended, so the shape
 * of the strip is the shape of the career: a long run of short red marks with
 * a few tall ones in it. This is the one element the site is built around;
 * everything else stays quiet so it can be loud.
 */

.tally {
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1.4vw, 14px);
  height: 190px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.tally-mark {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

/* Narrow strokes with air around them, not fat bars. A mark that fills its
   slot reads as a bar chart — a dashboard, someone else's numbers. A stroke
   reads as a mark somebody scratched on a wall to keep count, which is what
   this is. */
.tally-mark a {
  display: block;
  width: 100%;
  max-width: clamp(9px, 1.1vw, 15px);
  margin: 0 auto;
  height: var(--h);
  min-height: 10px;
  background: var(--c);
  border-radius: 1px 1px 0 0;
  text-decoration: none;
  position: relative;
  opacity: 0.72;
  transition: opacity 140ms ease, transform 140ms ease;
  transform-origin: bottom;
}
.tally-mark a:hover,
.tally-mark a:focus-visible { opacity: 1; transform: scaleY(1.06); }

/* The label rides above the mark and only appears on hover or focus, so the
   strip stays a shape until you ask it for names. */
.tally-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.3em 0.55em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.tally-mark a:hover .tally-label,
.tally-mark a:focus-visible .tally-label { opacity: 1; }
.tally-label .yr { color: var(--muted); }

.tally-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* The key doubles as the legend for every disposition chip on the site. */
.tally-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}
.tally-key li { display: flex; align-items: center; gap: 0.5em; }
.tally-key .swatch {
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: var(--c);
  flex: none;
}

@media (max-width: 640px) {
  .tally { height: 130px; gap: 5px; }
  .tally-label { font-size: 0.62rem; }
}

/* ------------------------------------------------------ disposition chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.22em 0.55em;
  white-space: nowrap;
  flex: none;
}
.chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.d-exit { --c: var(--d-exit); }
.d-live { --c: var(--d-live); }
.d-left { --c: var(--d-left); }
.d-dead { --c: var(--d-dead); }

/* ----------------------------------------------------------- the docket */

.docket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* "Don't show missed shots" — his phrasing, kept. */
.filter {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
}
.filter input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter .track {
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  position: relative;
  flex: none;
  transition: background 140ms ease, border-color 140ms ease;
}
.filter .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 140ms ease, background 140ms ease;
}
.filter input:checked + .track { border-color: var(--d-live); }
.filter input:checked + .track::after {
  transform: translateX(18px);
  background: var(--d-live);
}
.filter input:focus-visible + .track {
  outline: 2px solid var(--d-exit);
  outline-offset: 3px;
}

.docket {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docket > li { border-bottom: 1px solid var(--rule-soft); }

.entry {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  align-items: start;
}

/* Left rail: the year, set in mono so the column reads as a spine. */
.entry-year {
  font-family: var(--f-mono);
  font-size: 0.95rem;
  color: var(--muted);
  padding-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.entry-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.entry-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 118%;
  font-variation-settings: 'wdth' 118;
  font-size: 1.35rem;
  line-height: 1.1;
  margin: 0;
}
.entry-name a { color: var(--paper); text-decoration: none; }
.entry-name a:hover { text-decoration: underline; text-decoration-color: var(--c); }

.entry-what { margin: 0 0 0.4rem; color: var(--paper); }

/* The outcome is the honest half of each row, so it is set apart rather than
   run on: smaller, dimmer, and marked with the disposition colour. */
.entry-outcome {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  border-left: 2px solid var(--c);
  padding-left: 0.9rem;
}

@media (max-width: 620px) {
  .entry { grid-template-columns: 1fr; gap: 0; }
  .entry-year { padding-top: 0; margin-bottom: 0.3rem; font-size: 0.85rem; }
}

/* ------------------------------------------------------------ writing list */

.writing {
  list-style: none;
  margin: 0;
  padding: 0;
}
.writing > li { border-bottom: 1px solid var(--rule-soft); }

.writing a {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  text-decoration: none;
  color: var(--paper);
}
.writing a:hover .writing-title { color: var(--link-hover); }

.writing-date {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.writing-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  font-size: 1.2rem;
  line-height: 1.25;
}

@media (max-width: 620px) {
  .writing a { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------------------------------------------------------- article page */

.article-head {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.article-head h1 { margin-bottom: 0.5rem; }
.article-date {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------ newsletter */

.signup {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  max-width: 30rem;
}
.signup input[type='email'] {
  flex: 1 1 14rem;
  min-width: 0;
  font-family: var(--f-body);
  font-size: 1rem;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
}
.signup input[type='email']::placeholder { color: var(--dim); }
.signup input[type='email']:focus { border-color: var(--d-exit); }

.btn {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 2px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.btn:hover { background: var(--d-exit); border-color: var(--d-exit); color: var(--ink); }

.form-note {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.7rem 0 0;
  min-height: 1.2em;
}
.form-note[data-state='error'] { color: var(--d-dead); }
.form-note[data-state='ok'] { color: var(--d-live); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  z-index: 2;
  margin-top: clamp(3rem, 8vw, 5rem);
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-rows {
  display: flex;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* -------------------------------------------------------------- bio block */

.bio {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 2rem;
  align-items: start;
}
.bio-photo {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--rule);
  filter: grayscale(0.35) contrast(1.05);
}
@media (max-width: 620px) {
  .bio { grid-template-columns: 1fr; gap: 1.4rem; }
  .bio-photo { width: 130px; height: 130px; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
