/* ===== Base & Wrapper =============================================== */
:root {
  /* THE 3-COLOR PALETTE */
  --teal:       #83C5C9;
  --text-main:  #2D3436;
  --text-body:  #636E72;
  
  --bg-hero:    #f0f0f0;
  --bg-page:    #ffffff;
  
  /* Layout Vars */
  --tab-width: 120px;
  --nav-height: 90px;
}

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

body {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  color: var(--text-body);
  line-height: 1.7;
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased; 
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 6rem 2rem; }

/* ===== NAVIGATION BAR ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--bg-hero); /* Matches Intro BG */
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.nav-wrap {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* LOGO */
.logo-container {
  display: block;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--teal);
  transition: transform 0.2s;
}
.logo-container:hover { transform: scale(1.1); }
.logo-img { width: 100%; height: 100%; object-fit: cover; }

/* DESKTOP NAV */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}
@media (max-width: 768px) {
  .nav-desktop { display: none; }
}

.nav-desktop ol {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s;
}
.nav-desktop a:hover { color: var(--teal); }

.nav-desktop .mono-num {
  color: var(--teal);
  margin-right: 5px;
}

/* Resume Button */
.resume-btn {
  font-family: 'JetBrains Mono', monospace;
  color: var(--teal) !important;
  border: 1px solid var(--teal);
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.resume-btn:hover {
  background: rgba(131, 197, 201, 0.1);
}

/* HAMBURGER ICON */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  cursor: pointer;
  z-index: 2000;
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
}

.hamburger .line {
  width: 100%;
  height: 2px;
  background-color: var(--teal);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* MOBILE MENU OVERLAY */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
.mobile-menu-overlay.active { transform: translateX(0); }

/* CLOSE BUTTON (X) */
.menu-close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--teal);
  cursor: pointer;
  transition: transform 0.2s;
}
.menu-close-btn:hover { transform: rotate(90deg); }

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  text-align: center;
}

.mobile-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
}
.mobile-link .mono-num {
  color: var(--teal);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: block;
}
.mobile-link .link-text {
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 700;
}
.mobile-resume { margin-top: 1rem; font-size: 1.1rem; padding: 1rem 2rem;}


/* ===== Typography ==================== */
h1, h2 {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-weight: 700; 
  letter-spacing: -0.02em; 
  color: var(--text-main);
}

.numbered-title {
  display: flex;
  align-items: center;
  color: var(--text-main);
  font-size: 2rem;
  margin-bottom: 2.5rem;
  white-space: nowrap;
}
.numbered-title::after {
  content: "";
  display: block;
  position: relative;
  width: 200px;
  height: 1px;
  background-color: #e0e0e0;
  margin-left: 20px;
}
@media (max-width: 600px) {
  .numbered-title::after { width: 100%; }
}

.mono-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  color: var(--teal);
  font-size: 1.5rem;
  margin-right: 10px;
}

.mono-heading {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  color: var(--teal);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

h3, h4 {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-main);
}

/* ===== Hero Section ================================================= */
.hero { 
  position: relative; 
  background: var(--bg-hero);
  overflow: hidden;
  min-height: 100vh; 
  z-index: 1;
}

#particles-js { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; }
#particles-js canvas { display: block; }

.hero .wrap { 
  /* Left Alignment and Center Vertical Positioning */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-top: 0; 
  padding-bottom: 0;
  position: relative; 
  z-index: 10; 
  pointer-events: none; 
}
.hero-wrap a, .hero-wrap button, .hero-wrap input { pointer-events: auto; }

/* Grid adjusted to push content LEFT */
.hero-wrap {
  display: grid; 
  grid-template-columns: 1fr; /* Takes full width available */
  gap: 2rem; 
  align-content: center;
}

.hero-brain { justify-self: end; order: 0; }
.hero-copy { order: 1; }

