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

/* ─── TOKENS ─── */
:root {
  --bg:      #f4efe6;
  --ink:     #1c1410;
  --accent:  #bf4528;
  --green:   #2e6b54;
  --mid:     #7a6a58;
  --faint:   #d6cabb;
  --card:    #ece6da;
  --nav-w:   220px;
}

body.dark {
  --bg:    #110e09;
  --ink:   #ede5d8;
  --accent:#d95533;
  --green: #4aaa84;
  --mid:   #8a7a68;
  --faint: #2a2218;
  --card:  #1a160f;
}

/* ─── BASE ─── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ─── LAYOUT SHELL ─── */
.site {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR NAV ─── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2rem;
  border-right: 1.5px solid var(--faint);
  background: var(--bg);
  z-index: 200;
  transition: background 0.3s, transform 0.3s;
}

.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.nav-logo em { color: var(--accent); font-style: normal; }

.nav-tagline {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 3rem;
  line-height: 1.4;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.nav-links a {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mid);
  padding: 0.5rem 0;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }
.nav-links a.active { font-weight: 400; }

.nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.mode-btn {
  background: none;
  border: 1px solid var(--faint);
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  width: fit-content;
  transition: border-color 0.2s, color 0.2s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── HAMBURGER (hidden on desktop) ─── */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 300;
  background: var(--bg);
  border: 1.5px solid var(--faint);
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  transition: background 0.3s, border-color 0.2s;
}
.hamburger:hover { border-color: var(--accent); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: background 0.3s, transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dim overlay behind the drawer */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.nav-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ─── MAIN CONTENT ─── */
.site-content {
  grid-column: 2;
  min-width: 0; /* prevents grid blowout */
  width: 100%;
}

/* ─── PAGE HEADER ─── */
.page-header {
  padding: 4rem 4rem 3rem;
  border-bottom: 1.5px solid var(--faint);
}

.page-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, calc((100vw - var(--nav-w)) * 0.07), 4.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.page-header h1 em { font-style: italic; color: var(--accent); }

.page-header p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--mid);
  max-width: 560px;
  line-height: 1.8;
}

/* ─── SECTION LABEL ─── */
.section-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--faint);
}

/* ─── HOME PAGE ─── */
.home-hero {
  padding: 5rem 4rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(3.5rem, calc((100vw - var(--nav-w)) * 0.13), 9rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.home-hero h1 em {
  font-style: italic;
  color: var(--accent);
  display: block;
}

.home-hero h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1rem, calc((100vw - var(--nav-w)) * 0.025), 1.4rem);
  font-weight: 300;
  font-style: italic;
  color: var(--mid);
  margin-bottom: 2.5rem;
}

.home-intro {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--mid);
  max-width: 520px;
}

.home-intro p { margin-bottom: 0.5rem; }

.home-contact {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.home-contact a {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s;
  width: fit-content;
  border-bottom: 1px solid var(--green);
  padding-bottom: 1px;
}
.home-contact a:hover { color: var(--accent); border-color: var(--accent); }

/* ─── ABOUT PAGE ─── */
.about-body {
  padding: 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.about-text {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--mid);
}

.stack-box {
  background: var(--card);
  border: 1.5px solid var(--faint);
  padding: 1.75rem;
}

.stack-box h3 {
  font-family: 'Fraunces', serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--faint);
  color: var(--mid);
  border-radius: 100px;
  background: var(--bg);
  transition: border-color 0.2s, color 0.2s;
  cursor: default;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ─── WORK PAGE ─── */
.work-body {
  padding: 4rem;
}

.job {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px dashed var(--faint);
}

.job:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.job-date {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.job-company {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.job-location {
  font-size: 0.68rem;
  color: var(--mid);
  margin-top: 0.3rem;
}

.job-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.3rem, calc((100vw - var(--nav-w)) * 0.032), 2rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--ink);
}

.job-title em { font-style: italic; color: var(--green); }

.job-bullets {
  list-style: none;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--mid);
}

.job-bullets li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.job-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.68rem;
  top: 0.18em;
}

/* ─── EDUCATION PAGE ─── */
.edu-body {
  padding: 4rem;
}

.edu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.edu-card {
  background: var(--card);
  border: 1.5px solid var(--faint);
  padding: 1.75rem;
}

.edu-degree {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.edu-school {
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 0.2rem;
}

.edu-year {
  font-size: 0.68rem;
  color: var(--mid);
  margin-bottom: 1rem;
}

.edu-gpa {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  display: inline-block;
  background: var(--green);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

/* ─── HONORS ─── */
.honors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.honors-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--mid);
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1.5px solid var(--faint);
}

.honors-list li::before {
  content: '★';
  color: var(--accent);
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.honors-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  transition: color 0.2s, border-color 0.2s;
}
.honors-link:hover { color: var(--accent); border-color: var(--accent); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-hero h1  { animation: fadeUp 0.65s ease both; }
.home-hero h2  { animation: fadeUp 0.65s 0.12s ease both; }
.home-intro    { animation: fadeUp 0.65s 0.22s ease both; }
.home-contact  { animation: fadeUp 0.65s 0.32s ease both; }

/* ═══════════════════════════════════════════
   RESPONSIVE — sidebar becomes a slide-in drawer
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Content takes full width — nav is a drawer, not in the grid */
  .site {
    grid-template-columns: 1fr;
  }

  .site-nav {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0,0,0,0.1);
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .site-content {
    grid-column: 1;
  }

  .hamburger {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  /* Font sizes now scale to full vw since sidebar is out of flow */
  .home-hero h1   { font-size: clamp(3.5rem, 13vw, 8rem); }
  .home-hero h2   { font-size: clamp(1rem, 2.5vw, 1.4rem); }
  .page-header h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); }
  .job-title      { font-size: clamp(1.3rem, 3.5vw, 2rem); }

  .page-header  { padding: 3rem 2.5rem 2.5rem; }
  .home-hero    { padding: 5rem 2.5rem 3rem; min-height: 90vh; }
  .about-body,
  .work-body,
  .edu-body     { padding: 3rem 2.5rem; }
}

@media (max-width: 640px) {
  .home-hero h1   { font-size: clamp(3rem, 16vw, 5rem); }
  .home-hero h2   { font-size: 1rem; }
  .page-header h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .job-title      { font-size: 1.35rem; }

  .page-header  { padding: 2rem 1.25rem; }
  .home-hero    { padding: 4rem 1.25rem 2.5rem; min-height: 80vh; }
  .about-body,
  .work-body,
  .edu-body     { padding: 2rem 1.25rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .job        { grid-template-columns: 1fr; gap: 0.75rem; }
  .edu-cards  { grid-template-columns: 1fr; }

  .job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    align-items: baseline;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--faint);
    margin-bottom: 0.75rem;
  }
}
