/* ── RESET & TOKENS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:      #FFFFFF;
  --light-bg:   #F8F8F8;
  --lighter-bg: #F2F2F2;
  --dark:       #0A0A0A;
  --gray:       #4A4A4A;
  --light-gray: #8A8A8A;
  --border:     #E0E0E0;
  --accent:     #5B7C99;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.09);
  --nav-height: 70px;
  --font:       'Inter', sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

body.dark {
  --white:      #0A0A0A;
  --light-bg:   #141414;
  --lighter-bg: #1E1E1E;
  --dark:       #F0F0F0;
  --gray:       #A0A0A0;
  --light-gray: #606060;
  --border:     #2A2A2A;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--dark);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 0 20px;
  transition: background .3s, border-color .3s;
}
.nav-link {
  padding: 8px 14px;
  color: var(--gray);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-radius: 6px;
  transition: all .2s;
}
.nav-link:hover { color: var(--dark); background: rgba(201,158,54,0.08); }
.nav-link.active { color: var(--dark); background: rgba(201,158,54,0.10); border-bottom: 2px solid #C99E36; box-shadow: 0 2px 12px rgba(201,158,54,0.18); }
.theme-btn {
  margin-left: 10px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background .2s;
}
.theme-btn:hover { background: var(--lighter-bg); }

/* ── SECTION SNAP ── */
.snap-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.snap-page::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 48px; height: 1px;
  background: var(--border);
}
.snap-page:last-of-type::after { display: none; }

/* ── HERO ── */
.hero-container {
  max-width: 920px; width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 260px 1fr 56px;
  gap: 48px;
  align-items: start;
}
.hero-left { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.profile-wrap {
  width: 240px; height: 300px;
  border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .3s, box-shadow .3s;
}
.profile-wrap:hover { transform: scale(1.02); box-shadow: 0 8px 28px rgba(0,0,0,0.14); }
.profile-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.open-badge { font-size: 11px; color: var(--light-gray); text-align: center; }

.hero-center h1 {
  font-size: 36px; font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  line-height: 1.15; letter-spacing: -0.02em;
}
.hero-bio { font-size: 14px; line-height: 1.75; color: var(--gray); margin-bottom: 22px; max-width: 520px; }
.hero-bio strong { color: var(--dark); font-weight: 600; }
.info-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.info-card {
  display: flex; gap: 16px;
  padding: 12px 16px;
  background: var(--light-bg);
  border-radius: 6px;
  border-left: 3px solid var(--dark);
  transition: background .3s;
}
.info-lbl { font-size: 12px; font-weight: 600; color: var(--light-gray); min-width: 80px; padding-top: 1px; }
.info-val { font-size: 13px; font-weight: 500; color: var(--dark); }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  padding: 11px 22px;
  background: var(--dark); color: var(--white);
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: all .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary {
  padding: 11px 22px;
  background: var(--white); color: var(--dark);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--light-bg); }

