/* ============================================
   PORTFOLIO — style.css
   Black & White · Two-column · Fully Responsive
   Breakpoints:
     ≥ 900px  → two-column desktop
     600-899px → single column tablet
     < 600px  → mobile
     < 380px  → small mobile (iPhone SE etc.)
   ============================================ */

/* ══ THEME TOKENS ══ */

[data-theme="dark"] {
  --bg:           #111111;
  --surface:      #1a1a1a;
  --card:         #1e1e1e;
  --card-hover:   #242424;
  --border:       #2a2a2a;
  --border-hi:    #444444;
  --text:         #f0f0f0;
  --text-2:       #a0a0a0;
  --text-3:       #606060;
  --btn-fill-bg:  #f0f0f0;
  --btn-fill-c:   #111111;
  --btn-fill-hov: #cccccc;
  --btn-out-bg:   rgba(255,255,255,0.04);
  --btn-out-bd:   #303030;
  --btn-out-c:    #b0b0b0;
  --btn-out-hov:  rgba(255,255,255,0.08);
  --tag-bg:       #1e1e1e;
  --tag-bd:       #2e2e2e;
  --tag-c:        #a8a8a8;
  --badge-bg:     rgba(255,255,255,0.05);
  --badge-bd:     rgba(255,255,255,0.13);
  --badge-c:      #cccccc;
  --dot-on:       #f0f0f0;
  --dot-off:      #333333;
  --dot-glow:     rgba(240,240,240,0.15);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
  --focus:        rgba(255,255,255,0.35);
}

[data-theme="light"] {
  --bg:           #f2f2f2;
  --surface:      #ffffff;
  --card:         #ffffff;
  --card-hover:   #fafafa;
  --border:       #e2e2e2;
  --border-hi:    #aaaaaa;
  --text:         #111111;
  --text-2:       #555555;
  --text-3:       #999999;
  --btn-fill-bg:  #111111;
  --btn-fill-c:   #ffffff;
  --btn-fill-hov: #333333;
  --btn-out-bg:   rgba(0,0,0,0.03);
  --btn-out-bd:   #d8d8d8;
  --btn-out-c:    #444444;
  --btn-out-hov:  rgba(0,0,0,0.06);
  --tag-bg:       #f0f0f0;
  --tag-bd:       #e2e2e2;
  --tag-c:        #444444;
  --badge-bg:     rgba(0,0,0,0.04);
  --badge-bd:     rgba(0,0,0,0.11);
  --badge-c:      #333333;
  --dot-on:       #111111;
  --dot-off:      #cccccc;
  --dot-glow:     rgba(0,0,0,0.08);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --focus:        rgba(0,0,0,0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

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

/* FIX: ensure section IDs have scroll-margin so sticky nav doesn't cover them */
section[id] {
  scroll-margin-top: 16px;
}

*:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ══ SHARED LAYOUT ══ */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* ══ HEADER ══ */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: clamp(24px, 5vw, 44px) 0 clamp(20px, 4vw, 36px);
  transition: background 0.25s, border-color 0.25s;
}

.hero {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 3vw, 28px);
}

/* ── Avatar ── */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: clamp(80px, 15vw, 150px);
  height: clamp(80px, 15vw, 150px);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: clamp(10px, 2vw, 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 5vw, 48px);
  overflow: hidden;
  transition: border-color 0.25s;
}

/* FIX: avatar image styles — was defined at the bottom in the original causing specificity issues */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
  display: block;
}

/* FIX: fallback icon when avatar image fails to load */
.avatar-fallback {
  font-size: clamp(28px, 5vw, 48px);
  color: var(--text-3);
}

.avatar-dot {
  position: absolute;
  bottom: clamp(4px, 1vw, 8px);
  right: clamp(4px, 1vw, 8px);
  width: clamp(9px, 1.5vw, 13px);
  height: clamp(9px, 1.5vw, 13px);
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  transition: border-color 0.25s;
}

