:root {
  --text: #1a1a1a;
  --muted: #5f5952;
  --line: #e8e0d3;
  --accent: #782f40;
  --bg: #fbf8f2;
  --panel: #f3ede3;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

/* Layout: one column on small screens, sidebar + content on wide ones */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 20px 48px;
}

.side {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

main {
  max-width: 720px;
}

@media (min-width: 1000px) {
  .layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 80px;
    padding: 88px 48px 64px;
  }

  .side {
    position: sticky;
    top: 88px;
    align-self: start;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 0 32px 0 0;
  }

  main {
    max-width: 760px;
  }

  main > section:first-child {
    margin-top: 0;
  }
}

/* Sidebar */
.headshot {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 18px;
  border: 1px solid var(--line);
}

@media (min-width: 1000px) {
  .headshot {
    width: 168px;
    height: 168px;
    margin-bottom: 22px;
  }
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 12px;
}

h1 a {
  color: var(--accent);
  text-decoration: none;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  margin: 0 0 4px;
}

.toc {
  display: none;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 16px 0 0;
  font-size: 16px;
}

@media (min-width: 1000px) {
  .toc {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 36px 0 0;
    padding: 0;
    font-size: 16px;
  }

  .toc a {
    color: var(--text);
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
  }

  .toc a:hover {
    color: var(--accent);
    border-left-color: var(--accent);
  }

  .links {
    flex-direction: column;
    gap: 6px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
}

/* Content */
section {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 32px;
}

main > section:first-child {
  border-top: 0;
  padding-top: 0;
}

h2 {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--accent);
  margin: 0 0 28px;
}

p {
  margin: 0 0 14px;
}

/* Selected work */
.feature + .feature {
  margin-top: 56px;
}

.proj-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

h3 {
  font-size: 22px;
  margin: 0;
}

.proj-head span {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.meta {
  color: var(--muted);
  font-size: 15px;
  margin: 2px 0 14px;
}

.video {
  margin: 24px 0 0;
}

.video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.video figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

/* Two-column rows: More projects and Experience */
.row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.row:first-child {
  padding-top: 0;
}

.row:last-child {
  border-bottom: 0;
}

.row-label h3 {
  font-size: 19px;
}

.row-label span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  margin: 2px 0 8px;
}

.row-body p:last-child {
  margin-bottom: 0;
}

.timeline .row {
  padding: 12px 0;
  font-size: 17px;
  line-height: 1.45;
}

.timeline .row-label span {
  margin: 0;
}

.timeline .row-body {
  color: var(--muted);
}

.timeline .row-body b {
  color: var(--text);
}

@media (min-width: 720px) {
  .row {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
  }

  .row-label span {
    margin-bottom: 0;
  }

  .timeline .row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .timeline .row-label span {
    padding-top: 1px;
  }
}

.small {
  font-size: 16px;
  color: var(--muted);
  margin-top: 16px;
}

footer {
  margin-top: 72px;
  font-size: 14px;
  color: var(--muted);
}
