/*──────────────────────────────────────────────────────────────────────────────
  0. Color variables (minimal black and white theme)
──────────────────────────────────────────────────────────────────────────────*/
:root {
  --bg:           #ffffff;   /* pure white */
  --text:         #000000;   /* pure black */
  --muted:        #666666;   /* dark gray for secondary text */
  --divider:      #e0e0e0;   /* light gray divider */
  --accent:       #000000;   /* black accent */
  --shadow-light: rgba(0,0,0,0.1);
  --profile-gap: 0.2rem;
}

/* Dark mode color variables */
[data-theme="dark"] {
  --bg:           #0a0a0a;   /* very dark background */
  --text:         #ffffff;   /* white text */
  --muted:        #cccccc;   /* light gray for secondary text */
  --divider:      #333333;   /* dark gray divider */
  --accent:       #ffffff;   /* white accent */
  --shadow-light: rgba(255,255,255,0.1);
}

/*──────────────────────────────────────────────────────────────────────────────
  1. Ensure full‐viewport background
──────────────────────────────────────────────────────────────────────────────*/
html {
  background-color: var(--bg);
}

/*──────────────────────────────────────────────────────────────────────────────
  2. Base resets & body styles (font & color)
──────────────────────────────────────────────────────────────────────────────*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.7;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

/*──────────────────────────────────────────────────────────────────────────────
  3. Header and Navigation
──────────────────────────────────────────────────────────────────────────────*/
.header-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
}

/* Theme toggle button */
.theme-toggle {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.name-title {
  font-size: 1.3rem;
  color: var(--text);
  font-weight: 400;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  letter-spacing: -0.5px;
  margin: 0;
  text-align: center;
}

/* Dropdown styles */
.dropdown {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-block;
}

.dropdown-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  min-width: 80px;
}

.dropdown-btn:hover {
  background: var(--divider);
  color: var(--text);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--bg);
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1;
  border: 1px solid var(--divider);
  border-radius: 4px;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.dropdown-content a {
  color: var(--text);
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
  transition: background-color 0.15s ease;
  font-size: 0.9rem;
  text-align: center;
}

.dropdown-content a:hover {
  background-color: var(--divider);
}

.dropdown-content a:first-child {
  border-radius: 4px 4px 0 0;
}

.dropdown-content a:last-child {
  border-radius: 0 0 4px 4px;
}

/* Remove hover-based display since we're using JavaScript */

/*──────────────────────────────────────────────────────────────────────────────
  4. Main content container
──────────────────────────────────────────────────────────────────────────────*/
.main-content {
  text-align: left;
  max-width: 100%;
  margin-top: 0.7rem;
}

/*──────────────────────────────────────────────────────────────────────────────
  5. Profile header & avatar
──────────────────────────────────────────────────────────────────────────────*/
.profile-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 0;
  margin-top: 0;
}

.profile-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px var(--shadow-light);
}

/*──────────────────────────────────────────────────────────────────────────────
  6. Profile text metadata (heading & muted)
──────────────────────────────────────────────────────────────────────────────*/
.profile-meta .name {
  font-size: 2.5rem;
  margin-bottom: 0.2rem;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.5px;
}

.profile-meta .title {
  font-size: 1rem;
  margin-bottom: 0.1rem;
  color: var(--muted);
}

.profile-meta .affiliation {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 500;
}

.profile-meta .contact {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

.profile-meta .contact a {
  color: var(--text);
  text-decoration: none;
}

.profile-meta .contact a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.social-links {
  display: inline-flex;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  justify-content: center;
}

.social-links a {
  color: var(--text);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--muted);
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────────────
   7. Apply uniform vertical spacing
─────────────────────────────────────────────────────────────────────────────── */
.profile-meta .affiliation,
.profile-meta .contact,
.social-links {
  margin: var(--profile-gap) 0;
}

/*──────────────────────────────────────────────────────────────────────────────
  8. Divider (lighter)
──────────────────────────────────────────────────────────────────────────────*/
.divider {
  border: none;
  border-top: 1px dashed var(--divider);
  margin: 1.5rem auto;
  max-width: 600px;
}

/*──────────────────────────────────────────────────────────────────────────────
  9. Intro paragraphs & links
──────────────────────────────────────────────────────────────────────────────*/
.intro p {
  margin-bottom: 1rem;
  font-size: 1.08rem;
  color: var(--text);
  text-align: left;
}

.intro a {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
}

.intro a:hover {
  color: var(--muted);
  text-decoration: underline;
}

/*──────────────────────────────────────────────────────────────────────────────
  10. Research section
──────────────────────────────────────────────────────────────────────────────*/
.research {
  text-align: left;
  margin-top: 5rem;
}

.research-heading {
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px dashed var(--divider);
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.5px;
  text-align: center;
}

.research-entry {
  margin-bottom: 1rem;
  margin-top: 3rem;
}

.research-authors {
  color: var(--muted);
  font-size: 0.98em;
}

.author-name {
  color: var(--text);
}

/*──────────────────────────────────────────────────────────────────────────────
  11. Call-to-action highlights
──────────────────────────────────────────────────────────────────────────────*/
.highlight {
  color: var(--text);
  font-weight: bold;
}

.highlight-sage {
  background-color: var(--text);
  color: var(--bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-weight: bold;
}

/*──────────────────────────────────────────────────────────────────────────────
  12. Section headings (darker, modern)
──────────────────────────────────────────────────────────────────────────────*/
section h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--text);
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.5px;
}