/* ── Hero info ── */
.hero-info {
  flex: 1;
  min-width: 0;
  /* Ensure the info column never overflows its flex cell */
  overflow: hidden;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.hero-name {
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
}

.hero-verified {
  font-size: clamp(14px, 2vw, 18px);
  color: #1877F2;
  flex-shrink: 0;
}

/* ── Theme toggle ── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tag-bg);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--border-hi);
  color: var(--text);
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(11px, 1.8vw, 13px);
  color: var(--text-3);
  margin-bottom: 5px;
}
.hero-location i { font-size: 11px; color: var(--text-2); }

.hero-roles {
  font-size: clamp(11.5px, 1.8vw, 13.5px);
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.hero-roles b { color: var(--text); font-weight: 500; }

/* FIX: badge is now a <span>, not an <a>, so pointer-events removed */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-bd);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: clamp(10.5px, 1.6vw, 12px);
  font-weight: 500;
  color: var(--badge-c);
  margin-bottom: 12px;
  white-space: normal;
  word-break: break-word;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  /* Constrain to parent width so buttons don't overflow */
  width: 100%;
  max-width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(7px, 1.2vw, 9px) clamp(12px, 2vw, 16px);
  border-radius: 8px;
  font-size: clamp(11.5px, 1.6vw, 13px);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
  /* Prevent buttons from overflowing their container */
  min-width: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-fill {
  background: var(--btn-fill-bg);
  color: var(--btn-fill-c);
  border-color: var(--btn-fill-bg);
}
.btn-fill:hover {
  background: var(--btn-fill-hov);
  border-color: var(--btn-fill-hov);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--btn-out-bg);
  color: var(--btn-out-c);
  border-color: var(--btn-out-bd);
}
.btn-ghost:hover {
  background: var(--btn-out-hov);
  border-color: var(--border-hi);
  color: var(--text);
  transform: translateY(-1px);
}

/* ══ MAIN GRID ══ */
.main-wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(12px, 2.5vw, 24px) clamp(16px, 4vw, 32px) clamp(32px, 5vw, 56px);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: clamp(10px, 2vw, 16px);
  align-items: start;
}

.col { display: flex; flex-direction: column; gap: clamp(10px, 2vw, 16px); }

/* ══ CARD ══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: clamp(10px, 1.5vw, 14px);
  padding: clamp(14px, 2.5vw, 22px);
  box-shadow: var(--shadow-card);
  transition: background 0.25s, border-color 0.25s;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 2vw, 18px);
}

.section-label {
  font-size: clamp(9.5px, 1.4vw, 11px);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.section-label i { font-size: 10px; }

.view-all {
  font-size: clamp(10.5px, 1.5vw, 12px);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
/* FIX: only apply hover on actual links */
a.view-all:hover { color: var(--text); }

/* ── About ── */
.about-body {
  font-size: clamp(12px, 1.6vw, 13.5px);
  color: var(--text-2);
  line-height: 1.8;
}
.about-body p + p { margin-top: 10px; }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; }

.tl-item {
  display: flex;
  gap: 10px;
  padding: clamp(8px, 1.5vw, 12px) 0;
  border-bottom: 1px solid var(--border);
}
.tl-item:first-child { padding-top: 0; }
.tl-item:last-child  { border-bottom: none; padding-bottom: 0; }

.tl-dot-wrap {
  display: flex;
  align-items: flex-start;
  padding-top: 5px;
  flex-shrink: 0;
  width: 14px;
}

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-off);
  border: 2px solid var(--surface);
  outline: 1.5px solid var(--dot-off);
  flex-shrink: 0;
  transition: background 0.25s, outline-color 0.25s;
}
.tl-dot.active {
  background: var(--dot-on);
  outline-color: var(--dot-on);
  box-shadow: 0 0 0 3px var(--dot-glow);
}

.tl-body { flex: 1; min-width: 0; }

.tl-year {
  display: block;
  font-size: clamp(10px, 1.4vw, 11.5px);
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 1px;
}
.tl-body h3 {
  font-size: clamp(12px, 1.6vw, 13.5px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.tl-body > p {
  font-size: clamp(11px, 1.4vw, 12.5px);
  color: var(--text-2);
  margin-top: 1px;
}

.edu-list {
  list-style: none;
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.edu-list li {
  font-size: clamp(10.5px, 1.3vw, 12px);
  color: var(--text-3);
  padding-left: 12px;
  position: relative;
  line-height: 1.5;
}
.edu-list li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--text-3);
}

/* ── Tech Stack ── */
.stack-group { margin-bottom: 13px; }
.stack-group:last-child { margin-bottom: 0; }

.stack-label {
  font-size: clamp(9px, 1.2vw, 10px);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  border-radius: 6px;
  padding: clamp(3px, 0.6vw, 5px) clamp(8px, 1.2vw, 11px);
  font-size: clamp(10.5px, 1.4vw, 12px);
  color: var(--tag-c);
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--border-hi); color: var(--text); }