@media (min-width: 980px) {
  .hero-copy { grid-column: 1; grid-row: 1; max-width: 640px; }
  .hero-copy > * { max-width: 640px; }
  .hero-wrap { grid-template-columns: 58% 42%; align-items: center; }
  .hero-brain { grid-column: 2; grid-row: 1; }
  .hero-copy { grid-column: 1; grid-row: 1; }
}

/* Hero Typography */
.intro-label {
  font-size: 1.5rem; 
  margin-bottom: 1.2rem;
  color: var(--teal);
}

.main-name {
  line-height: 1.1;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}
@media (max-width: 600px) {
  .main-name { font-size: 2.5rem; }
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-body);
  margin-bottom: 2rem;
  font-weight: 400;
  max-width: 520px;
}

.hero-desc a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease;
}
.hero-desc a:hover { opacity: 0.8; border-bottom: 1px solid var(--teal); }

.hero-links a {
  font-family: inherit; display: inline-block; margin-right: 1.1rem;
  font-weight: 600; text-decoration: none; color: var(--teal); font-size: 1.02rem;
}
.hero-links a:hover { text-decoration: underline; }

/* ===== Layout Utilities ========================== */
.grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.col-text { max-width: 100%; }
.col-aside { display: flex; justify-content: center; position: relative; }

@media (min-width: 980px) {
  .grid { grid-template-columns: 2.5fr 1fr; align-items: flex-start; gap: 2rem; }
  .col-aside { justify-content: center; }
}

/* ===== Section Typography ========================================== */
section { padding: 0; }
section .wrap { padding-top: 6rem; padding-bottom: 6rem; }

section h2 { color: var(--text-main); margin-bottom: 2rem; font-size: 2.1rem; }
@media (min-width: 980px) { section h2 { font-size: 2.8rem; } }
section h3 { color: var(--text-main); font-size: 1.25rem; margin-bottom: 1rem; font-weight: 700; }
section p { color: var(--text-body); line-height: 1.8; margin-bottom: 1.5rem; font-size: 1.05rem; font-weight: 400; }

.col-text a {
  font-family: inherit; color: var(--teal); text-decoration: none; font-weight: 600;
  transition: opacity 0.2s ease; border-bottom: 1px solid transparent; 
}
.col-text a:hover { opacity: 0.8; border-bottom: 1px solid var(--teal); }

/* ===== Timeline & Photos (Adjusted for alignment) ======================== */
.timeline { position: relative; z-index: 0; width: 100%; }
.photo {
  width: 200px; height: 200px; border-radius: 50%;
  border: 5px solid var(--teal); overflow: hidden; background: #fff;
  flex-shrink: 0; position: relative; z-index: 1;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

@media (min-width: 980px) {
  .timeline { display: flex; flex-direction: column; align-items: center; gap: 2.6rem; 
    /* Changed margin-top to 0 to align with top of text */
    margin-top: 0; 
  }
  .timeline .photo:not(:last-child)::before {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + 5px); width: 3px; height: calc(2.6rem - 10px);
    background: var(--teal); z-index: 0;
  }
}
@media (max-width: 979px) and (min-width: 600px) {
  .timeline { display: flex; flex-direction: row; justify-content: center; gap: 1rem; margin-top: 0; }
  .photo { width: 160px; height: 160px; }
  .photo::before { display: none !important; } 
}
@media (max-width: 599px) {
  .timeline { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); justify-items: center; gap: 1rem; margin-top: 0; }
  .photo { width: 150px; height: 150px; }
  .photo::before { display: none !important; }
}

/* ===== ACADEMIC EMPLOYMENT (Tabs) ===================== */
.jobs-container { display: flex; min-height: 300px; }
@media (max-width: 700px) { .jobs-container { flex-direction: column; } }

