:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8f8f8f;
  --hair: #262626;
  --accent: #D2FF00;
  --rail: 36px;
  --sans: -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (min-width: 900px) {
  :root { --rail: 72px; }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  padding: 0 16px 48px;
}
body > header, main, body > footer {
  max-width: 760px;
  margin: 0 auto;
}

/* Links and focus */
a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent); text-decoration-color: var(--accent); }
}
a:active { color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Visually hidden (screen reader only) */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Images: no frames, no shadows */
picture { display: block; }
img {
  display: block;
  width: 100%;
  height: auto;
  background: #141414;
}
figure { margin: 24px 0 0; }
figcaption.credit {
  margin-top: 8px;
  font: 400 0.8125rem/1.4 var(--mono);
  color: var(--muted);
}

/* Type */
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; letter-spacing: -0.025em; }
@media (min-width: 900px) {
  h1 { font-size: 4rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.875rem; }
}
p { margin: 0; }
.eyebrow {
  display: block;
  margin-bottom: 10px;
  font: 400 0.8125rem/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Header */
.top {
  padding: 48px 0 40px;
}
.headshot { width: 96px; margin-bottom: 24px; }
.headshot img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  filter: grayscale(1);
}
@media (min-width: 900px) {
  .top { padding-top: 56px; }
  .headshot { margin-bottom: 20px; }
  .headshot, .headshot img { width: 120px; }
  .headshot img { height: 120px; }
}
.name {
  display: inline-block;
  background: linear-gradient(100deg, #bdbdbd 0%, #fff 35%, #d6d6d6 50%, #fff 65%, #bdbdbd 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear 1;
}
@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}
.tagline {
  margin-top: 16px;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.email {
  margin-top: 16px;
  font: 400 0.8125rem/1.4 var(--mono);
  color: var(--muted);
}
/* Tap targets: 44px tall hit areas without moving the text */
.links a { display: inline-block; padding: 9px 8px; margin: -9px -8px; }
.links a[href*="x.com"] { padding-inline: 18px; margin-inline: -18px; }

/* Mobile header: headshot, name, tagline, links, email, then the highlights */
@media (max-width: 899px) {
  .top { padding: 16px 0 12px; }
  .headshot { width: 56px; margin-bottom: 10px; }
  .headshot img { width: 56px; height: 56px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 2.125rem; }
  h3 { font-size: 1.375rem; }
  .tagline { margin-top: 8px; font-size: 1.0625rem; }
  .top .links { margin-top: 10px; }
  .email { margin-top: 12px; }
  .highlights li { padding: 7px 0; font-size: 0.9375rem; line-height: 1.4; }
  .xpost-meta a { margin-left: 0; flex-basis: 100%; }
}
/* Highlights */
.highlights ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.highlights li {
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  text-wrap: pretty;
}

/* Story and the line */
.story {
  position: relative;
  margin-top: 72px;
  padding-left: var(--rail);
}
.story::before {
  content: "";
  position: absolute;
  top: 38px;
  bottom: 32px;
  left: -1px;
  border-left: 2px dashed var(--accent);
}
@media (min-width: 900px) {
  .story::before { top: 42px; }
}
.story.has-svg::before { display: none; }
.story svg {
  position: absolute;
  top: 0;
  left: -24px;
  width: 48px;
  pointer-events: none;
  overflow: visible;
}
.era { position: relative; padding-bottom: 32px; }
.era + .era { padding-top: 40px; }
.era h2 { position: relative; }
.ms { position: relative; margin-top: 40px; }
.era h2 + .ms { margin-top: 28px; }
.ms p { margin-top: 10px; text-wrap: pretty; }
.ms .links { margin-top: 12px; }
.mark {
  position: absolute;
  left: calc(-1 * var(--rail) - 5px);
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
/* Era dot on the title line: 23px = eyebrow (13px line plus 10px margin),
   0.525em = half the 1.05 line height, 5px = half the dot */
.era h2 .mark { top: calc(23px + 0.525em - 5px); }
.ms .mark { top: 0.45em; }
/* No JS fallback loop at turning points */
.era.turning h2 .mark::after {
  content: "";
  position: absolute;
  left: -15px;
  top: -15px;
  width: 40px;
  height: 40px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  box-sizing: border-box;
}
@media (max-width: 899px) {
  /* 8px in from the body gutter so the turning point loops (radius 10) stay 14px off the screen edge */
  .story { margin-left: 8px; }
  .era.turning h2 .mark::after { left: -5px; top: -5px; width: 20px; height: 20px; }
}
.story.has-svg .mark::after { display: none; }
/* With the SVG line, each dot lights up once the line has reached it */
.story.has-svg .mark {
  opacity: 0;
  transform: scale(.4);
  transition: opacity 200ms var(--ease-out), transform 300ms var(--ease-out);
}
.story.has-svg .mark.lit { opacity: 1; transform: none; }

/* Light flavour per era */
.era-tech .ms p { font-family: var(--mono); }
.era-tech .ms p:not(.todo) { font-size: 0.9375rem; }
.era-music h3 { font-style: italic; letter-spacing: -0.01em; }

/* Desktop: cap portrait photos so a milestone stays shorter than a screen */
@media (min-width: 900px) {
  .ms figure:not(.xpost) img { max-height: 760px; object-fit: cover; object-position: 50% 30%; }
}

/* Stats */
.stat {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-family: var(--mono);
}
.stat strong {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.stat span { font-size: 0.875rem; color: var(--muted); }
@media (min-width: 900px) {
  .stat strong { font-size: 3.25rem; }
}

/* Placeholder lines: hidden for visitors, shown on /?draft=1 or #draft (main.js adds body.draft) */
.todo {
  margin-top: 12px;
  font: 400 0.8125rem/1.4 var(--mono);
  color: var(--muted);
}
body.draft .todo[hidden] { display: block; }

/* Static X post card */
.xpost {
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}
.xpost-handle { font: 400 0.875rem/1.3 var(--mono); color: var(--muted); }
.xpost-text { margin-top: 8px; }
.xpost picture { margin-top: 14px; }
.xpost img { border-radius: 4px; }
.xpost-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.875rem;
  color: var(--muted);
}
.xpost-meta a { margin-left: auto; color: var(--fg); }
@media (min-width: 900px) {
  .xpost { max-width: 460px; }
}
.xpost-meta a, footer a {
  display: inline-block;
  padding: 11px 0;
  margin-top: -11px;
  margin-bottom: -11px;
}

/* Portfolio contact sheet (a milestone inside the photography era) */
.portfolio > p { color: var(--muted); }
.sheet {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 900px) {
  .sheet { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
.sheet li { margin: 0; }
.sheet img { aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 20%; }
/* The one landscape frame runs the full row, whole, at its own ratio */
.sheet li.wide { grid-column: 1 / -1; }
.sheet li.wide img { aspect-ratio: 3 / 2; }

/* Footer */
/* body > footer so the break wins over the shared margin: 0 auto rule above;
   40px plus the last era's 32px bottom padding */
body > footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  font-size: 0.9375rem;
  color: var(--muted);
}
footer p + p { margin-top: 8px; }
.notfound { font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .name { animation: none; background-position: 60% 50%; }
  a { transition: none; }
  .story.has-svg .mark { opacity: 1; transform: none; transition: none; }
}
@media (forced-colors: active) {
  .name { background: none; color: CanvasText; animation: none; }
}