/* ── Projects ── */
.projects-list { display: flex; flex-direction: column; gap: 6px; }

.project-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  border-radius: 9px;
  padding: clamp(10px, 1.8vw, 13px) clamp(12px, 2vw, 15px);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  /* FIX: ensure <span> used for disabled cards still lays out correctly */
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  width: 100%;
}
.project-card:hover {
  border-color: var(--border-hi);
  background: var(--card-hover);
  transform: translateX(2px);
}

/* FIX: disabled project cards (no href) should look muted and not animate */
.project-card--disabled {
  opacity: 0.5;
  cursor: default;
}
.project-card--disabled:hover {
  border-color: var(--tag-bd);
  background: var(--tag-bg);
  transform: none;
}
.project-card--disabled .proj-arrow {
  opacity: 0.4;
}

.proj-info { min-width: 0; }
.proj-info h3 {
  font-size: clamp(12px, 1.5vw, 13.5px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1px;
}
.proj-info > p {
  font-size: clamp(11px, 1.4vw, 12.5px);
  color: var(--text-2);
}
.proj-url {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(10px, 1.3vw, 11.5px);
  color: var(--text-3);
  margin-top: 2px;
}

.proj-arrow {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.project-card:hover .proj-arrow { transform: translateX(3px); color: var(--text); }

/* ── Certifications ── */
.certs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* FIX: button reset for cert-card */
button.cert-card {
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  border-radius: 9px;
  padding: clamp(10px, 1.6vw, 13px);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.cert-card:hover {
  border-color: var(--border-hi);
  background: var(--card-hover);
  transform: translateY(-1px);
}

.cert-icon {
  font-size: clamp(12px, 1.8vw, 15px);
  color: var(--text-2);
  flex-shrink: 0;
  margin-top: 2px;
}
.cert-name {
  font-size: clamp(11px, 1.4vw, 12.5px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 1px;
}
.cert-issuer {
  font-size: clamp(10px, 1.2vw, 11.5px);
  color: var(--text-3);
}

/* ── Recommendations ── */
.recs-list { display: flex; flex-direction: column; gap: 8px; }

.rec-card {
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  border-radius: 9px;
  padding: clamp(12px, 2vw, 16px);
}
.rec-quote-icon {
  font-size: 14px;
  color: var(--text-3);
  opacity: 0.65;
  margin-bottom: 8px;
}
.rec-text {
  font-size: clamp(11.5px, 1.5vw, 13px);
  font-style: italic;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 10px;
}
.rec-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 8px;
}
.rec-name {
  font-size: clamp(11.5px, 1.5vw, 13px);
  font-weight: 500;
  color: var(--text);
}
.rec-role {
  font-size: clamp(10.5px, 1.3vw, 12px);
  color: var(--text-3);
  margin-top: 1px;
}

/* ══ FOOTER ══ */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: clamp(28px, 5vw, 48px) 0 clamp(28px, 5vw, 52px);
  transition: background 0.25s, border-color 0.25s;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 52px);
  margin-bottom: clamp(24px, 4vw, 36px);
}

.footer-col-label {
  font-size: clamp(9.5px, 1.3vw, 11px);
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: clamp(12px, 2vw, 18px);
}

.footer-contacts { display: flex; flex-direction: column; gap: 13px; }

.footer-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-2);
  min-width: 0;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text); }

/* FIX: button reset for footer-link button */
button.footer-link {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  padding: 0;
}

.footer-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-2);
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.footer-link:hover .footer-link-icon { color: var(--text); border-color: var(--border-hi); }

.footer-link-content { min-width: 0; }
.footer-link-title { font-size: clamp(12px, 1.6vw, 13.5px); font-weight: 500; color: var(--text); }
.footer-link-sub {
  font-size: clamp(10.5px, 1.4vw, 12px);
  color: var(--text-3);
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.social-row { display: flex; gap: 7px; flex-wrap: wrap; }

.social-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}
.social-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.footer-copy {
  font-size: clamp(10.5px, 1.4vw, 12px);
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: clamp(14px, 2.5vw, 22px);
}

/* ══ CERTIFICATE LIGHTBOX ══ */
/* FIX: use visibility+opacity instead of display:none/flex to allow CSS transitions */
.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}
.cert-lightbox.open {
  visibility: visible;
  opacity: 1;
}