.hero-right { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.icon-link {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dark);
  text-decoration: none;
  transition: all .2s;
  cursor: pointer; position: relative;
}
.icon-link:hover { background: var(--dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
body.dark .icon-link:hover { background: #e0e0e0; color: #0a0a0a; }
.icon-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.loc-tip {
  position: absolute; left: -122px; top: 50%; transform: translateY(-50%);
  background: var(--dark); color: var(--white);
  padding: 5px 10px; border-radius: 5px;
  font-size: 11px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
body.dark .loc-tip { background: #e0e0e0; color: #0a0a0a; }
.icon-link:hover .loc-tip { opacity: 1; }

/* ── SHARED SECTION WRAPPER ── */
.section {
  padding: 64px 24px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.sec-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.sec-label {
  font-size: 11px; font-family: var(--mono); font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--light-gray);
}
.sec-link {
  font-size: 12px; color: var(--light-gray); text-decoration: none;
  border-bottom: 1px solid var(--border); padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.sec-link:hover { color: var(--dark); border-color: var(--dark); }

/* ── PROJECTS GRID ── */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.proj-card {
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all .25s var(--ease);
  text-decoration: none;
  display: flex; flex-direction: column;
  color: inherit;
  min-height: 220px;         /* uniform height */
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #C8C8C8; }
body.dark .proj-card:hover { border-color: #3a3a3a; }

.proj-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.proj-title { font-size: 13.5px; font-weight: 600; color: var(--dark); line-height: 1.35; flex: 1; }

.pbadge { font-size: 10px; font-family: var(--mono); padding: 3px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
/* single consistent badge style — warm amber across all states */
.b-done    { background: #FBF7EE; color: #92600A; border: 1px solid #E8D5A3; }
.b-ongoing { background: #FBF7EE; color: #92600A; border: 1px solid #E8D5A3; }
.b-award   { background: #FBF7EE; color: #92600A; border: 1px solid #E8D5A3; }
body.dark .b-done    { background: #251e0a; color: #D4A642; border-color: #4a3610; }
body.dark .b-ongoing { background: #251e0a; color: #D4A642; border-color: #4a3610; }
body.dark .b-award   { background: #251e0a; color: #D4A642; border-color: #4a3610; }

.proj-desc { font-size: 12.5px; color: var(--gray); line-height: 1.65; margin-bottom: 14px; flex: 1; }

/* footer always pinned to bottom of card */
.proj-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ptag {
  font-size: 11px; font-family: var(--mono);
  padding: 3px 8px; border-radius: 4px;
  background: var(--white); color: var(--light-gray);
  border: 1px solid var(--border);
}
body.dark .ptag { background: var(--lighter-bg); }
.proj-link {
  font-size: 12px; color: var(--accent);
  text-decoration: none; font-family: var(--mono);
  white-space: nowrap; flex-shrink: 0;
  transition: opacity .2s;
}
.proj-link:hover { opacity: .7; }

/* ── TIMELINE ── */
.tl { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 2px 1fr; gap: 0 28px; position: relative; }
.tl-line { background: var(--border); }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dark);
  border: 2px solid var(--white);
  position: absolute; top: 4px; left: -4px;
}
body.dark .tl-dot { border-color: #0a0a0a; }
.tl-dot.vol { background: var(--light-gray); }
.tl-body { padding: 0 0 38px; }
.tl-item:last-child .tl-body { padding-bottom: 0; }
.tl-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 3px; }
.tl-org { font-size: 15px; font-weight: 600; color: var(--dark); }
.tl-date { font-size: 11.5px; font-family: var(--mono); color: var(--light-gray); white-space: nowrap; flex-shrink: 0; padding-top: 3px; }
.tl-role { font-size: 12.5px; font-family: var(--mono); color: var(--accent); margin-bottom: 9px; }
.tl-role.muted { color: var(--light-gray); }
.tl-sum { font-size: 13px; color: var(--gray); line-height: 1.65; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.ttag { font-size: 10.5px; font-family: var(--mono); padding: 2px 7px; border-radius: 4px; background: var(--white); color: var(--light-gray); border: 1px solid var(--border); }
body.dark .ttag { background: var(--lighter-bg); }

.tl-bullets { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tl-bullets li { font-size: 13px; color: var(--gray); line-height: 1.65; padding-left: 16px; position: relative; }
.tl-bullets li::before { content: '—'; position: absolute; left: 0; color: var(--border); font-size: 11px; top: 2px; }
.tl-bullets li strong { color: var(--dark); font-weight: 600; }
.tl-note { font-size: 13px; color: var(--gray); line-height: 1.65; }
.tl-link { font-size: 12.5px; color: var(--accent); text-decoration: none; margin-top: 8px; display: inline-block; transition: opacity .2s; }
.tl-link:hover { opacity: .7; }

/* ── EDUCATION TIMELINE ── */
.tl-deg   { font-size: 12px; font-family: var(--mono); color: var(--accent); margin-bottom: 2px; }
.tl-school{ font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.tl-meta  { font-size: 12px; color: var(--light-gray); margin-bottom: 10px; }
.tl-pts   { display: flex; flex-direction: column; gap: 5px; }
.tl-pt    { font-size: 13px; color: var(--gray); line-height: 1.55; padding-left: 13px; position: relative; }
.tl-pt::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; font-size: 15px; line-height: 1.3; }

/* ── SKILLS ── */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-group { background: var(--light-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.sg-name { font-size: 11px; font-family: var(--mono); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--light-gray); margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 11.5px; font-family: var(--mono); padding: 4px 9px; border-radius: 5px; background: var(--white); color: var(--gray); border: 1px solid var(--border); transition: border-color .2s; }
body.dark .pill { background: var(--lighter-bg); }
.pill.hl { background: #FBF7EE; color: #92600A; border-color: #E8D5A3; }
body.dark .pill.hl { background: #251e0a; color: #D4A642; border-color: #4a3610; }

/* ── GW FEATURE ── */
.feature-wrap { background: var(--light-bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-inner {
  max-width: 920px; margin: 0 auto; padding: 36px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.feature-eyebrow { font-size: 11px; font-family: var(--mono); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: #92600A; margin-bottom: 6px; }
.feature-title { font-size: 18px; font-weight: 600; color: var(--dark); line-height: 1.4; max-width: 560px; }
.feature-sub { font-size: 13px; color: var(--light-gray); }
.feature-link { font-size: 13px; font-weight: 600; color: var(--dark); text-decoration: none; margin-top: 10px; display: inline-block; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: border-color .2s; }
.feature-link:hover { border-color: var(--dark); }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; max-width: 920px; margin: 0 auto; }
.footer-name { font-size: 13px; font-family: var(--mono); color: var(--light-gray); }
.footer-loc  { font-size: 12px; color: var(--light-gray); }

/* ── ANIMATIONS ── */

/* Hero enter */
.hero-enter { opacity: 0; transform: translateY(28px); }
.hero-enter.loaded { animation: heroIn .75s var(--ease) forwards; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero-enter:nth-child(1) { animation-delay: 0s; }
.hero-enter:nth-child(2) { animation-delay: .1s; }
.hero-enter:nth-child(3) { animation-delay: .2s; }

/* Scroll fade-in */
.fade { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.fade.in { opacity: 1; transform: translateY(0); }

/* Staggered child reveal */
.stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.stagger.in > *:nth-child(1) { transition-delay: .05s; }
.stagger.in > *:nth-child(2) { transition-delay: .12s; }
.stagger.in > *:nth-child(3) { transition-delay: .19s; }
.stagger.in > *:nth-child(4) { transition-delay: .26s; }
.stagger.in > *:nth-child(5) { transition-delay: .33s; }
.stagger.in > *:nth-child(6) { transition-delay: .40s; }
.stagger.in > * { opacity: 1; transform: translateY(0); }

/* ── PAGE WRAPPER (inner pages) ── */
.page { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-height) + 56px) 24px 80px; }
.page-title { font-size: 32px; font-weight: 700; color: var(--dark); margin-bottom: 6px; letter-spacing: -0.02em; }
.page-sub   { font-size: 14px; color: var(--light-gray); margin-bottom: 48px; }
.back-link  { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--light-gray); text-decoration: none; margin-bottom: 32px; transition: color .2s; }
.back-link:hover { color: var(--dark); }

/* chapter dividers on full-page versions */
.chapter { margin-bottom: 56px; }
.chapter-label { font-size: 11px; font-family: var(--mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--light-gray); padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }

/* awards */
.award-list { display: flex; flex-direction: column; gap: 10px; }
.award-row { background: var(--light-bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; }
.award-title { font-size: 13.5px; font-weight: 600; color: var(--dark); margin-bottom: 3px; }
.award-org   { font-size: 12px; color: var(--light-gray); }

/* certs */
.cert-list { display: flex; flex-direction: column; gap: 0; }
.cert-row  { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.cert-row:last-child { border-bottom: none; }
.cert-name   { font-size: 13.5px; font-weight: 500; color: var(--dark); }
.cert-issuer { font-size: 12px; color: var(--light-gray); margin-top: 2px; }
.cert-link   { font-size: 12px; font-family: var(--mono); color: var(--accent); text-decoration: none; white-space: nowrap; flex-shrink: 0; transition: opacity .2s; }
.cert-link:hover { opacity: .7; }

/* filter btns (projects page) */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn {
  padding: 7px 16px; background: none;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; font-family: var(--font); color: var(--light-gray);
  cursor: pointer; transition: all .2s;
}
.filter-btn:hover { border-color: #aaa; color: var(--dark); }
.filter-btn.active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* section label on projects page */
.cat-label { font-size: 11px; font-family: var(--mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--light-gray); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* page-break visual divider */
.page-break { height: 1px; background: var(--border); max-width: 920px; margin: 0 auto; }

/* modal */
.modal-wrap { display: none; position: fixed; inset: 0; z-index: 300; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-box {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--white); padding: 40px; border-radius: 12px;
  max-width: 480px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); z-index: 1;
}
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--light-gray); line-height: 1; }
.modal-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; color: var(--dark); }
.modal-form  { display: flex; flex-direction: column; gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-label  { font-size: 12px; font-weight: 600; color: var(--light-gray); text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }
.form-input, .form-textarea {
  padding: 11px 14px; background: var(--light-bg);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--dark); font-family: var(--font); outline: none;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 110px; }
.form-submit { padding: 12px; background: var(--dark); color: var(--white); border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: opacity .2s; }
.form-submit:hover { opacity: .85; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .proj-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .hero-container { grid-template-columns: 1fr; gap: 28px; }
  .hero-left { margin: 0 auto; }
  .hero-right { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .hero-center h1 { font-size: 28px; }
  .skills-grid { grid-template-columns: 1fr; }
  .feature-inner { grid-template-columns: 1fr; }
  .feature-badge { display: none; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .tl-header { flex-direction: column; gap: 2px; }
  .tl-date { padding-top: 0; }
  footer { flex-direction: column; gap: 4px; text-align: center; }
}
@media (max-width: 520px) {
  .proj-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 26px; }
}