/* ── VARIABLES ── */
:root {
  --bg:       #f5f5f6;
  --surface:  #ffffff;
  --border:   #eaeaec;
  --border-2: #d5d5da;
  --text-1:   #0a0a0a;
  --text-2:   #4a4a52;
  --text-3:   #9898a6;
  --sh-xs:    0 1px 4px rgba(0,0,0,.05),0 1px 2px rgba(0,0,0,.03);
  --sh-sm:    0 4px 14px rgba(0,0,0,.07),0 1px 4px rgba(0,0,0,.04);
  --sh-md:    0 8px 28px rgba(0,0,0,.09),0 2px 8px rgba(0,0,0,.05);
  --sh-hover: 0 6px 22px rgba(0,0,0,.11),0 2px 6px rgba(0,0,0,.06);
}
html.dark {
  --bg:       #101012;
  --surface:  #18181b;
  --border:   #28282d;
  --border-2: #38383f;
  --text-1:   #f2f2f4;
  --text-2:   #9898aa;
  --text-3:   #5a5a6a;
  --sh-xs:    0 1px 4px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.35);
  --sh-sm:    0 4px 14px rgba(0,0,0,.65),0 1px 4px rgba(0,0,0,.45);
  --sh-md:    0 8px 28px rgba(0,0,0,.8),0 2px 8px rgba(0,0,0,.55);
  --sh-hover: 0 6px 22px rgba(0,0,0,.72),0 2px 6px rgba(0,0,0,.5);
}

/* ── BASE ── */
html, body { overscroll-behavior: none; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
  caret-color: auto;
}

/* ── PAGE WRAP — explicit width fix for Vercel ── */
.page-wrap {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  padding-top: 36px;
  padding-bottom: 0;
}
@media (max-width: 640px) {
  .page-wrap {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 22px;
  }
}

/* ── SEPARATOR ── */
.sep {
  height: 1px;
  background: var(--border);
  margin-top: 24px;
  margin-bottom: 24px;
  transition: background .25s;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.a1 { animation: fadeUp .42s ease .04s both; }
.a2 { animation: fadeUp .42s ease .10s both; }
.a3 { animation: fadeUp .42s ease .16s both; }
.a4 { animation: fadeUp .42s ease .22s both; }
.a5 { animation: fadeUp .42s ease .28s both; }
.a6 { animation: fadeUp .42s ease .36s both; }

/* ── TOGGLE ── */
.toggle-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text-2);
  cursor: pointer; box-shadow: var(--sh-xs);
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.toggle-btn:hover { background: var(--bg); box-shadow: var(--sh-sm); }
.i-sun  { display: none;  }
.i-moon { display: block; }
html.dark .i-sun  { display: block;  }
html.dark .i-moon { display: none; }

/* ── PFP — bigger, fixed display ── */
.pfp-wrap {
  position: relative;
  /* slightly bigger than before */
  width: 155px; height: 155px;
  flex-shrink: 0;
}
.pfp-wrap .pfp-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 14px;
  object-fit: cover; object-position: top center;
  box-shadow: var(--sh-md);
  border: 2.5px solid var(--surface);
  /* CRITICAL: default hidden, JS adds pfp-active */
  opacity: 0;
  transition: opacity .28s ease, border-color .25s;
}
.pfp-wrap .pfp-img.pfp-active { opacity: 1; }
@media (max-width: 540px) {
  .pfp-wrap { width: 110px; height: 110px; }
}

/* ── HEADER ── */
.hdr-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 18px; width: 100%;
}
.hdr-right {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: 6px; width: 100%;
}
.hdr-namerow { display: flex; align-items: center; justify-content: center; gap: 7px; }
.hdr-name {
  margin: 0;
  font-size: 1.9rem; font-weight: 700;
  letter-spacing: -.03em; line-height: 1.15;
  color: var(--text-1); transition: color .25s;
}
.hdr-loc {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; font-size: 1rem; color: var(--text-2); transition: color .25s;
}
.hdr-tag { margin: 0;  font-size: 1.1rem; color: var(--text-2); line-height: 1.5; transition: color .25s; }
.hdr-btns {
  display: flex; flex-direction: column;
  gap: 8px; width: 100%; margin-top: 6px;
}
.hdr-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; font-size: .9rem; font-weight: 500;
  padding: 9px 18px; border-radius: 10px;
  cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none; line-height: 1; width: 100%; white-space: nowrap;
  transition: transform .18s, opacity .18s, background .2s, border-color .2s, box-shadow .2s;
}
.hdr-btn:hover  { transform: translateY(-1px); }
.hdr-btn:active { transform: none; }
.btn-primary {
  background: var(--text-1); color: var(--surface);
  border-color: var(--text-1); box-shadow: var(--sh-sm);
}
html.dark .btn-primary { background: #f0f0f2; color: #0a0a0a; border-color: #f0f0f2; }
.btn-primary:hover { opacity: .86; box-shadow: var(--sh-md); }
.btn-ghost {
  background: var(--surface); color: var(--text-1);
  border-color: var(--border-2); box-shadow: var(--sh-xs);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--text-3); box-shadow: var(--sh-sm); }