.jobs-tabs {
  position: relative; z-index: 3; width: max-content; padding: 0; margin: 0; list-style: none;
}
@media (max-width: 700px) {
  .jobs-tabs { display: flex; overflow-x: auto; width: 100%; margin-bottom: 2rem; border-bottom: 1px solid #e0e0e0; }
}

.job-tab {
  display: flex; align-items: center; width: 100%; height: 42px; padding: 0 20px 2px;
  background-color: transparent; border: 0; border-left: 2px solid #e0e0e0;
  text-align: left; white-space: nowrap; font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem; color: var(--text-body); cursor: pointer;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}
@media (max-width: 700px) {
  .job-tab { border-left: 0; border-bottom: 2px solid #e0e0e0; justify-content: center; min-width: 120px; }
}

.job-tab:hover, .job-tab:focus { background-color: #f7fcfc; color: var(--teal); }
.job-tab.active { color: var(--teal); background-color: #effcfc; }

.job-highlight {
  position: absolute; top: 0; left: 0; z-index: 10; width: 2px; height: 42px;
  background: var(--teal); transition: transform 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}
@media (max-width: 700px) {
  .job-highlight { display: none; }
  .job-tab.active { border-bottom: 2px solid var(--teal); }
}

.jobs-content { position: relative; width: 100%; margin-left: 2rem; }
@media (max-width: 700px) { .jobs-content { margin-left: 0; } }

.job-panel { display: none; animation: fadeIn 0.4s ease-in-out; }
.job-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.job-panel h3 { margin-top: 0; margin-bottom: 5px; font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.job-panel a { color: var(--teal); text-decoration: none; }
.job-panel a:hover { text-decoration: underline; }
.job-range { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-body); margin-bottom: 1.5rem; }

.job-list { list-style: none; padding: 0; margin: 0; }
.job-list li { position: relative; padding-left: 20px; margin-bottom: 12px; font-size: 1rem; color: var(--text-body); }
.job-list li::before { content: "▹"; position: absolute; left: 0; color: var(--teal); font-size: 1.2rem; line-height: 1.2rem; }

/* ===== Footer ======================================================= */
footer { background: #fff; border-top: 1px solid #e0e0e0; }
.footer-inner { text-align: center; padding: 3rem 2rem; }
.footer-links { margin-bottom: 1rem; }
.footer-links a {
  font-family: inherit; margin: 0 .8rem; text-decoration: none;
  color: var(--teal); font-weight: 600; font-size: 1rem;
}
.footer-links a:hover { text-decoration: underline; }
footer p { font-size: .86rem; color: #888; }

/* ===== Fade-in Animation ============================================ */
.fade { opacity: 0; transform: translateY(40px); transition: opacity .9s ease-out, transform .9s ease-out; }
.fade.show { opacity: 1; transform: translateY(0); }

/* ===== PROJECTS: BENTO GRID ================ */
.bento-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }

@media (min-width: 768px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .bento-card.featured { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
}

.bento-card {
  background: #ffffff; border-radius: 24px; overflow: hidden;
  text-decoration: none; color: inherit; border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  display: flex; flex-direction: column;
}
.bento-card:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 20px 40px rgba(131, 197, 201, 0.15);
  border-color: rgba(131, 197, 201, 0.4);
}
.bento-content { padding: 2.2rem; display: flex; flex-direction: column; justify-content: center; }
.bento-card h3 {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-weight: 700; font-size: 1.5rem; margin-bottom: 0.6rem; color: var(--text-main); letter-spacing: -0.02em;
}
.bento-card p {
  font-family: inherit; font-size: 0.95rem; font-weight: 500; color: var(--text-body); line-height: 1.6; margin-bottom: 0;
}
.bento-tags { margin-bottom: 1rem; display: flex; gap: 0.6rem; }
.bento-tags span {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 700;
  color: var(--teal); background: rgba(131, 197, 201, 0.1); padding: 4px 8px; border-radius: 6px; text-transform: uppercase;
}
.bento-visual { width: 100%; height: 250px; overflow: hidden; background: #f8f8f8; position: relative; }
@media (min-width: 768px) {
  .bento-card.featured .bento-visual { height: 100%; order: 2; min-height: 320px; }
}
.bento-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.bento-card:hover .bento-visual img { transform: scale(1.05); }