.cert-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.cert-lightbox-box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: clamp(12px, 2vw, 18px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 780px;
  overflow: hidden;
  /* FIX: animation only plays when lightbox is opened */
  transform: scale(0.92) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.cert-lightbox.open .cert-lightbox-box {
  transform: scale(1) translateY(0);
}

.cert-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(12px, 2vw, 18px) clamp(14px, 2.5vw, 22px);
  border-bottom: 1px solid var(--border);
}

.cert-lightbox-title {
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 600;
  color: var(--text);
}

.cert-lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tag-bg);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.cert-lightbox-close:hover {
  background: var(--card-hover);
  border-color: var(--border-hi);
  color: var(--text);
  transform: scale(1.1);
}

/* FIX: max-height so large certs don't overflow the viewport */
.cert-lightbox-img-wrap {
  padding: clamp(14px, 2.5vw, 22px);
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}
.cert-lightbox-img-wrap img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* ══ EMAIL MODAL ══ */
/* FIX: same visibility/opacity pattern for smooth open/close transitions */
.email-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  /* FIX: padding ensures modal doesn't hug screen edges on mobile */
  padding: 16px;
}
.email-modal.open {
  visibility: visible;
  opacity: 1;
}

.email-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.email-modal-box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  width: min(480px, 100%);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.22s ease;
  /* FIX: cap height and allow scrolling so modal works on short screens */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.email-modal.open .email-modal-box {
  transform: translateY(0) scale(1);
}

.email-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  /* FIX: sticky header inside scrollable modal */
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.email-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.email-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 1.1rem;
  padding: 0.3rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.email-modal-close:hover {
  color: var(--text);
  background: var(--border);
}
.email-modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.email-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.email-field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.email-field input,
.email-field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
  outline: none;
  /* FIX: prevent iOS auto-zoom on focus (must be ≥16px on iOS) */
  font-size: max(16px, 0.9rem);
}
.email-field input::placeholder,
.email-field textarea::placeholder { color: var(--text-3); }
.email-field input:focus,
.email-field textarea:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.email-send-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}
.email-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.email-modal-status {
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.email-modal-status.success { color: #4ade80; }
.email-modal-status.error   { color: #f87171; }
.email-modal-status i { font-size: 1rem; flex-shrink: 0; }

/* ══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════ */

/* ── Tablet: 600–899px — single column ── */
@media (max-width: 899px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .col-left,
  .col-right {
    display: contents;
  }

  #about           { order: 1; }
  #experience      { order: 2; }
  #tech            { order: 3; }
  #education       { order: 4; }
  #projects        { order: 5; }
  #certifications  { order: 6; }
  #recommendations { order: 7; }

  .certs-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Narrow tablet / large phone landscape: 600–750px ── */
@media (max-width: 750px) and (min-width: 600px) {
  /* When avatar + info are side by side, stack buttons full-width */
  .cta-row {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .cta-row .btn {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
  }
}

/* ── Mobile: < 600px ── */
@media (max-width: 599px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .certs-grid { grid-template-columns: 1fr; }
  .hero { gap: 12px; }
  .badge { font-size: 11px; }

  /* Theme toggle: fixed top-right on mobile */
  .theme-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 999;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-left: 0;
  }

  .avatar-wrap {
    width: clamp(80px, 25vw, 110px);
    height: clamp(80px, 25vw, 110px);
    flex-shrink: 0;
  }

  /* Buttons: full-width stacked */
  .cta-row {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .cta-row .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13.5px;
  }
}

/* ── Small mobile: < 420px ── */
@media (max-width: 419px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .avatar-wrap {
    width: clamp(80px, 30vw, 120px);
    height: clamp(80px, 30vw, 120px);
  }
  .hero-name { font-size: 20px; }
  .hero-roles { font-size: 12px; }
  .certs-grid { grid-template-columns: 1fr; }
  .project-card { flex-wrap: wrap; }

  /* Ensure buttons stay full width when hero stacks */
  .cta-row {
    flex-direction: column;
    width: 100%;
  }
  .cta-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Very small: < 320px ── */
@media (max-width: 319px) {
  .hero-name { font-size: 17px; }
  .badge { font-size: 10px; padding: 4px 8px; }
  .card { padding: 12px; }
}

/* ── Wide desktop: ≥ 1280px ── */
@media (min-width: 1280px) {
  .main-grid { gap: 20px; }
  .main-wrap { padding-top: 28px; padding-bottom: 64px; }
}

/* ── Ultra-wide: ≥ 1600px ── */
@media (min-width: 1600px) {
  .container,
  .main-wrap { max-width: 1320px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}