/* ashleypearce.info — field notebook
   Tokens mirror DESIGN.md. Change both together. */

:root {
  --paper: #FAF8F4;
  --paper-2: #F4F1EB;
  --white: #FFFFFF;
  --ink: #1C1A17;
  --ink-2: #4A4640;
  --ink-3: #6F6B63;
  --rule: rgba(28, 26, 23, 0.10);
  --rule-2: rgba(28, 26, 23, 0.18);
  --teal: #0F6E56;
  --teal-2: #1D9E75;
  --teal-tint: #E1F5EE;
  --amber: #BA7517;
  --amber-tint: #FAEEDA;
  --amber-deep: #7A4B0C;
  --coral: #D85A30;
  --coral-tint: #FAECE7;
  --coral-deep: #9C3A18;

  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --measure: 62ch;
  --page: 1100px;
  --gutter: 5%;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--teal-tint); color: var(--ink); }

a { color: inherit; text-decoration: none; }
.prose a, .copy a, footer p a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(15, 110, 86, 0.4);
  transition: text-decoration-color 160ms ease;
}
.prose a:hover, .copy a:hover, footer p a:hover { text-decoration-color: var(--teal); }

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

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

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(44px, 6vw, 80px); line-height: 1; letter-spacing: -0.025em; }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
h3, .as-h3 { font-size: 24px; line-height: 1.3; letter-spacing: -0.015em; }
.as-h3 { font-family: var(--serif); font-weight: 400; }
.prose h2.as-h3 { margin: 1.8em 0 0.5em; }
.h-sm { font-family: var(--serif); font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }

.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 52ch; }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.1em; }
.prose h2 { margin: 2.2em 0 0.6em; }
.prose h3 { margin: 1.8em 0 0.5em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }

.small { font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 13px; line-height: 1.5; letter-spacing: 0; }
.meta { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-3); }

.h1-in { font-size: clamp(40px, 5vw, 64px); }

/* ---------- page frame ---------- */

.wrap { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

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

nav.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
nav.top .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: var(--serif); font-size: 20px; letter-spacing: -0.01em; }
.brand small { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 12px; letter-spacing: 0; }
nav.top ul { display: flex; gap: 26px; list-style: none; }
nav.top li a {
  position: relative; font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 6px 0;
  transition: color 160ms ease;
}
nav.top li a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--teal);
  transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease-out);
}
nav.top li a:hover { color: var(--ink); }
nav.top li a:hover::after, nav.top li a[aria-current="page"]::after { transform: scaleX(1); }
nav.top li a[aria-current="page"] { color: var(--ink); }
.nav-mail { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

main { display: block; }
section.block { padding: 80px 0; }
section.block + section.block { border-top: 1px solid var(--rule); }
section.band { background: var(--paper-2); }

.block-head { display: grid; grid-template-columns: 160px 1fr; gap: 32px; align-items: baseline; margin-bottom: 40px; }
.block-head .meta { padding-top: 0.55em; }
.block-head h2 { max-width: 18ch; }
.block-head p { margin-top: 14px; }

/* ---------- ledger (dated rows) ---------- */

.ledger { list-style: none; border-top: 1px solid var(--rule); }
.ledger > li { border-bottom: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 160px 1fr auto; gap: 32px; align-items: start;
  padding: 22px 0; color: inherit;
}
a.row { transition: background 160ms ease; margin: 0 calc(-1 * 12px); padding-left: 12px; padding-right: 12px; border-radius: 8px; }
a.row:hover { background: rgba(255,255,255,0.7); }
.row .when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 6px; white-space: nowrap; }
.row .what h3 { margin-bottom: 4px; }
.row .what p { color: var(--ink-2); max-width: 60ch; }
.row .what .tags { margin-top: 10px; }
.row .arrow {
  font-family: var(--mono); font-size: 13px; color: var(--ink-3); padding-top: 8px;
  transition: transform 220ms var(--ease-out), color 160ms ease;
}
a.row:hover .arrow { transform: translateX(4px); color: var(--teal); }

.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tags span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.tags span::before { content: '·'; margin-right: 6px; color: var(--rule-2); }
.tags span:first-child::before { content: none; }

