:root {
  --ink: #1b1a17;
  --body: #3a3833;
  --muted: #6b675f;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --line: #e8e3da;
  --accent: #c54e21;
  --accent-dark: #a43f19;
  --accent-soft: #fbefe8;
  --highlight: #ffd8a8;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.04), 0 4px 16px rgba(27, 26, 23, 0.05);
  --shadow-hover: 0 2px 4px rgba(27, 26, 23, 0.05), 0 12px 32px rgba(27, 26, 23, 0.09);
  --max-width: 760px;
  --wide-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--highlight); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-dark); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.wide { max-width: var(--wide-width); }

h1, h2, h3 { color: var(--ink); }

h1 {
  font-family: var(--display);
  font-size: 46px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
h2:first-of-type { margin-top: 0; }

p { margin: 0 0 16px; }

/* ---------- header & footer ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 64px;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-name::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.site-name:hover { color: var(--ink); }

nav.site-nav { display: flex; gap: 4px; font-size: 15px; font-weight: 500; }
nav.site-nav a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
nav.site-nav a:hover { color: var(--ink); background: rgba(27, 26, 23, 0.05); }
nav.site-nav a.active { color: var(--ink); background: rgba(27, 26, 23, 0.07); }

main { padding: 56px 0 88px; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  font-size: 14px;
  color: var(--muted);
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* ---------- shared bits ---------- */
.kicker,
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.tagline {
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 22px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  color: #fff;
  padding: 3px 9px;
  border-radius: 6px;
}
.badge-linkedin { background: #0a66c2; }
.badge-medium { background: #000; }
.badge-hackernoon { background: #128c68; }

/* ---------- homepage ---------- */
.section { margin-top: 88px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink);
  margin: 0;
  padding: 0;
  border: none;
}
.section-link { font-size: 15px; font-weight: 600; white-space: nowrap; }

.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero h1 { font-size: clamp(42px, 5.6vw, 64px); margin-bottom: 18px; }
.hero-lede { font-size: 21px; line-height: 1.55; color: var(--body); margin-bottom: 28px; }
.hero-lede mark {
  color: inherit;
  background: linear-gradient(transparent 62%, var(--highlight) 62%);
  padding: 0 1px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.hero-creds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.hero-creds span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

.hero-photo { position: relative; margin: 0; }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: 24px;
  background: var(--accent-soft);
  border: 1px solid #f1d6c8;
}
.hero-photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 24px 22px; }
.stat-fig {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 10px;
}
.stat-fig small { font-size: 0.55em; }
.stat-label { font-size: 14px; line-height: 1.45; color: var(--muted); }

.career { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.career > .card { padding: 28px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 18px;
}
.card-title.second { margin-top: 28px; }
.role + .role { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.role-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.role-title { font-size: 18px; font-weight: 600; color: var(--ink); }
.role-date { font-size: 14px; color: var(--muted); white-space: nowrap; }
.role-org { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.role ul { margin: 0; padding-left: 18px; font-size: 15.5px; }
.role li { margin-bottom: 4px; }
.role li::marker { color: var(--accent); }
.edu { margin-bottom: 14px; }
.edu strong { display: block; color: var(--ink); font-weight: 600; }
.edu span { font-size: 14px; color: var(--muted); }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 14px;
}
.skills-list li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--body);
}

.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.article {
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: var(--body);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.article:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #ddd5c8; color: var(--body); }
.article .badge { align-self: flex-start; margin-bottom: 16px; }
.article h3 { font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.25; margin: 0 0 10px; }
.article p { font-size: 15px; color: var(--muted); margin: 0 0 18px; flex: 1; }
.article-more { font-size: 14px; font-weight: 600; color: var(--accent); }

.project {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: center;
  padding: 36px;
}
.project h3 { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 14px; }
.line-bullets { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 24px; }
.line-bullets span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.project-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.project-note { font-size: 14px; color: var(--muted); }
.project-shot { display: block; }
.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hover);
  transition: transform 0.2s ease;
}
.project-shot:hover img { transform: translateY(-3px); }

.life { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.life-card { padding: 22px; }
.life-icon { font-size: 24px; line-height: 1; margin: 0 0 14px; }
.life-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}
.life-value { font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--ink); margin: 0; }
.life-value a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--highlight); text-decoration-thickness: 3px; text-underline-offset: 2px; }
.life-value a:hover { color: var(--accent); }
.life-value em { font-style: normal; }
.life-card.countdown { background: var(--ink); border-color: var(--ink); }
.countdown .life-label { color: var(--highlight); }
.countdown-fig { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 4px; }
.countdown-days {
  font-family: var(--display);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}
