/* ─── CSS Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Color variables ─── */
:root {
  --bg: #f5f3f0;
  --bg-dark: #eceae6;
  --bg-darker: #e4e1dc;
  --text: #2a2520;
  --text-mid: #5c5650;
  --text-dim: #7a7470;
  --gold: #b8842e;
  --gold-soft: rgba(184, 132, 46, 0.08);
  --gold-line: rgba(184, 132, 46, 0.3);
  --violet: #8b5ea0;
  --violet-soft: rgba(139, 94, 160, 0.08);
  --violet-line: rgba(139, 94, 160, 0.35);
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'Space Mono', 'Courier New', monospace;
}

/* ─── Base elements ─── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16.5px;
  -webkit-font-smoothing: auto;
  animation: fadeIn 0.5s ease-out;
}

a { color: inherit; }

::selection {
  background: var(--gold-soft);
  color: var(--text);
}

/* ─── Focus states ─── */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Skip to content ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  border-radius: 0 0 6px 6px;
  z-index: 200;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ─── Page-load fade-in animation ─── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtle-glitch {
  0%, 92%, 100% { text-shadow: none; }
  93% { text-shadow: 2.5px 0 rgba(184,132,46,0.35), -2.5px 0 rgba(139,94,160,0.35); }
  93.5% { text-shadow: -1.5px 0 rgba(184,132,46,0.2), 1.5px 0 rgba(139,94,160,0.2); }
  94% { text-shadow: none; }
}

@keyframes entrance-flash {
  0% { text-shadow: 2px 0 rgba(184,132,46,0.3), -2px 0 rgba(139,94,160,0.3); }
  100% { text-shadow: none; }
}

@keyframes data-flicker {
  0%, 88%, 92%, 100% { opacity: 0; }
  89% { opacity: 1; }
  91% { opacity: 0.5; }
}

/* ─── Navbar ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 243, 240, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.1);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-name a {
  font-family: var(--mono);
  font-size: 1.21rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.navbar-name a:hover { color: var(--gold); }

.navbar-links {
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
}

.navbar-links a {
  display: block;
  font-family: var(--mono);
  font-size: 1.21rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.3s;
}

.navbar-links a:hover {
  color: var(--text);
  text-shadow: 1.5px 0 rgba(184,132,46,0.4), -1.5px 0 rgba(139,94,160,0.4);
}

.navbar-links a.active {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
  font-weight: 400;
}

/* ─── Mobile hamburger ─── */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.navbar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Layout containers ─── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.container--wide {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ─── Section styles ─── */
.section-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 1rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.page-header {
  padding-top: 80px;
  padding-bottom: 2.5rem;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.page-header .lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-mid);
  max-width: 640px;
}

.page-header .lead a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
}

.page-header .lead a:hover { text-decoration-color: var(--gold); }

/* ─── About page — split layout ─── */
.main { padding: 0 2.5rem; }

.about-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1060px;
  margin: 0 auto;
}

/* Left column — essay */
.about-left { display: flex; flex-direction: column; gap: 2rem; }
.about-left-label, .about-right-label, .cred-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.about-headshot {
  width: 200px; height: 200px; border-radius: 4px;
  object-fit: cover; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  filter: grayscale(0.5) brightness(1.02) sepia(0.1); opacity: 0.7;
  transition: filter 0.3s, opacity 0.3s;
}
.about-essay { font-family: var(--serif); font-size: 1rem; line-height: 1.7; color: var(--text); }
.about-essay p { margin-bottom: 1.5rem; }
.about-essay p:last-child { margin-bottom: 0; }
.accent { color: var(--gold); font-weight: 400; }
.pull-quote {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 300;
  font-style: italic;
  color: rgba(42, 37, 32, 0.6);
  border-left: 3px solid rgba(184, 132, 46, 0.4);
  padding-left: 1.5rem; margin: 2rem 0;
}

/* Right column — credentials (sticky) */
.about-right {
  position: sticky; top: 80px; align-self: start;
  display: flex; flex-direction: column; gap: 2.5rem;
}

