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

:root {
  --bg: #F8F7F4;
  --surface: #fff;
  --text: #111110;
  --muted: #6B6B6B;
  --subtle: #A3A3A3;
  --accent: #1D4ED8;
  --accent-h: #1E40AF;
  --accent-bg: #EFF6FF;
  --accent-br: #BFDBFE;
  --green: #16A34A;
  --green-bg: #DCFCE7;
  --border: rgba(0,0,0,0.07);
  --border-md: rgba(0,0,0,0.11);
  --r: 8px;
  --rlg: 14px;
  --max: 1080px;
  --nav: 64px;
  --fd: 'Fraunces', Georgia, serif;
  --fb: 'DM Sans', system-ui, sans-serif;
  --fm: 'JetBrains Mono', 'Courier New', monospace;
  --t: .25s ease;
}

[data-theme="dark"] {
  --bg: #0E0E0F;
  --surface: #1A1A1C;
  --text: #F0EFEC;
  --muted: #9D9D9D;
  --subtle: #555;
  --accent: #60A5FA;
  --accent-h: #93C5FD;
  --accent-bg: #172554;
  --accent-br: #1e3a8a;
  --green: #4ADE80;
  --green-bg: #052E16;
  --border: rgba(255,255,255,0.07);
  --border-md: rgba(255,255,255,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 2rem; }
.sec { padding: 5rem 0; }

.sec-label {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.sec-title {
  font-family: var(--fd);
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.sec-desc {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 3rem;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav);
  background: rgba(248,247,244,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--t), border-color var(--t);
}

[data-theme="dark"] nav { background: rgba(14,14,15,.9); }

.nav-in { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.nav-logo {
  font-family: var(--fd);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--t);
}

.nav-ul {
  display: flex;
  align-items: center;
  gap: .125rem;
  list-style: none;
}

.nav-ul a {
  display: block;
  padding: .375rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color var(--t), background var(--t);
}

.nav-ul a:hover, .nav-ul a.active {
  color: var(--text);
  background: rgba(0,0,0,.05);
}

[data-theme="dark"] .nav-ul a:hover,
[data-theme="dark"] .nav-ul a.active { background: rgba(255,255,255,.07); }

.nav-actions { display: flex; align-items: center; gap: .625rem; }

/* Theme toggle */
.theme-toggle {
  width: 34px; height: 34px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--t), background var(--t);
}

.theme-toggle:hover { background: rgba(0,0,0,.05); border-color: var(--accent-br); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,.07); }

.theme-icon { line-height: 1; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }

.nav-resume-btn {
  display: inline-flex; align-items: center;
  padding: .375rem .875rem;
  border: 1px solid var(--border-md);
  color: var(--text);
  font-size: .8125rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color var(--t), background var(--t);
}

.nav-resume-btn:hover { background: var(--surface); border-color: rgba(0,0,0,.2); }
[data-theme="dark"] .nav-resume-btn:hover { border-color: rgba(255,255,255,.25); }

.nav-cta {
  display: inline-flex; align-items: center;
  padding: .5rem 1.125rem;
  background: var(--accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background var(--t), transform var(--t);
}

.nav-cta:hover { background: var(--accent-h); transform: translateY(-1px); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}

.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); }

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.mobile-menu.open { opacity: 1; pointer-events: all; }

.mobile-menu ul { list-style: none; text-align: center; }
.mobile-menu ul li { margin-bottom: 1.5rem; }
.mobile-menu ul li:last-child { margin-top: 2rem; margin-bottom: 0; }

.mm-link {
  font-family: var(--fd);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color var(--t);
}

.mm-link:hover { color: var(--accent); }

.mm-cta {
  display: inline-flex; align-items: center;
  padding: .75rem 2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--r);
  text-decoration: none;
  transition: background var(--t);
}

.mm-cta:hover { background: var(--accent-h); }

/* ===== HERO ===== */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav);
  position: relative;
  overflow: hidden;
}

#home::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,.055) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

[data-theme="dark"] #home::before {
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
}