.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-2); display: inline-block; }
.status.progress i { background: var(--amber); }
.status.live i { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  padding: 12px 20px; border-radius: 100px; border: 1px solid transparent;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--teal); }
.btn.ghost { border-color: var(--rule-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn .go { transition: transform 220ms var(--ease-out); font-family: var(--mono); }
.btn:hover .go { transform: translateX(3px); }

/* ---------- artifact panels (code) ---------- */

.artifact {
  background: var(--ink); color: #E9E5DD;
  border-radius: 12px; overflow: hidden;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}
.artifact .bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; font-size: 12px; color: #A39E93;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.artifact .bar b { font-weight: 500; color: #E9E5DD; }
.artifact .bar span { white-space: nowrap; }
.artifact pre { padding: 18px 20px; overflow-x: auto; white-space: pre; tab-size: 2; }
.artifact .c { color: #8C8880; }
.artifact .k { color: #7FD6B8; }
.artifact .s { color: #F2C98A; }
.artifact .n { color: #F0A58F; }

.log { min-height: 236px; }
.log .ln { display: block; opacity: 0; transform: translateY(4px); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.log .ln.on { opacity: 1; transform: none; }
.log .ts { color: #8C8880; }
.log .deny { color: #F0A58F; }
.log .allow { color: #7FD6B8; }
.log .caret { display: inline-block; width: 7px; height: 14px; background: #7FD6B8; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

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

.hero { padding: 88px 0 88px; }
.hero .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero .lede { margin-bottom: 32px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .facts { margin-top: 36px; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 28px; }
.hero .facts div { font-size: 14px; color: var(--ink-2); }
.hero .facts .meta { display: block; margin-bottom: 2px; }
.hero-art { display: grid; gap: 12px; }
.hero-art .cap { font-size: 14px; line-height: 1.55; color: var(--ink-3); }

/* ---------- pipeline strip ---------- */

.pipe { position: relative; padding: 24px 0 8px; }
.pipe svg { width: 100%; height: auto; display: block; overflow: visible; }
.pipe .track { stroke: var(--rule-2); stroke-width: 1.5; fill: none; }
.pipe .fill { stroke: var(--teal); stroke-width: 1.5; fill: none; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); pathLength: 1; }
.pipe .gate { fill: var(--paper); stroke: var(--rule-2); stroke-width: 1.5; transition: stroke 300ms ease, fill 300ms ease; }
.pipe .gate.on { stroke: var(--teal); fill: var(--teal-tint); }
.pipe .dot { fill: var(--teal); }
.pipe .lbl { font-family: var(--sans); font-size: 13px; font-weight: 500; fill: var(--ink-2); }
.pipe .cid { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); opacity: 0; transform: translateY(4px); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.pipe .cid.on { opacity: 1; transform: none; }
.pipe-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; margin-top: 32px; max-width: 980px; }
.pipe-notes div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-2); padding: 10px 0; border-top: 1px solid var(--rule); }
.pipe-notes p { margin: 0; }
.pipe-notes b { font-weight: 500; color: var(--ink); }
.pipe-notes b::after { content: '. '; }
.pipe-notes .meta { padding-top: 3px; }

/* ---------- experience ---------- */

.exp .row { grid-template-columns: 160px 1fr; }
.exp .role { font-family: var(--serif); font-size: 24px; line-height: 1.3; letter-spacing: -0.01em; }
.exp .org { color: var(--teal); font-weight: 500; font-size: 15px; margin: 2px 0 8px; }
.exp p { color: var(--ink-2); max-width: 64ch; }
.exp ul { margin-top: 10px; padding-left: 1.1em; color: var(--ink-2); max-width: 64ch; }
.exp li + li { margin-top: 4px; }

/* ---------- margin notes ---------- */

.note { font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.note b { font-weight: 500; color: var(--ink-2); }
.note a { color: var(--teal); overflow-wrap: anywhere; }
.hero + .block { padding-top: 48px; }

/* ---------- two-col prose with side notes ---------- */

.cols { display: grid; grid-template-columns: 160px 1fr; gap: 32px; }
.cols .side { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }

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

footer.foot { border-top: 1px solid var(--rule); padding: 48px 0 56px; }
footer .grid { display: grid; grid-template-columns: 160px 1fr auto; gap: 32px; align-items: start; }
footer ul { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
footer li a { font-size: 14px; color: var(--ink-2); }
footer li a:hover { color: var(--teal); }
footer .colophon { margin-top: 18px; }

/* ---------- reveal ---------- */

[data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal="2"] { transition-delay: 70ms; }
[data-reveal="3"] { transition-delay: 140ms; }

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .hero .grid { grid-template-columns: 1fr; gap: 40px; }
  .block-head, .cols, footer .grid { grid-template-columns: 1fr; gap: 12px; }
  .cols .side { position: static; }
  .row, .exp .row { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .row .arrow { display: none; }
    .pipe-notes { grid-template-columns: 1fr; }
  .hero .facts { grid-template-columns: 1fr 1fr; }
  nav.top ul { gap: 18px; }
  .nav-mail, .brand small { display: none; }
  section.block { padding: 64px 0; }
}
@media (max-width: 560px) {
  nav.top ul { gap: 14px; }
  nav.top li a { font-size: 13px; }
  .artifact .bar span { display: none; }
  .pipe svg { min-width: 640px; }
  .pipe { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .log .ln { opacity: 1; transform: none; transition: none; }
  .log .caret, .status.live i { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
