/* ============================================================
   1. CSS Custom Properties (Theme Tokens)
   ============================================================ */

:root,
html[data-theme="light"] {
  --color-bg:          #f8f8f6;
  --color-text:        #0d1526;
  --color-text-muted:  #4a5568;
  --color-accent:      #c85a00;
  --color-accent-hover:#a34800;
  --color-border:      #d4d4cc;
  --color-nav-bg:      #1a2744;
  --color-nav-text:    #f8f8f6;
}

html[data-theme="dark"] {
  --color-bg:          #0d1526;
  --color-text:        #e8e8e4;
  --color-text-muted:  #8a9ab5;
  --color-accent:      #e06b10;
  --color-accent-hover:#f07820;
  --color-border:      #2a3a5a;
  --color-nav-bg:      #1a2744;
  --color-nav-text:    #f8f8f6;
}

/* ============================================================
   2. Reset / Base
   ============================================================ */

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

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.6;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.2s, color 0.2s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ============================================================
   3. Navigation
   ============================================================ */

.site-nav {
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.5rem;
  flex-shrink: 0;
}

.site-nav__brand {
  font-weight: 600;
  color: var(--color-nav-text);
  text-decoration: none;
  margin-right: auto;
}

.site-nav__brand:hover {
  color: var(--color-nav-text);
  text-decoration: none;
}

.site-nav__links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav__links a {
  color: var(--color-nav-text);
  opacity: 0.75;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.15s;
}

.site-nav__links a:hover,
.site-nav__links a.active {
  opacity: 1;
  text-decoration: none;
  color: var(--color-nav-text);
}

.site-nav__links a.active {
  font-weight: 600;
}

/* ============================================================
   4. Dark Mode Toggle
   ============================================================ */

.theme-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  color: var(--color-nav-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* Show sun in dark mode (click to go light), moon in light mode (click to go dark) */
html[data-theme="dark"]  .theme-toggle .icon-moon,
html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-nav-text);
  padding: 0.25rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-toggle .icon-close {
  display: none;
}

.site-nav.is-open .nav-toggle .icon-menu {
  display: none;
}

.site-nav.is-open .nav-toggle .icon-close {
  display: block;
}

@media (max-width: 40rem) {
  .site-nav {
    padding: 0.875rem 1rem;
    gap: 0.5rem 0.75rem;
    flex-wrap: wrap;
    height: auto;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  .theme-toggle {
    display: none;
  }

  .site-nav__links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-bottom: 0.75rem;
  }

  .site-nav.is-open .site-nav__links {
    display: flex;
  }

  .site-nav__links a {
    font-size: 0.9rem;
    display: block;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .resume__download-btn--md {
    display: none;
  }

  .page table,
  .page table tr,
  .page table th,
  .page table td {
    display: block;
  }

  /* Header row has th cells — hide it entirely */
  .page table tr:first-child {
    display: none;
  }

  .page table tr {
    padding: 0.4rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: none;
  }

  .page table tr:last-child {
    border-bottom: 1px solid var(--color-border);
  }

  .page table td {
    padding: 0.1rem 0;
    border-bottom: none;
  }

  .page table td:nth-child(1) {
    font-weight: 600;
    font-size: 0.95rem;
  }

  .page table td:nth-child(2) {
    font-size: 0.85rem;
    color: var(--color-text-muted);
  }

  .page table td:nth-child(3) {
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }
}

/* ============================================================
   5. Cover Layout
   ============================================================ */

.cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 1.25rem;
}

.cover__avatar {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background-color: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--color-accent);
  margin-bottom: 0.5rem;
}

.cover__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover__avatar-placeholder {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-align: center;
  padding: 0.5rem;
}

.cover__name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cover__job-title {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.cover__job-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cover__tagline {
  font-size: 1rem;
  max-width: 36rem;
  line-height: 1.75;
  color: var(--color-text);
}

.cover__secondary {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.site-sep {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  margin: 0.5rem 0;
}

.site-sep__bullet {
  opacity: 0.45;
}

.cause-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.my-causes {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--color-text-muted);
  opacity: 0.7;
  max-width: 32rem;
  line-height: 1.5;
}

.my-causes a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   6. Page Layout (single-column prose)
   ============================================================ */

.page {
  flex: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

.page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.page h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.page p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.page th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--color-accent);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.5;
}

/* ============================================================
   7. Two-Column Layout
   ============================================================ */

.two-col {
  flex: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 3rem;
  align-items: start;
}

.two-col__main h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.two-col__main h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.two-col__main p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.two-col__sidebar {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  position: sticky;
  top: 1.5rem;
}

.two-col__sidebar h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

@media (max-width: 48rem) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .two-col__sidebar {
    position: static;
  }
}

/* ============================================================
   8. Grid Layout
   ============================================================ */

.grid-layout {
  flex: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

.grid-layout h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: border-color 0.15s;
}

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

.card__title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.card__body {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ============================================================
   9. Resume Layout
   ============================================================ */

.resume {
  flex: 1;
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

.resume__name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.resume__subtitle {
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.resume__contact {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.resume h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.25rem;
}

.resume h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.1rem;
}

.resume ul {
  padding-left: 1.25em;
  margin-bottom: 0.75rem;
}

.resume ul li {
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.resume p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.resume-entry {
  margin-bottom: 1.5rem;
}

.resume-entry__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

/* ============================================================
   10. Contact Form
   ============================================================ */

html[data-theme="light"] .contact-form--dark  { display: none; }
html[data-theme="dark"]  .contact-form--light { display: none; }

.contact-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-field input,
.form-field textarea {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s;
  width: 100%;
}

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

.form-field textarea {
  resize: vertical;
}

.form-submit {
  align-self: flex-start;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.form-submit:hover {
  background: var(--color-accent-hover);
}

/* ============================================================
   11. Footer
   ============================================================ */

.site-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.site-footer__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.social-link {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.social-link:hover {
  color: var(--color-text);
}

.resume__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.resume__downloads {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.resume__downloads-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-right: 0.25rem;
}

.resume__download-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--color-accent);
  border-radius: 3px;
  color: var(--color-accent);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.resume__download-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
}

/* ============================================================
   11. Print Styles
   ============================================================ */

@media print {
  .site-nav,
  .site-footer,
  .theme-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  .resume {
    max-width: none;
    padding: 0;
  }

  a {
    color: black;
    text-decoration: none;
  }

  .resume h2 {
    color: black;
  }
}
