:root {
  --bg: #fafaf7;
  --fg: #1c1c1a;
  --muted: #55554f;
  --soft: #3a3a36;
  --line: #e4e3dc;
  --accent: #9c4320;
  --card: #ffffff;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}
:root[data-theme="dark"] {
  --bg: #121211;
  --fg: #ecebe5;
  --muted: #b1b0a7;
  --soft: #d2d1c9;
  --line: #2a2a27;
  --accent: #e8966c;
  --card: #1a1a18;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --fg: #ecebe5;
    --muted: #b1b0a7;
    --soft: #d2d1c9;
    --line: #2a2a27;
    --accent: #e8966c;
    --card: #1a1a18;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 19px/1.65 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }
p { margin: 0 0 14px; }

header.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0; font: 14px/1 var(--sans);
}
header.top nav a { color: var(--muted); margin-right: 20px; }
header.top nav a:hover { color: var(--fg); text-decoration: none; }
.tools { display: flex; gap: 10px; }
.tools a, .tools button {
  font: inherit; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.tools a:hover, .tools button:hover { color: var(--fg); border-color: var(--muted); text-decoration: none; }

/* hero */
.hero { padding: 90px 0 70px; display: grid; grid-template-columns: 1fr 190px; gap: 48px; align-items: center; }
.hero .kicker { font: 600 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 22px; }
.hero h1 {
  font: 700 clamp(2.4rem, 6vw, 4.4rem)/1.05 var(--sans); letter-spacing: -0.035em; margin: 0 0 24px;
}
.hero .lead { font-size: 1.3rem; color: var(--soft); max-width: 34em; margin-bottom: 28px; }
.hero img {
  width: 190px; height: 190px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); justify-self: end;
}
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  font: 600 14px/1 var(--sans); padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--fg); color: var(--fg);
}
.btn:hover { text-decoration: none; background: var(--fg); color: var(--bg); }
.btn.solid { background: var(--fg); color: var(--bg); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* sections */
section { padding: 70px 0; border-top: 1px solid var(--line); }
h2 { font: 700 clamp(1.6rem, 3.5vw, 2.2rem)/1.15 var(--sans); letter-spacing: -0.02em; margin: 0 0 8px; }
.sub { color: var(--muted); font: 16px/1.5 var(--sans); margin: 0 0 36px; max-width: 38em; }

/* featured work */
.work { display: grid; gap: 28px; }
.feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
.feature:nth-child(even) .shot { order: 2; }
.shot { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.shot img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform .3s; }
.shot:hover img { transform: scale(1.03); }
.shot::after {
  content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
  display: grid; place-items: center; font-size: 18px; padding-left: 3px;
}
.feature .tag { font: 600 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.feature h3 { font: 700 1.5rem/1.2 var(--sans); letter-spacing: -0.01em; margin: 0 0 10px; }
.feature p { color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.chips li { font: 14px var(--sans); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }

/* beyond code */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.tile .tag { font: 600 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.tile h3 { font: 700 1.2rem/1.25 var(--sans); margin: 0 0 10px; }
.tile p { color: var(--soft); font-size: 17px; font-weight: 450; margin: 0 0 10px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline .yr { font: 14px/1.8 var(--sans); color: var(--muted); }
.timeline strong { font: 600 16px var(--sans); }
.timeline span { color: var(--soft); font-size: 17px; }

/* writing + code */
.writing-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.repos { list-style: none; margin: 0; padding: 0; }
.repos li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.repos a { font: 600 16px var(--sans); }
.repos small { color: var(--muted); font: 15px var(--sans); }

.quiet { font: 15px/1.7 var(--sans); color: var(--muted); }
.quiet b { color: var(--fg); font-weight: 600; }

footer { padding: 50px 0 70px; border-top: 1px solid var(--line); font: 14px/1.6 var(--sans); color: var(--muted); }
footer .big { font: 700 clamp(1.6rem, 4vw, 2.4rem)/1.15 var(--sans); letter-spacing: -0.02em; color: var(--fg); margin-bottom: 20px; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 50px 0 40px; }
  .hero img { width: 110px; height: 110px; justify-self: start; order: -1; }
  .feature { grid-template-columns: 1fr; }
  .feature:nth-child(even) .shot { order: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  header.top nav { display: none; }
  section { padding: 48px 0; }
}

/* blog posts */
.posts { list-style: none; margin: 0 0 24px; padding: 0; }
.posts li { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; }
.posts a b { font: 600 17px/1.35 var(--sans); }
.posts small { font: 13px var(--sans); color: var(--muted); align-self: center; }
.posts p { grid-column: 1 / -1; margin: 0; color: var(--soft); font-size: 17px; }

/* icons */
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.btn .ic { margin-right: 8px; }
.btn { display: inline-flex; align-items: center; }
.tag .ic { width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; }
.ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.ico .ic { width: 24px; height: 24px; }
.tile { transition: transform .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); }
footer p a { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; }

/* links inside running text stay recognisable without relying on colour */
.tile p a, .feature p a, .quiet a, .sub a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* code section eras */
.era { font: 700 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 28px 0 4px; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.era-note { color: var(--muted); font: 15px/1.5 var(--sans); margin: 0 0 8px; }
.era-todo { color: var(--soft); margin: 8px 0 0; }
.todo { font: 700 11px/1 var(--sans); letter-spacing: .1em; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 3px 8px; margin-right: 8px; vertical-align: 2px; }