/*──────────────────────────────────────────────────────────────────────────────
  13. Global links & footer
──────────────────────────────────────────────────────────────────────────────*/
a {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
}

a:hover {
  color: var(--muted);
  text-decoration: underline;
}

footer {
  margin-top: 3rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

footer a {
  color: var(--text);
}

footer a:hover {
  color: var(--muted);
}

/*──────────────────────────────────────────────────────────────────────────────
  14. Work Experience Timeline (light mode)
──────────────────────────────────────────────────────────────────────────────*/
.work-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: left;
  margin-top: 5rem;
}

.work-heading {
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px dashed var(--divider);
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.5px;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  text-align: center;
}

.work-timeline {
  display: flex;
  flex-direction: column;
  gap: 3.2rem;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  position: relative;
}

.work-entry {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 4.2rem;
  gap: 2.1rem;
  position: relative;
}

.work-icon, .work-icon-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
}

.work-icon {
  width: 4.2rem;
  height: 4.2rem;
  background: none;
  border-radius: 0.7rem;
  box-shadow: none;
  font-size: 2.8rem;
  color: var(--text);
  border: none;
}

.work-icon-wide {
  align-items: center;
  justify-content: center;
  height: 4.2rem;
}

.work-icon img, .work-icon svg,
.work-icon.work-icon-wide img, .work-icon.work-icon-wide svg {
  display: block;
  margin: auto;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

.work-entry:not(:last-child) .work-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 0.09rem;
  height: 3.2rem;
  background: var(--muted);
  z-index: 0;
}

.work-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  text-align: left;
}

.work-title {
  font-size: 1.08rem;
  font-weight: 400;
  color: var(--text);
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  letter-spacing: 0.01em;
}

.work-role {
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 0.15rem;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
}

.work-dates {
  font-size: 0.98rem;
  color: var(--muted);
  margin-left: 0;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  margin-top: 0.05rem;
}

.work-title-row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.work-dot {
  color: var(--text);
  margin: 0 0.6em;
  font-weight: 400;
}

/* Responsive design */
@media (max-width: 600px) {
  body {
    padding: 1rem;
    max-width: 100%;
  }
  
  .name-title {
    font-size: 1.1rem;
  }
  
  .dropdown-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .work-timeline {
    gap: 1.5rem;
  }
  .work-entry {
    gap: 0.7rem;
  }
  .work-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  .work-icon-wide {
    width: 3.2rem;
    height: 1.3rem;
  }
  .work-icon img, .work-icon svg,
  .work-icon.work-icon-wide img, .work-icon.work-icon-wide svg {
    max-width: 100%;
    max-height: 100%;
  }
  .work-entry:not(:last-child) .work-icon::after {
    height: 1.5rem;
  }
}

/*──────────────────────────────────────────────────────────────────────────────
  15. Stuff page styles
──────────────────────────────────────────────────────────────────────────────*/
.page-intro {
  text-align: left;
  font-size: 1.08rem;
  margin-bottom: 2rem;
  color: var(--text);
  margin-top: 5rem;
}

.stuff-grid {
  max-width: 800px;
  margin: 2rem auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.stuff-grid:first-of-type {
  margin-top: 1rem;
}

.stuff-item {
  flex: 1 1 200px;
  min-width: 180px;
}

.stuff-description {
  flex: 2 1 400px;
  min-width: 250px;
  font-size: 1.08rem;
  color: var(--text);
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
}

.stuff-link {
  font-size: 1.08rem;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.stuff-link:hover {
  color: var(--muted);
  text-decoration: underline;
}

/*──────────────────────────────────────────────────────────────────────────────
  16. Writing page styles
──────────────────────────────────────────────────────────────────────────────*/
.writing-list {
  max-width: 600px;
  margin: 3rem auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}

.writing-entry {
  text-align: center;
}

.writing-index {
  color: var(--muted);
  font-size: 1.2rem;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
  opacity: 0.7;
}

.writing-title {
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
  font-size: 1.08rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.writing-title:hover {
  color: var(--muted);
  text-decoration: underline;
}

.writing-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0.3rem 0 0.7rem 0;
  font-style: italic;
}

.writing-meta {
  color: var(--muted);
  font-size: 1.08rem;
  margin-top: 0.2rem;
  font-family: 'Baskerville', 'Baskerville Old Face', 'Hoefler Text', 'Times New Roman', serif;
}