.btn-cv {
  background: transparent; color: var(--text-1); border-color: var(--border-2);
}
.btn-cv:hover { background: var(--bg); box-shadow: var(--sh-sm); }

@media (min-width: 500px) {
  .hdr-btns { flex-direction: row; flex-wrap: wrap; justify-content: center; width: auto; }
  .hdr-btn  { width: auto; }
}
@media (min-width: 860px) {
  .hdr-inner   { flex-direction: row; align-items: flex-start; gap: 24px; }
  .hdr-right   { align-items: flex-start; text-align: left; flex: 1; padding-top: 4px; }
  .hdr-namerow { justify-content: flex-start; }
  .hdr-loc     { justify-content: flex-start; }
  .hdr-btns    { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; width: auto; }
  .hdr-name    { font-size: 2.05rem; }
}

/* ── BODY GRID 65/35 ── */
.body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 768px) {
  .body-grid {
    grid-template-columns: 65fr 35fr;
    align-items: start;
    gap: 16px;
  }
}

/* right col uses stretch so cards fill it equally */
.col-left  { display: flex; flex-direction: column; gap: 14px; }
.col-right { display: flex; flex-direction: column; gap: 14px; }

/* ── SECTION CARD ── */
.section-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: var(--sh-xs);
  transition: background .25s, border-color .25s, box-shadow .22s;
}
.section-card:hover { box-shadow: var(--sh-hover); }

.section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
  transition: color .25s;
}
.section-label svg { flex-shrink: 0; }

.view-all-link {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .68rem; font-weight: 600;
  color: var(--text-3); text-decoration: none;
  text-transform: none; letter-spacing: 0;
  transition: color .15s;
}
.view-all-link:hover { color: var(--text-1); }

/* ── ABOUT ── */
.about-text { font-size: .9375rem; color: var(--text-2); line-height: 1.75; transition: color .25s; }
.about-text + .about-text { margin-top: 10px; }

/* ── TECH STACK ── */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 540px) { .stack-grid { grid-template-columns: 1fr; gap: 10px; } }
.stack-group-label { font-size: .74rem; font-weight: 600; color: var(--text-3); margin-bottom: 7px; transition: color .25s; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center;
  font-size: .775rem; font-weight: 500; padding: 3px 10px; border-radius: 7px;
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text-2);
  transition: border-color .15s, color .15s, background .25s, box-shadow .15s;
}
.chip:hover { border-color: var(--border-2); color: var(--text-1); box-shadow: var(--sh-xs); }

/* ── PROJECTS ── */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .proj-grid { grid-template-columns: 1fr; } }
.proj-card {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 11px; overflow: hidden; text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s, background .25s;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--sh-hover); border-color: var(--border-2); }
.proj-banner { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--border); flex-shrink: 0; }
.proj-banner img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .35s; }
.proj-card:hover .proj-banner img { transform: scale(1.05); }
.proj-banner-fb { background: linear-gradient(135deg, var(--border) 0%, var(--border-2) 100%); }
.proj-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.proj-title { font-size: .875rem; font-weight: 600; color: var(--text-1); margin-bottom: 3px; line-height: 1.3; transition: color .25s; }
.proj-desc  { font-size: .775rem; color: var(--text-2); line-height: 1.55; flex: 1; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .25s; }
.proj-link  { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1.5px solid var(--border-2); border-radius: 6px; padding: 2px 8px; width: fit-content; text-decoration: none; transition: border-color .15s, color .15s, background .25s; }
.proj-link:hover { border-color: var(--text-3); color: var(--text-1); }