.countdown-unit { font-size: 15px; color: #fff; }
.countdown-note { font-size: 13px; color: #bdb6a8; margin: 0; }

.contact {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 40px;
  background: var(--ink);
  border-color: var(--ink);
  color: #d9d3c7;
}
.contact h2 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-transform: none;
  color: #fff;
  margin: 0 0 10px;
  padding: 0;
  border: none;
}
.contact p { margin: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.contact .btn { background: var(--accent); border-color: var(--accent); }
.contact .btn:hover { background: #fff; border-color: #fff; color: var(--ink); }
.contact .btn.ghost { background: transparent; color: #fff; border-color: #4a463f; }
.contact .btn.ghost:hover { border-color: #fff; }

/* ---------- writing page ---------- */
.pieces { display: grid; gap: 16px; }

.piece {
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.piece:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #ddd5c8; }
.piece[hidden] { display: none; }

.piece-title {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.piece-title a { color: var(--ink); }
.piece-title a:hover { color: var(--accent); }

.piece-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.piece-excerpt { font-size: 16px; color: var(--body); margin-bottom: 16px; }

.piece-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.piece-foot > a { font-size: 15px; font-weight: 600; }
.piece-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.piece.featured {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 65%);
  border-color: #f1d6c8;
  padding: 30px 32px;
}
.piece.featured .piece-title { font-size: 28px; }
.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid #f1d6c8;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.featured-label::before { content: "★"; }

.topic-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.chip,
.tag {
  font-family: var(--sans);
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px 14px;
}
.chip .count { color: var(--muted); font-size: 12px; margin-left: 2px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .count { color: rgba(255, 255, 255, 0.7); }

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 10px;
}
.tag:hover,
.tag.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.chip:focus-visible,
.tag:focus-visible,
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.filter-status { font-size: 14px; color: var(--muted); min-height: 1.5em; margin-bottom: 16px; }

/* ---------- resume page ---------- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.download-btn {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 11px 20px;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.download-btn:hover { background: var(--accent); color: #fff; }

.timeline { position: relative; }
.entry { position: relative; padding-left: 24px; margin-bottom: 28px; }
.timeline .entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline .entry:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 22px;
  bottom: -26px;
  width: 2px;
  background: var(--line);
}

.entry-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.entry-role { font-weight: 600; font-size: 18px; color: var(--ink); }
.entry-org { color: var(--muted); font-size: 15px; }
.entry-date { font-size: 14px; color: var(--muted); white-space: nowrap; }

ul.bullets { margin: 10px 0 0; padding-left: 20px; }
ul.bullets li { margin-bottom: 6px; }
ul.bullets li::marker { color: var(--accent); }

/* ---------- responsive & print ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 280px; order: -1; }
  .stats, .life { grid-template-columns: repeat(2, 1fr); }
  .career, .project, .contact { grid-template-columns: 1fr; }
  .articles { grid-template-columns: 1fr; }
  .contact-links { justify-content: flex-start; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 36px; }
  .hero-lede { font-size: 18px; }
  .section { margin-top: 64px; }
  .section-title { font-size: 26px; }
  .stats { gap: 10px; }
  .stat { padding: 18px 16px; }
  .stat-fig { font-size: 32px; }
  .life { grid-template-columns: 1fr; }
  .project, .contact, .career > .card { padding: 24px 20px; }
  .piece, .piece.featured { padding: 22px 20px; }
  nav.site-nav a { padding: 6px 9px; }
  header.site .wrap { padding-top: 10px; padding-bottom: 10px; }
}

@media print {
  header.site, footer.site, .download-btn, .hero-ctas, .topic-filter, .filter-status { display: none; }
  body { font-size: 12px; background: #fff; }
  .wrap { max-width: 100%; }
  .card, .piece { box-shadow: none; }
}
