:root {
  --bg: #faf9f6;
  --bg-alt: #f1efe9;
  --ink: #1a1a18;
  --muted: #6b6a63;
  --line: #d8d5cc;
  --accent: #a6462c;
  --radius: 2px;
  --max-width: 1040px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --bg-alt: #1c1a15;
    --ink: #efece4;
    --muted: #9a978c;
    --line: #34322a;
    --accent: #d97a5c;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: inherit; }

/* header */

.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
}

.mark {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 1px solid var(--ink);
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
}

.header-row nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  overflow-x: auto;
}

.header-row nav a {
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.header-row nav a:hover { color: var(--accent); }

.btn {
  border: 1px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
  flex: none;
}

.btn:hover { background: var(--ink); color: var(--bg); }

/* hero */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--line);
}

.hero .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2.5rem;
}

.hero-portrait {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
}

/* sections */

.section {
  border-bottom: 1px solid var(--line);
  padding: 3.25rem 0;
}

.section-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.section-label .num {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.section-body { min-width: 0; }

.lead {
  font-size: 1.15rem;
  font-family: var(--serif);
  line-height: 1.5;
  margin-top: 0;
}

.muted { color: var(--muted); font-weight: normal; }

/* experience / education entries */

.entry { margin-bottom: 2rem; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
}

.entry h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
}

.entry-dates {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin: 0;
}

.entry-org {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}

.entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.entry li { margin-bottom: 0.35rem; }

/* project cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  display: block;
}

.card-index {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
}

.card p { margin: 0 0 0.5rem; font-size: 0.92rem; }
.stack { color: var(--muted); font-size: 0.8rem; margin-top: auto; padding-top: 0.5rem; }

/* pdf embed */

.pdf-embed {
  border: 1px solid var(--line);
  overflow: hidden;
  height: 80vh;
  min-height: 500px;
  margin-top: 1rem;
}

.pdf-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-alt);
}

/* skills */

.skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
}

.skills-list li {
  border: 1px solid var(--line);
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* footer */

footer {
  padding: 1.5rem 0 2.5rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-row a { text-decoration: none; }
.footer-row a:hover { color: var(--accent); }

@media (max-width: 700px) {
  .section-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
}