/* ── CERTIFICATIONS ── */
.cert-list { display: flex; flex-direction: column; gap: 7px; }
.cert-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 13px; border-radius: 9px;
  background: var(--bg); border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .25s;
}
.cert-item:hover { border-color: var(--border-2); box-shadow: var(--sh-hover); }
.cert-left  { flex: 1; min-width: 0; }
.cert-title { font-size: .875rem; font-weight: 600; color: var(--text-1); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.cert-issuer{ font-size: .775rem; color: var(--text-3); transition: color .25s; }
.cert-year  { font-size: .75rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; transition: color .25s; }
/* cert modal */
.cert-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.cert-overlay.open { opacity: 1; pointer-events: all; }
.cert-modal { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 22px; max-width: 440px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,.22); position: relative; transform: translateY(10px); transition: transform .25s, background .25s, border-color .25s; }
.cert-overlay.open .cert-modal { transform: translateY(0); }
.cert-modal-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 7px; background: var(--bg); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-3); transition: background .15s, color .15s, border-color .25s; }
.cert-modal-close:hover { background: var(--border); color: var(--text-1); }
.cert-modal-img { width: 100%; border-radius: 9px; margin-bottom: 14px; border: 1.5px solid var(--border); min-height: 100px; background: var(--bg); display: block; transition: border-color .25s; }
.cert-modal-title { font-size: 1rem; font-weight: 700; color: var(--text-1); margin-bottom: 2px; transition: color .25s; }
.cert-modal-meta  { font-size: .825rem; color: var(--text-3); margin-bottom: 14px; transition: color .25s; }
.cert-modal-verify { display: inline-flex; align-items: center; gap: 5px; font-size: .825rem; font-weight: 500; color: var(--text-1); background: var(--bg); border: 1.5px solid var(--border-2); border-radius: 8px; padding: 8px 14px; text-decoration: none; transition: border-color .15s, background .15s; }
.cert-modal-verify:hover { border-color: var(--text-3); }

/* ── EDUCATION ── */
.edu-row  { display: flex; gap: 12px; align-items: flex-start; }
.edu-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--bg); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-3); transition: background .25s, border-color .25s; }
.edu-body { flex: 1; }
.edu-school { font-size: .9375rem; font-weight: 600; color: var(--text-1); margin-bottom: 1px; transition: color .25s; }
.edu-degree { font-size: .85rem; color: var(--text-2); margin-bottom: 6px; transition: color .25s; }
.edu-meta   { display: flex; flex-wrap: wrap; gap: 5px; }
.edu-tag    { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; color: var(--text-3); background: var(--bg); border: 1.5px solid var(--border); border-radius: 6px; padding: 2px 7px; transition: background .25s, border-color .25s, color .25s; }

/* ── EXPERIENCE ── */
.timeline { display: flex; flex-direction: column; }
.tl-item  { display: flex; gap: 12px; }
.tl-left  { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 13px; }
.tl-dot   { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); flex-shrink: 0; margin-top: 3px; z-index: 1; transition: border-color .2s, background .2s; }
.tl-item.tl-active .tl-dot { border-color: var(--text-1); background: var(--text-1); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
html.dark .tl-item.tl-active .tl-dot { box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.tl-line  { width: 2px; flex: 1; background: var(--border); margin-top: 3px; min-height: 14px; transition: background .25s; }
.tl-body  { padding-bottom: 16px; flex: 1; }
.tl-year  { font-size: .74rem; font-weight: 600; color: var(--text-3); margin-bottom: 1px; transition: color .25s; }
.tl-title { font-size: .875rem; font-weight: 600; color: var(--text-1); margin-bottom: 2px; transition: color .25s; }
.tl-desc  { font-size: .8rem; color: var(--text-2); line-height: 1.58; transition: color .25s; }

/* ── RECOMMENDATIONS ── */
.rec-slider  { position: relative; overflow: hidden; }
.rec-track   { display: flex; transition: transform .4s cubic-bezier(.25,.8,.25,1); }
.rec-slide   { flex: 0 0 100%; padding: 1px; }
.rec-card    { background: var(--bg); border: 1.5px solid var(--border); border-radius: 11px; padding: 14px; transition: background .25s, border-color .25s; }
.rec-quote   { font-size: .875rem; color: var(--text-2); line-height: 1.72; font-style: italic; margin-bottom: 10px; transition: color .25s; }
.rec-author  { font-size: .8rem; font-weight: 600; color: var(--text-1); transition: color .25s; }
.rec-role    { font-size: .75rem; color: var(--text-3); transition: color .25s; }
.rec-dots    { display: flex; justify-content: center; gap: 5px; margin-top: 12px; }
.rec-dot     { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); cursor: pointer; transition: background .2s, transform .2s; }
.rec-dot.active { background: var(--text-1); transform: scale(1.25); }

/* ── RIGHT COL ALIGNMENT — rec & cert same bottom ──
   Both cards sit in col-right which is flex column.
   We make cert card fill remaining space so bottoms align. */
.col-right .cert-card-wrap { flex: 1; display: flex; flex-direction: column; }
.col-right .cert-card-wrap .section-card { flex: 1; }

/* ── GALLERY — single carousel, improved design ── */
.gallery-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: var(--sh-xs);
  transition: background .25s, border-color .25s, box-shadow .22s;
}
.gallery-section:hover { box-shadow: var(--sh-hover); }
.gallery-wrap { position: relative; padding: 0 8px; }
.gallery-outer {
  overflow: hidden;
  border-radius: 10px;
}
.gallery-track {
  display: flex;
  gap: 12px;
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
}
.gallery-item {
  flex: 0 0 calc(33.333% - 8px);
  aspect-ratio: 4/3;
  border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: border-color .25s, box-shadow .2s;
}
.gallery-item:hover { border-color: var(--border-2); box-shadow: var(--sh-hover); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .32s; }
.gallery-item:hover img { transform: scale(1.04); }
@media (max-width: 640px) { .gallery-item { flex: 0 0 calc(50% - 6px); } }
@media (max-width: 400px) { .gallery-item { flex: 0 0 100%; } }
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
  box-shadow: var(--sh-sm);
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
  z-index: 2;
}
.gallery-arrow:hover { background: var(--bg); box-shadow: var(--sh-md); color: var(--text-1); border-color: var(--text-3); }
.gallery-arrow.prev { left: -8px; }
.gallery-arrow.next { right: -8px; }