.hero-body { position: relative; z-index: 1; padding: 5rem 0; }

.hero-badge {
  display: inline-flex; align-items: center;
  gap: 8px;
  padding: .375rem .9rem;
  background: var(--green-bg);
  color: var(--green);
  font-size: .8125rem;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid rgba(22,163,74,.2);
  margin-bottom: 1.75rem;
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2s infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.8); }
}

.hero-name {
  font-family: var(--fd);
  font-size: clamp(3.25rem, 9vw, 6.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -.03em;
  margin-bottom: .3em;
}

.hero-name em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.hero-sub {
  font-family: var(--fd);
  font-size: clamp(1.125rem, 2.5vw, 1.625rem);
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 1.375rem;
  letter-spacing: -.01em;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  gap: 2px;
}

.type-cursor {
  color: var(--accent);
  animation: cursor-blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 2rem; }

.btn-p {
  display: inline-flex; align-items: center; gap: 7px;
  padding: .75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .9375rem;
  border-radius: var(--r);
  text-decoration: none;
  transition: background var(--t), transform var(--t);
}

.btn-p:hover { background: var(--accent-h); transform: translateY(-1px); }

.btn-s {
  display: inline-flex; align-items: center; gap: 7px;
  padding: .75rem 1.5rem;
  border: 1px solid var(--border-md);
  color: var(--text);
  font-weight: 500;
  font-size: .9375rem;
  border-radius: var(--r);
  text-decoration: none;
  transition: border-color var(--t), background var(--t);
}

.btn-s:hover { background: var(--surface); border-color: rgba(0,0,0,.2); }
[data-theme="dark"] .btn-s:hover { border-color: rgba(255,255,255,.25); }

.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }

.hchip {
  padding: .275rem .7rem;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: 99px;
  font-family: var(--fm);
  font-size: .6875rem;
  color: var(--muted);
  font-weight: 500;
  transition: border-color var(--t), color var(--t), background var(--t);
  cursor: default;
}

.hchip:hover { border-color: var(--accent-br); color: var(--accent); background: var(--accent-bg); }

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: .6875rem;
  letter-spacing: .1em;
  font-family: var(--fm);
  text-transform: uppercase;
}

.scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--subtle), transparent);
  animation: scroll-anim 2s ease infinite;
}

@keyframes scroll-anim {
  0% { transform: scaleY(0); transform-origin: top; }
  49% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===== ABOUT ===== */
#about { background: var(--surface); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.78;
  margin-bottom: 1rem;
}

.about-text p:last-child { margin-bottom: 0; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.stat-card {
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--border);
  transition: border-color var(--t), transform var(--t);
  cursor: default;
}

.stat-card:hover { border-color: var(--accent-br); transform: translateY(-2px); }

.stat-n {
  font-family: var(--fd);
  font-size: 2.125rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: .25rem;
  color: var(--accent);
}

.stat-n-text { color: var(--text); }
.stat-l { font-size: .8125rem; color: var(--muted); line-height: 1.45; }

/* ===== EXPERIENCE ===== */
#experience { background: var(--bg); }

.timeline { position: relative; padding-left: 1.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 0;
  width: 1px;
  background: var(--border-md);
}

.tl-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 3rem;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -1.5rem; top: .35rem;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--bg);
  outline: 1px solid var(--accent-br);
  transition: transform var(--t);
}

.tl-item:hover .tl-dot { transform: translateX(-50%) scale(1.4); }

.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .3rem;
}

.tl-role { font-size: 1.0625rem; font-weight: 600; }

.tl-date {
  font-family: var(--fm);
  font-size: .6875rem;
  color: var(--subtle);
  white-space: nowrap;
  padding-top: .25rem;
  flex-shrink: 0;
}

.tl-co {
  font-size: .875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: .75rem;
}

.tl-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}

.tl-list li {
  font-size: .9375rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.65;
}

.tl-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--subtle);
  font-size: .75rem;
  top: .18rem;
}

.tl-tags { display: flex; flex-wrap: wrap; gap: .375rem; }

