:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --accent-primary: #3182ce;
  --accent-secondary: #63b3ed;
  --border-color: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --text-primary: #f7fafc;
  --text-secondary: #cbd5e0;
  --accent-primary: #63b3ed;
  --accent-secondary: #4299e1;
  --border-color: #4a5568;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: background 0.3s ease, color 0.3s ease;
}

#container {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.theme-toggle {
  margin-left: auto;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.site-nav a {
  font-family: 'Chivo', sans-serif;
  color: var(--text-secondary);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-primary);
}

header {
  background: var(--bg-primary);
  padding: 4rem 3rem;
  border-radius: 16px;
  box-shadow: 0 8px 16px var(--shadow);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.headshot {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid var(--bg-secondary);
  box-shadow: 0 4px 12px var(--shadow);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

h1 {
  font-family: 'Chivo', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: 'Chivo', sans-serif;
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-weight: 400;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
  color: var(--text-secondary);
}

h3 {
  font-family: 'Chivo', sans-serif;
  font-size: 1.875rem;
  color: var(--text-primary);
  margin: 3rem 0 1.25rem 0;
  font-weight: 900;
  position: relative;
  padding-bottom: 0.5rem;
}

h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
}

h4 {
  font-family: 'Chivo', sans-serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem 0;
  font-weight: 900;
}

hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 3rem 0;
  opacity: 0.5;
}

#main_content {
  background: var(--bg-primary);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 8px 16px var(--shadow);
}

#main_content > p:first-child {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 2rem;
  border-left: 5px solid var(--accent-primary);
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

li {
  padding: 1rem 1rem 1rem 3rem;
  position: relative;
  margin-bottom: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
}

li:before {
  content: "";
  position: absolute;
  left: 1.4rem;
  top: calc(1rem + 0.92rem - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  position: relative;
  font-weight: 500;
}

a:hover {
  color: var(--accent-secondary);
}

footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.25rem; }
  header, #main_content { padding: 2rem 1.5rem; }
  header { flex-direction: column; text-align: center; gap: 1.25rem; }
  .headshot { width: 110px; height: 110px; }
  .contact { justify-content: center; }
  .site-nav { gap: 1rem; }
}

/* Pages made from Markdown files, like the CV */
.prose {
  overflow-wrap: anywhere;
}

.prose h1 {
  font-family: 'Chivo', sans-serif;
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 3rem 0 1.25rem 0;
  padding-bottom: 0.5rem;
  position: relative;
  line-height: 1.3;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.prose h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.prose h1:first-child {
  font-size: 3rem;
  margin-top: 0;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prose h1:first-child::after {
  display: none;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-primary);
  margin: 2rem 0 1rem 0;
}

.prose ul {
  margin: 0.5rem 0 1.25rem 0;
}

.prose li {
  background: none;
  padding: 0.2rem 0 0.2rem 1.5rem;
  margin: 0;
  color: var(--text-secondary);
}

.prose li:before {
  left: 0.25rem;
  top: calc(0.2rem + 0.92rem - 3px);
  width: 6px;
  height: 6px;
}

/* Lines like "Job title | 2020" get read as one-row tables; show them as plain lines */
.prose table,
.prose tbody,
.prose tr {
  display: block;
}

.prose table {
  margin-bottom: 1.25rem;
}

.prose td {
  display: inline;
  padding: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.prose td + td::before {
  content: " | ";
}

.prose blockquote {
  border-left: 4px solid var(--border-color);
  padding-left: 1.25rem;
  margin: 0 0 1.25rem 0;
}

.prose strong {
  color: var(--text-primary);
}

/* Projects page: each project is set apart with a divider */
.projects h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.projects h1 + p + h2 {
  border-top: none;
  padding-top: 0;
}

@media (max-width: 768px) {
  .prose h1:first-child { font-size: 2.25rem; }
  .prose h1 { font-size: 1.5rem; }
}