/* ── LET'S WORK TOGETHER ── */
.letswork {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 28px; box-shadow: var(--sh-xs);
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  transition: background .25s, border-color .25s, box-shadow .22s;
}
.letswork:hover { box-shadow: var(--sh-hover); }
@media (max-width: 600px) { .letswork { grid-template-columns: 1fr; gap: 20px; } }
.letswork-heading { font-size: 1.2rem; font-weight: 700; color: var(--text-1); margin-bottom: 6px; transition: color .25s; }
.letswork-heading span { text-decoration: underline; text-underline-offset: 3px; }
.letswork-desc { font-size: .875rem; color: var(--text-2); line-height: 1.65; margin-bottom: 14px; transition: color .25s; }
.social-row  { display: flex; gap: 7px; flex-wrap: wrap; }
.social-btn  { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--bg); border: 1.5px solid var(--border); color: var(--text-2); text-decoration: none; transition: border-color .15s, color .15s, background .25s, box-shadow .15s; }
.social-btn:hover { border-color: var(--border-2); color: var(--text-1); box-shadow: var(--sh-xs); }
.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 9px; background: var(--bg); border: 1.5px solid var(--border); text-decoration: none; transition: border-color .2s, box-shadow .2s, background .25s; }
.contact-item:hover { border-color: var(--border-2); box-shadow: var(--sh-hover); }
.contact-icon { width: 32px; height: 32px; border-radius: 7px; background: var(--surface); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-3); flex-shrink: 0; transition: background .25s, border-color .25s; }
.contact-info { flex: 1; min-width: 0; }
.contact-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 1px; transition: color .25s; }
.contact-val   { font-size: .84rem; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.contact-arrow { color: var(--text-3); flex-shrink: 0; transition: transform .2s, color .25s; }
.contact-item:hover .contact-arrow { transform: translateX(3px); }

/* ── FOOTER ── */
.site-footer { text-align: center; padding: 24px 0 20px; font-size: .8rem; color: var(--text-3); transition: color .25s; }

/* ── GRID GAP FIX — no empty space between cols ── */

/* body-grid: stretch so both cols are same height */
@media (min-width: 768px) {
  .body-grid { align-items: stretch !important; }
}

/* col-left/right: last card stretches to fill remaining space */
.col-left  { display: flex; flex-direction: column; gap: 14px; }
.col-right { display: flex; flex-direction: column; gap: 14px; }
.col-left  > *:last-child { flex: 1; }
.col-right > *:last-child { flex: 1; }

/* cert-card-wrap stretches its inner card */
.cert-card-wrap { flex: 1; display: flex; flex-direction: column; }
.cert-card-wrap .section-card { flex: 1; }

/* ── CERT + REC ROW — same 65/35, equal height ── */
.cert-rec-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (min-width: 768px) {
  .cert-rec-row {
    grid-template-columns: 65fr 35fr;
    align-items: stretch;
    gap: 16px;
  }
}

/* cards inside the row stretch to same height */
.cert-rec-card {
  display: flex;
  flex-direction: column;
}

/* rec slider fills remaining space so card matches cert height */
.cert-rec-card .rec-slider {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cert-rec-card .rec-track { flex: 1; }
.cert-rec-card .rec-slide { flex: 0 0 100%; display: flex; flex-direction: column; }
.cert-rec-card .rec-card  { flex: 1; }