/* ============================================================
   georgelarson.me — mono-accented editorial
   Monospace = the engineer fingerprint (nav, labels, code, receipts).
   Serif     = the reading voice (prose).
   Dark, flat, one desaturated-green accent. No cards. No glow.
   The structure is the chrome.
   ============================================================ */

/* ---- fonts (self-hosted, no CDN) ---- */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---- tokens ---- */
:root {
  --bg:        #0c0e11;   /* near-black, faintly cool */
  --bg-inset:  #14171c;   /* code wells, rare raised fills */
  --ink:       #e7e4dd;   /* warm off-white — the prose */
  --ink-soft:  #a8a69d;   /* secondary prose */
  --ink-faint: #8b8a81;   /* captions, meta — WCAG AA on --bg (~5.2:1) */
  --accent:    #7cc4a8;   /* desaturated green — heritage, no neon */
  --accent-lo: rgba(124, 196, 168, 0.16);  /* rules, hairlines */
  --accent-bg: rgba(124, 196, 168, 0.08);  /* code tint */
  --sel:       rgba(124, 196, 168, 0.22);

  --font-mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --rhythm: 1.7;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 0.97rem + 0.25vw, 1.12rem);
  line-height: var(--rhythm);
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sel); color: var(--ink); }
a { color: inherit; }
img { max-width: 100%; }

/* ---- layout shell ---- */
.shell {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- header / nav (mono) ---- */
.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 2.25rem 0;
}
.wordmark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .caret { color: var(--accent); }
.site-nav {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  display: flex;
  gap: 1.4rem;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
/* hover only — no persistent active highlight, since the nav mixes a page (who)
   with section/action links (work, contact) that can't show an active state.
   aria-current stays on the HTML for screen readers; it just isn't styled. */
.site-nav a:hover { color: var(--accent); border-color: var(--accent-lo); }

/* ---- top hairline ---- */
.rule {
  border: 0;
  border-top: 1px solid var(--accent-lo);
  margin: 2.25rem 0;
}
.rule--mono::before {
  /* a faint mono tick row, the terminal fingerprint as a divider */
  content: "─────────────────────────────────────────────────────────────────";
  display: block;
  font-family: var(--font-mono);
  color: var(--accent-lo);
  font-size: 0.8rem;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
}
.rule--mono { border: 0; margin: 2.25rem 0; }

/* ---- article / case study ---- */
main { padding-block: 1rem 4rem; }
.measure { max-width: var(--measure); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}
h1.title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 1.3rem + 1.9vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
}
.dek {
  color: var(--ink-soft);
  font-size: 1.05em;
  margin: 0 0 0.5rem;
}

/* section blocks: mono label + serif prose. label is an <h2> for outline/SR.
   .label is global (used by case-study sections and landing sections alike). */
.block { margin-block: 2.4rem; }
.label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.74rem;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
}
.label::before {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
  flex: none;
}
.block p { margin: 0 0 1rem; }
.block p:last-child { margin-bottom: 0; }

/* the fix pipeline: mono tool names + serif gloss */
.tools { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.tools > li {
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--accent-lo);
}
.tools > li:last-child { border-bottom: 1px solid var(--accent-lo); }
.tools .name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.tools .name .tag {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-left: 0.5rem;
}
.tools .name .role {
  color: var(--accent);
  font-weight: 400;
}
.tools .desc { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: 0.98em; }

/* pipeline arrow caption */
.pipeline {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 0.4rem 0 0;
}
.pipeline b { color: var(--accent); font-weight: 600; }

/* inline + block code (mono) */
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-bg);
  color: var(--ink);
  padding: 0.1em 0.38em;
  border-radius: 2px;
}

/* links in prose */
.prose a, a.lnk {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-lo);
  transition: border-color .18s ease;
}
.prose a:hover, a.lnk:hover { border-color: var(--accent); }

em, i { font-style: italic; }
strong { font-weight: 600; color: var(--ink); }

/* outcome footer line of links */
.sources {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink-faint);
  margin-top: 1.2rem;
}
.sources a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-lo); }
.sources a:hover { border-color: var(--accent); }

