:root {
  --paper: #f5f5f3;
  --ink: #111111;
  --accent: #111111;
  --tone: #d9d9d6;
  --mid: #8a8a8a;
  --muted: #666666;
  --rule: 2px solid var(--ink);
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  /* faint paper grain */
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
}

a { color: inherit; }

.mono {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.label { color: var(--muted); margin-bottom: 24px; font-weight: 500; }

/* top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: var(--rule);
}
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--mid); }

section { padding: 72px 0; border-bottom: var(--rule); }

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: end;
}
h1 {
  font-size: clamp(64px, 11vw, 140px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
h1 em { font-weight: 400; font-style: italic; color: var(--accent); }
.lede { font-size: 22px; max-width: 26ch; }
.location { color: var(--muted); margin-top: 18px; }
.contact .location { margin-top: 24px; }
.contact .links { margin-top: 10px; }

.stripes { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; width: 160px; }
.stripes i { display: block; height: 10px; }
.stripes i:nth-child(1) { background: var(--ink); }
.stripes i:nth-child(2) { background: var(--mid); }
.stripes i:nth-child(3) { background: var(--tone); }

.portrait {
  background: var(--tone);
  border: var(--rule);
  padding: 16px 16px 0;
  box-shadow: 8px 8px 0 var(--ink);
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  transition: transform 0.4s ease;
}
.portrait:hover img { transform: scale(1.03); }

/* portrait depixelates once: chunky pixels shrink smoothly, then fade into the halftone */
.print { display: block; position: relative; }
.print .px {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.motion .print .final { opacity: 0; }
.print.is-done .final { opacity: 1; transition: opacity 0.45s ease; }
.print.is-done .px { opacity: 0; transition: opacity 0.45s ease; }
.portrait figcaption {
  border-top: var(--rule);
  margin: 0 -16px;
  padding: 10px 16px;
  background: var(--paper);
  font-size: 11px;
}

/* work list */
.work { list-style: none; border-top: 1px solid var(--ink); }
.work .row {
  display: grid;
  grid-template-columns: 56px 1fr auto 40px;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  transition: padding 0.25s ease, background 0.25s ease;
}
.work .title { font-size: clamp(26px, 4vw, 40px); font-weight: 600; letter-spacing: -0.01em; }
.work .num, .work .meta { color: var(--muted); }
.work summary { cursor: pointer; list-style: none; }
.work summary::-webkit-details-marker { display: none; }
.work summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.work .toggle {
  justify-self: end;
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1;
  transition: transform 0.25s ease;
}
.work details[open] .toggle { transform: rotate(45deg); color: var(--accent); }
.work .row:hover { background: var(--ink); color: var(--paper); padding-left: 16px; padding-right: 16px; }
.work .row:hover .num, .work .row:hover .meta, .work .row:hover .toggle { color: var(--tone); }

.work .detail {
  padding: 28px 0 36px 72px;
  border-bottom: 1px solid var(--ink);
  max-width: 820px;
}
.work .desc { font-size: 20px; max-width: 48ch; margin-bottom: 24px; }
.specs { display: grid; gap: 14px; }
.specs > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: baseline; }
.specs dt { color: var(--muted); }
.specs ul { list-style: none; }
.specs dd > ul:not(.chips) li { padding-left: 1.2em; text-indent: -1.2em; margin-bottom: 8px; }
.specs dd > ul:not(.chips) li::before { content: "— "; color: var(--accent); }
.specs strong { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 11px; border: 1.5px solid var(--ink); padding: 4px 10px; background: var(--paper); }
.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border: var(--rule);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.note { margin-top: 24px; color: var(--muted); font-size: 11px; }

/* arrow icon (SVG, so phones don't swap it for an emoji) */
.arr {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  vertical-align: -0.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}
.big-link .arr { width: 0.7em; height: 0.7em; stroke-width: 2.4; vertical-align: 0; }

/* introduction */
.intro p { font-size: clamp(20px, 2.6vw, 26px); max-width: 38ch; line-height: 1.4; margin-bottom: 20px; }
.intro p:first-child { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.25; }
.intro strong { font-weight: 600; background: linear-gradient(transparent 62%, var(--tone) 62%); }

.skills {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 48px;
  border-top: var(--rule);
}
.skills li { padding: 20px 20px 4px 0; }
.skills li + li { border-left: 1px solid var(--ink); padding-left: 20px; }
.skills h3 { font-size: 26px; font-weight: 600; margin: 6px 0 8px; }
.skills .num { color: var(--accent); }
.skills p { color: var(--muted); font-size: 11px; line-height: 1.7; }

/* how I work: same grid as skills, but with readable sentences */
.principles { margin-top: 0; }
.principles h3 { font-size: 24px; line-height: 1.15; margin-bottom: 12px; }
.principles p { color: var(--ink); font-size: 17px; line-height: 1.5; padding-bottom: 16px; }

/* contact */
.big-link {
  display: inline-block;
  font-size: clamp(44px, 9vw, 110px);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}
.big-link:hover { color: var(--mid); }
.links { margin-top: 28px; }
.links a:hover { color: var(--mid); }

footer { padding: 28px 0 40px; color: var(--muted); }

@media (max-width: 760px) {
  body { padding: 0 16px; }
  .topbar nav { gap: 14px; }
  .hero { grid-template-columns: 1fr; }
  .portrait { max-width: 360px; }
  .work .row { grid-template-columns: 36px 1fr auto; row-gap: 4px; }
  .work .meta { grid-column: 2; grid-row: 2; }
  .work .toggle { grid-column: 3; grid-row: 1; }
  .skills { grid-template-columns: 1fr; }
  .skills li + li { border-left: 0; border-top: 1px solid var(--ink); padding-left: 0; }
  .work .detail { padding-left: 0; }
  .specs > div { grid-template-columns: 1fr; gap: 4px; }
  section { padding: 56px 0; }
}

/* streaming text */
[data-stream] .w {
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
[data-stream] .w.on { opacity: 1; filter: none; }
.caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: blink 0.8s steps(1) infinite;
}
.caret.is-typing { animation: none; } /* solid while typing, blinks at rest */
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