.tl-tag {
  padding: .2rem .55rem;
  background: var(--accent-bg);
  border-radius: 4px;
  font-family: var(--fm);
  font-size: .625rem;
  color: var(--accent);
  font-weight: 500;
}

/* ===== SKILLS ===== */
#skills { background: var(--surface); }

.skill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.skill-tab {
  padding: .375rem .875rem;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 99px;
  font-family: var(--fb);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
}

.skill-tab:hover { border-color: var(--accent-br); color: var(--accent); }

.skill-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.sg-group { transition: opacity var(--t); }
.sg-group.hidden { display: none; }

.sg-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text);
  margin-bottom: .875rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }

.tag {
  display: inline-flex; align-items: center;
  padding: .3rem .7rem;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: 6px;
  font-family: var(--fm);
  font-size: .6875rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t);
  cursor: default;
}

.tag:hover {
  border-color: var(--accent-br);
  background: var(--accent-bg);
  color: var(--accent);
}

/* Skill bars */
.skill-bars { display: flex; flex-direction: column; gap: .75rem; }

.skill-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  align-items: center;
  gap: .75rem;
  font-size: .8125rem;
  color: var(--muted);
}

.skill-bar-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-h));
  border-radius: 99px;
  width: 0%;
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

.skill-pct {
  font-family: var(--fm);
  font-size: .6875rem;
  color: var(--subtle);
  text-align: right;
}

/* ===== PROJECTS ===== */
#projects { background: var(--bg); }

.proj-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.proj-filter {
  padding: .375rem .875rem;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 99px;
  font-family: var(--fb);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
}

.proj-filter:hover { border-color: var(--accent-br); color: var(--accent); }

.proj-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.125rem;
}

.proj-card {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--rlg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--t), transform var(--t);
}

.proj-card:hover { border-color: var(--accent-br); transform: translateY(-3px); }
.proj-card.hidden { display: none; }

.proj-ico {
  width: 40px; height: 40px;
  background: var(--accent-bg);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.proj-title { font-weight: 600; font-size: 1rem; margin-bottom: .5rem; }
.proj-desc { font-size: .875rem; color: var(--muted); line-height: 1.65; flex: 1; margin-bottom: 1.125rem; }
.proj-tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 1.125rem; }

.proj-tag {
  padding: .2rem .55rem;
  background: var(--bg);
  border-radius: 4px;
  font-family: var(--fm);
  font-size: .625rem;
  color: var(--muted);
}

.proj-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.proj-link {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t);
}

.proj-link:hover { color: var(--accent); }

.proj-detail-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: color var(--t);
  font-family: var(--fb);
  padding: 0;
}

.proj-detail-btn:hover { color: var(--accent-h); text-decoration: underline; }

/* ===== PROJECT MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--rlg);
  border: 1px solid var(--border-md);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  transform: translateY(20px);
  transition: transform .3s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  background: none;
  border: 1px solid var(--border-md);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}

.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-body h3 {
  font-family: var(--fd);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .4rem;
  padding-right: 2.5rem;
}

.modal-company {
  font-size: .875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.125rem;
}

.modal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: 1.25rem;
}

.modal-tag {
  padding: .275rem .65rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-br);
  border-radius: 6px;
  font-family: var(--fm);
  font-size: .6875rem;
  color: var(--accent);
}

.modal-desc {
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.75;
  margin-bottom: 1.125rem;
}

.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.modal-list li {
  font-size: .9375rem;
  color: var(--muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.65;
}

.modal-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .75rem;
  top: .15rem;
}

.modal-actions { display: flex; gap: 1rem; }

/* ===== EDUCATION ===== */
#education { background: var(--surface); }

.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.edu-card {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: var(--rlg);
  transition: border-color var(--t), transform var(--t);
}

.edu-card:hover { border-color: var(--accent-br); transform: translateY(-2px); }