/* back link */
.back {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.back:hover { color: var(--accent); }
.back .caret { color: var(--accent); }

/* ---- landing ---- */
main > section { margin-block: 2.6rem; }
.hero { padding-block: 1.5rem 0.25rem; }
.hero-title {
  font-size: clamp(2rem, 1.45rem + 2.7vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin-bottom: 1.7rem;
}
.hero .prose p { margin: 0 0 1.1rem; }

.receipts { list-style: none; margin: 1.3rem 0 0; padding: 0; }
.receipts li { border-top: 1px solid var(--accent-lo); }
.receipts li:last-child { border-bottom: 1px solid var(--accent-lo); }
.receipts a {
  display: block;
  padding: 1.15rem 0;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 0;
  transition: padding-left .2s ease;
}
.receipts a:hover, .receipts a:focus-visible { padding-left: .55rem; }
.receipts .r-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .96rem;
  color: var(--ink);
  transition: color .18s ease;
}
.receipts a:hover .r-name { color: var(--accent); }
.receipts .r-gloss { display: block; color: var(--ink-soft); margin-top: .4rem; }
.mono-link { font-family: var(--font-mono); font-size: .85rem; letter-spacing: .01em; }
.more-link { margin-top: 1.5rem; }
/* a secondary receipts label within a section (deep receipts, then breadth) */
.label--sub { margin-top: 2.4rem; }

/* ---- who-is-george / voice page ---- */
.voice p { margin: 0 0 1.15rem; }
.lede-line {
  font-size: 1.18em;
  color: var(--ink);
  line-height: 1.4;
  margin: 1.9rem 0;
}
/* line-grouped thought clusters — a single thought per line. Flush-left like
   the rest of the prose; the line grouping itself is the only distinction.
   No border/indent — these are assertions, not quotations. */
.cluster {
  color: var(--ink);
  margin: 1.7rem 0;
}

/* ---- generated long-form article (writing/) ----
   The blog pipeline (scripts/publish.sh) renders story.md into bare
   <section>/<h2>/<p> markup wrapped in .article-body. Serif headings for
   long-form reading, mono h3 + accents for the engineer fingerprint. */
.article-body { margin-top: 1.5rem; }
.article-body section { margin-block: 1.9rem; }
.article-body h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.24rem, 1.08rem + 0.7vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.95rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--accent-lo);
}
.article-body section:first-of-type h2 { padding-top: 0; border-top: 0; }
.article-body h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin: 1.6rem 0 0.7rem;
}
.article-body p { margin: 0 0 1.1rem; }
.article-body :is(p, li, td) a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-lo);
  transition: border-color .18s ease;
}
.article-body :is(p, li, td) a:hover { border-color: var(--accent); }
.article-body ul, .article-body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.article-body li { margin: 0 0 0.5rem; }
.article-body li::marker { color: var(--accent); }
.article-body .code-block {
  margin: 0 0 1.3rem;
  background: var(--bg-inset);
  border: 1px solid var(--accent-lo);
  border-radius: 4px;
  overflow-x: auto;
}
.article-body .code-block pre { margin: 0; padding: 0.95rem 1.1rem; }
.article-body .code-block code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.article-body .screenshot { margin: 1.5rem 0; }
.article-body .screenshot img {
  display: block;
  border: 1px solid var(--accent-lo);
  border-radius: 4px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4rem;
  font-size: 0.92em;
}
.article-body th, .article-body td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--accent-lo);
  vertical-align: top;
}
.article-body th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.article-body hr {
  border: 0;
  border-top: 1px solid var(--accent-lo);
  margin: 2rem 0;
}

/* ---- writing index ---- */
.writing-list { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.writing-list li { border-top: 1px solid var(--accent-lo); }
.writing-list li:last-child { border-bottom: 1px solid var(--accent-lo); }
.writing-list a {
  display: block;
  padding: 1.1rem 0;
  text-decoration: none;
  color: var(--ink);
  transition: padding-left .2s ease;
}
.writing-list a:hover, .writing-list a:focus-visible { padding-left: .55rem; }
.writing-list .w-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.writing-list .w-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .94rem;
  color: var(--ink);
  transition: color .18s ease;
}
.writing-list a:hover .w-title { color: var(--accent); }
.writing-list .w-date {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--ink-faint);
  letter-spacing: .02em;
  flex: none;
}
.writing-list .w-gloss { display: block; color: var(--ink-soft); margin-top: .4rem; }

/* ---- footer ---- */
.site-foot {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  padding-block: 1.4rem 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* ---- resume page: the full text, straight from resume.txt ----
   Mono well, wraps on mobile (no horizontal scroll), preserves the
   resume's own line breaks. The PDF is the typeset version; this is
   the grep/diff/paste copy. */
.resume-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg-inset);
  border: 1px solid var(--accent-lo);
  border-radius: 4px;
  padding: 1.2rem 1.3rem;
  margin: 1.3rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ---- page-load reveal (one orchestrated stagger, restrained) ----
   Content is visible by default; the animation only enhances. Base state
   carries no opacity:0, so if the animation never runs (old engine, capture
   at t=0, animation disabled), the page still shows. fill-mode: both keeps
   the from-state during the delay and the to-state after. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .55s cubic-bezier(.2,.6,.2,1) both; }
  .reveal:nth-child(1) { animation-delay: .02s; }
  .reveal:nth-child(2) { animation-delay: .08s; }
  .reveal:nth-child(3) { animation-delay: .14s; }
  .reveal:nth-child(4) { animation-delay: .20s; }
  .reveal:nth-child(5) { animation-delay: .26s; }
  .reveal:nth-child(6) { animation-delay: .32s; }
  .reveal:nth-child(7) { animation-delay: .38s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---- focus visibility ---- */
a:focus-visible, :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- small screens: keep the nav from overflowing the viewport ----
   The six-item nav is a single flex row. On a phone it's wider than the
   screen, which made the whole page drag sideways. Stack the header and let
   the nav wrap, so the links flow onto a second row instead of overflowing. */
@media (max-width: 600px) {
  .site-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .site-nav {
    flex-wrap: wrap;
    gap: 0.7rem 1.3rem;
  }
}

/* ---- print ----
   The PDF download is the real print artifact, but Ctrl-P on any page
   (the resume especially) should still come out legible: flip to light,
   drop the chrome, flatten the mono well. */
@media print {
  :root {
    --bg: #fff; --bg-inset: #fff;
    --ink: #000; --ink-soft: #222; --ink-faint: #444;
    --accent: #000; --accent-lo: #bbb; --accent-bg: transparent;
  }
  body { background: #fff; color: #000; }
  .site-head, .site-nav, .site-foot, .rule, .rule--mono { display: none; }
  a { color: #000; }  /* recolor only; keep prose links' underline affordance on paper */
  .reveal { animation: none; opacity: 1; transform: none; }  /* never print mid-fade */
  .resume-text { border: 0; background: #fff; color: #000; padding: 0; font-size: 0.7rem; }
}