/* Timeline */
.career-list {
  position: relative;
  display: flex; flex-direction: column; gap: 1.75rem;
}
.career-list::before {
  content: ''; position: absolute;
  left: 3px; top: 0; bottom: 0; width: 2px;
  background-color: rgba(184, 132, 46, 0.15);
}
.career-item {
  position: relative; padding-left: 24px;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.career-item::before {
  content: ''; position: absolute;
  left: 0; top: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--bg);
  border: 2px solid rgba(184, 132, 46, 0.35);
}
.career-item.visible { opacity: 1; transform: translateY(0); animation: entrance-flash 0.15s ease-out; }
.career-item:nth-child(1) { transition-delay: 0ms; }
.career-item:nth-child(2) { transition-delay: 80ms; }
.career-item:nth-child(3) { transition-delay: 160ms; }
.career-item:nth-child(4) { transition-delay: 240ms; }
.career-item:nth-child(5) { transition-delay: 320ms; }
.career-item:nth-child(6) { transition-delay: 400ms; }
.career-item-org {
  font-family: var(--serif); font-size: 1rem; font-weight: 400;
  color: var(--text); margin-bottom: 0.25rem;
}
.career-item-org a {
  color: inherit; text-decoration: underline;
  text-decoration-color: var(--gold-line); text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.career-item-org a:hover { text-decoration-color: var(--gold); }
.career-item-role { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.career-item-desc { font-family: var(--mono); font-size: 0.75rem; line-height: 1.5; color: var(--text-mid); }
.career-item-desc a { color: inherit; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.career-item-desc a:hover { text-decoration-color: var(--gold); }

/* Education & affiliations */
.cred-section { display: flex; flex-direction: column; gap: 0.75rem; }
.cred-content { font-size: 0.9375rem; line-height: 1.5; color: var(--text); }

/* Logo band (About page) */
.logo-band { margin: 4rem auto 0; overflow: hidden; max-width: 1060px; }
.logo-band-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 2rem; justify-content: flex-start;
}
.logo-img { height: 36px; object-fit: contain; opacity: 0.65; transition: opacity 0.2s ease, filter 0.3s; }
.logo-img:hover { opacity: 0.9; filter: brightness(0) url(#chromatic-glitch); }
.logo-img--tall { height: 28px; }
.logo-img--prepped { filter: brightness(0) saturate(100%); opacity: 0.5; }
.logo-img--prepped:hover { opacity: 0.9; filter: brightness(0) url(#chromatic-glitch); }
.logo-img--dark { filter: grayscale(1) brightness(0); opacity: 0.5; }
.logo-img--dark:hover { opacity: 0.9; filter: brightness(0) url(#chromatic-glitch); }

/* About CTA */
.about-cta {
  max-width: 1060px; margin: 4rem auto 0; padding: 2.5rem;
  background-color: var(--bg-darker); border-radius: 8px;
  display: flex; flex-direction: column; gap: 1rem;
}
.about-cta h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 300; color: var(--text); margin: 0; }
.about-cta p { font-size: 0.9375rem; line-height: 1.6; color: var(--text-mid); margin: 0; }
.about-cta a { color: var(--violet); text-decoration: underline; font-weight: 400; transition: opacity 0.2s ease; }
.about-cta a:hover { opacity: 0.8; }

/* ─── Footer ─── */
footer {
  padding: 2.5rem 2.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner span { opacity: 0.5; font-size: 0.5rem; }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 0.8; }

/* ─── Photo treatment ─── */
.photo-matte { filter: grayscale(0.5) brightness(1.02) sepia(0.1); opacity: 0.7; }

/* ─── Chromatic hover utility ─── */
.link-chromatic { transition: text-shadow 0.3s; }
.link-chromatic:hover { text-shadow: 1.5px 0 rgba(184,132,46,0.4), -1.5px 0 rgba(139,94,160,0.4); }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .hero-name { animation: none; }
  .career-item { opacity: 1; transform: none; transition: none; }
  .career-item.visible { animation: none; }
  .home-right::before { animation: none; }
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .container, .container--wide { padding: 0 1.5rem; }

  .navbar-inner { padding: 0 1.25rem; }

  .navbar-links { display: none; }

  .navbar-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 61px;
    left: 0;
    right: 0;
    background: rgba(245, 243, 240, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.25rem;
    gap: 6px;
  }

  .navbar-links.open a {
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    font-family: var(--mono);
  }

  .navbar-links.open a:last-child { border-bottom: none; }

  .navbar-links.open a.active {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--gold-line);
    text-underline-offset: 3px;
    background: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
  }

  .navbar-toggle { display: flex; }

  .page-header { padding-top: 60px; }

  .page-header h1 { font-size: 1.9rem; }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  /* About page responsive */
  .main { padding: 0 1.5rem; }
  .about-split { grid-template-columns: 1fr; gap: 3rem; }
  .about-right { position: static; top: auto; }
  .about-headshot { width: 150px; height: 150px; }
  .pull-quote { font-size: 1.1rem; }
  .about-cta { margin-left: 0; margin-right: 0; }
  .logo-band-inner { gap: 1.5rem; }
  .logo-img { height: 32px; }
  .logo-img--tall { height: 24px; }
}