.edu-ico { font-size: 1.5rem; margin-bottom: .75rem; }
.edu-deg { font-weight: 600; font-size: 1rem; margin-bottom: .3rem; }
.edu-school { font-size: .9rem; color: var(--accent); font-weight: 500; margin-bottom: .25rem; text-decoration: none; }
a.edu-school:hover { text-decoration: underline; }
.edu-loc { font-size: .8125rem; color: var(--muted); font-family: var(--fm); }

/* ===== CONTACT ===== */
#contact { background: var(--bg); }

.contact-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 4rem; align-items: start; }

.contact-info p { font-size: 1.0625rem; color: var(--muted); line-height: 1.75; margin-bottom: 2rem; }

.c-links { display: flex; flex-direction: column; gap: .875rem; }

.c-link {
  display: flex; align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--text);
  font-size: .9375rem;
  font-weight: 500;
  transition: color var(--t);
}

.c-link:hover { color: var(--accent); }

.c-icon {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  font-family: var(--fm);
  font-size: .75rem;
  font-weight: 500;
  transition: border-color var(--t), color var(--t);
}

.c-link:hover .c-icon { border-color: var(--accent-br); color: var(--accent); }

.c-form {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--rlg);
  padding: 2rem;
}

.fg { margin-bottom: 1.125rem; }
.fg label { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: .375rem; }

.fg input, .fg textarea {
  width: 100%;
  padding: .6875rem .875rem;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  font-family: var(--fb);
  font-size: .9375rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--t);
  resize: none;
}

.fg input:focus, .fg textarea:focus { border-color: var(--accent); }
.fg input.error, .fg textarea.error { border-color: #DC2626; }
.fg textarea { height: 118px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field-err {
  display: none;
  font-size: .75rem;
  color: #DC2626;
  margin-top: .25rem;
  font-family: var(--fm);
}

.fg.has-error .field-err { display: block; }

.submit-btn {
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--fb);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
}

.submit-btn:hover { background: var(--accent-h); transform: translateY(-1px); }
.submit-btn:disabled { opacity: .65; cursor: default; transform: none; }

.form-success {
  display: none;
  margin-top: 1rem;
  padding: .875rem 1rem;
  background: var(--green-bg);
  color: var(--green);
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid rgba(22,163,74,.2);
}

.form-success.show { display: block; }

/* ===== FOOTER ===== */
footer {
  background: var(--text);
  padding: 2.25rem 0;
  transition: background var(--t);
}

[data-theme="dark"] footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.foot-in { display: flex; align-items: center; justify-content: space-between; }
.foot-logo { font-family: var(--fd); font-weight: 700; font-size: 1.0625rem; color: #fff; }
[data-theme="dark"] .foot-logo { color: var(--text); }

.foot-copy { font-size: .8125rem; color: rgba(255,255,255,.4); }
[data-theme="dark"] .foot-copy { color: var(--muted); }

.foot-links { display: flex; gap: 1.25rem; }
.foot-links a { font-size: .8125rem; color: rgba(255,255,255,.45); text-decoration: none; transition: color var(--t); }
[data-theme="dark"] .foot-links a { color: var(--muted); }
.foot-links a:hover { color: #fff; }
[data-theme="dark"] .foot-links a:hover { color: var(--text); }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(29,78,216,.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--t), transform var(--t), background var(--t);
  z-index: 500;
}

.back-top.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top:hover { background: var(--accent-h); }

/* ===== REVEAL ANIMATION ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}

.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .about-grid, .contact-grid, .edu-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .skills-grid, .proj-grid { grid-template-columns: 1fr; }
  .nav-ul, .nav-resume-btn { display: none; }
  .hamburger { display: flex; }
  .foot-in { flex-direction: column; gap: 1rem; text-align: center; }
  .sec { padding: 3.5rem 0; }
  .hero-name { font-size: clamp(2.75rem, 13vw, 4.5rem); }
  .frow { grid-template-columns: 1fr; }
  .tl-head { flex-direction: column; gap: .2rem; }
}

@media (max-width: 480px) {
  .nav-cta { display: none; }
  .wrap { padding: 0 1.25rem; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .back-top { bottom: 1.25rem; right: 1.25rem; }
  .modal { padding: 1.5rem; }
}
