:root {
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #fcfaf7;
  --card: #f4f2f0;
  --muted: #eeecea;
  --text: #121110;
  --text-muted: #5f5d5b;
  --text-muted-strong: #3c3a38;
  --border: #e1dfdd;
  --accent: #915c00;
  --accent-text: #fcfaf7;
  --radius: 0.75rem;
  --radius-btn: 0.25rem;
  --max-width: 46rem;
}

[data-theme="dark"] {
  --bg: #141414;
  --card: #222222;
  --muted: #201f1e;
  --text: #ffffff;
  --text-muted: #939291;
  --text-muted-strong: #bebdbc;
  --border: #3a3a3a;
  --accent: #588ee0;
  --accent-text: #141414;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.footer {
  box-sizing: content-box;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) {
  .footer {
    padding-inline: 3rem;
  }
}

@media (min-width: 64rem) {
  .footer {
    padding-inline: 4.5rem;
  }
}

/* Page frame — the vertical margin lines flanking header + main */
.page-frame {
  border-inline: 0 solid var(--border);
  margin-inline: 0;
}

@media (min-width: 40rem) {
  .page-frame {
    border-inline-width: 1px;
    margin-inline: 1.5rem;
  }
}

@media (min-width: 64rem) {
  .page-frame {
    margin-inline: 2.5rem;
  }
}

main,
.header {
  box-sizing: content-box;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) {
  main,
  .header {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 64rem) {
  main,
  .header {
    padding-inline: 2rem;
  }
}

/* Header */
.header {
  padding-top: 64px;
  padding-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.header-main {
  flex: 1 1 380px;
  min-width: 0;
}

.name {
  font-family: var(--font-heading);
  font-size: 2.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}

@media (min-width: 48rem) {
  .name {
    font-size: 3rem;
  }
}

.role {
  font-size: 19px;
  color: var(--text-muted-strong);
  margin: 16px 0 20px;
  font-weight: 400;
}

@media (min-width: 48rem) {
  .role {
    font-size: 21px;
  }
}

.statement {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 55ch;
  margin: 0 0 24px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-sm {
  padding: 5px 9px;
  font-size: 0.75rem;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-sidebar {
  flex: 0 0 224px;
  width: 100%;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--text-muted);
}

@media (min-width: 48rem) {
  .header-sidebar {
    width: auto;
    padding-top: 4px;
    padding-left: 24px;
    margin-top: 0;
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

.sidebar-line {
  margin: 0 0 8px;
}

.sidebar-label {
  color: var(--text-muted-strong);
  font-weight: 500;
  margin-right: 4px;
}

.header-sidebar a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.header-sidebar a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Sections */
.section {
  padding: 0 0 56px;
}

.rule-bleed {
  border-top: 1px solid var(--border);
  margin-inline: calc(50% - 50vw);
  margin-bottom: 40px;
}

.rule-bleed.rule-bleed-flush {
  margin-bottom: 0;
}

.section-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.section-subtitle {
  color: var(--text-muted);
  margin: -16px 0 24px;
}

/* Timeline (Experience / Education) — plain list, no card bubbles */
.timeline {
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin: 0;
  margin-left: 4px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  top: 6px;
  left: -28.5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.timeline-item.is-current .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 100%, transparent);
}

.timeline-date {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text);
  margin: 4px 0 12px;
}

.timeline-org a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.timeline-org a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.timeline-org {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}

.timeline-bullets {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-bullets li {
  margin-bottom: 4px;
}

.timeline-bullets li::marker {
  color: var(--border);
}

/* Project cards */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.card-image-frame {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--muted);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 8px;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

/* Tags — subtle pill, used across timeline + project cards */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: color-mix(in srgb, var(--muted) 60%, transparent);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

/* Contact */
/* Contact form */
.contact-form {
  margin-top: 24px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form-honeypot {
  display: none;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted-strong);
}

.form-input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-form .btn {
  align-self: flex-start;
  cursor: pointer;
}

.form-note {
  margin: -6px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Reading Shelf */
.shelf-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .shelf-list {
    grid-template-columns: 1fr;
  }
}

.shelf-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: border-color 0.2s ease;
}

.shelf-card:hover {
  border-color: var(--accent);
}

.shelf-thumb {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--muted);
}

.shelf-thumb-empty {
  border-bottom: 1px solid var(--border);
}

.shelf-card-body {
  padding: 12px;
}

.shelf-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-site {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.shelf-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  padding: 32px 0 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-name {
  margin: 0;
  font-weight: 500;
  color: var(--text-muted-strong);
}

.footer-location {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-body);
}

.footer-links {
  display: flex;
  gap: 8px;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer-bottom {
  flex: 1 0 100%;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.footer.footer-centered {
  text-align: center;
  flex-direction: column;
  align-items: center;
}

#icon-moon {
  display: none;
}

[data-theme="dark"] #icon-sun {
  display: none;
}

[data-theme="dark"] #icon-moon {
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .header {
    padding-top: 40px;
  }

  .name {
    font-size: 2rem;
  }

  .card {
    flex-direction: column;
  }

  .card-image-frame {
    width: 100%;
    height: 140px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Thanks / 404 pages */
.thanks-wrap {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 0;
}

.thanks-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

.thanks-text {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 50ch;
  margin: 0 0 28px;
}
