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

:root {
  --bg:          #0d0f14;
  --bg-card:     #13161e;
  --bg-hover:    #1a1e2a;
  --border:      #1e2333;
  --accent:      #64ffda;
  --accent-dim:  #3ddc9e44;
  --text:        #ccd6f6;
  --text-muted:  #8892b0;
  --text-dim:    #495670;
  --red:         #ff5f57;
  --yellow:      #ffbd2e;
  --green:       #28c840;
  --font-sans:   'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:   'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --nav-height:  64px;
  --section-gap: 120px;
  --max-width:   1100px;
}

/* ── Light mode overrides ── */
body.light-mode {
  --bg:          #f5f6fa;
  --bg-card:     #ffffff;
  --bg-hover:    #eceef5;
  --border:      #d0d4e4;
  --accent:      #5b21b6;
  --accent-dim:  #5b21b622;
  --text:        #1a1a2e;
  --text-muted:  #4a4a6a;
  --text-dim:    #8888aa;
}

body.light-mode::before {
  opacity: 0.18;
}

body.light-mode::after {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #dde4f5 0%, transparent 70%);
}

body.light-mode #navbar {
  background: rgba(245, 246, 250, 0.88);
}

body.light-mode .hero-tagline {
  color: #1a1a2e;
  border-left-color: #1a56db;
}

html { scroll-behavior: smooth; }

body {
  transition: background-color 0.3s ease, color 0.3s ease;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* Radial glow overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #0d2040 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

section, nav, footer {
  position: relative;
  z-index: 1;
}

.accent       { color: var(--accent); }
.monospace    { font-family: var(--font-mono); }
.hidden       { display: none !important; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.75; }

/* =========================================================
   NAVBAR
   ========================================================= */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

#navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  opacity: 1;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 7px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.25s, border-color 0.25s;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-icon { display: block; }

.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: 4px;
}

/* Mobile nav — base rules (animation handled at end of file) */
@media (max-width: 700px) {
  .nav-hamburger { display: block; }
}

/* =========================================================
   SECTIONS — shared layout
   ========================================================= */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-gap) 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 300px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dim);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
  opacity: 1;
}

/* =========================================================
   HERO
   ========================================================= */
#hero {
  min-height: calc(100vh - var(--nav-height));
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-content { flex: 1; }

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.hero-tagline {
  font-size: 1.15rem;
  color: #e2e2f0;
  font-style: italic;
  margin: 1rem 0;
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
}

.hero-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Terminal decoration */
.hero-decoration { flex: 0 0 auto; }

.terminal-window {
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.terminal-bar {
  background: #1a1e2a;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green  { background: var(--green); }

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}

.t-prompt { color: var(--accent); margin-right: 0.5rem; }
.t-output { color: var(--text-muted); padding-left: 1.1rem; }

.cursor {
  animation: blink 1.1s step-end infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 800px) {
  #hero { flex-direction: column; padding-top: 4rem; }
  .hero-decoration { display: none; }
}

/* =========================================================
   PROFILE PHOTO
   ========================================================= */
.profile-photo-wrap {
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 5px rgba(100, 255, 218, 0.08),
    0 0 24px rgba(100, 255, 218, 0.18);
  display: block;
}

@media (max-width: 750px) {
  .profile-photo-wrap {
    display: flex;
    justify-content: center;
  }
}

/* =========================================================
   ABOUT + SKILLS
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* AI Summary Card */
.ai-summary {
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  background: #161923;
  border: 1px solid #252a3a;
  border-left: 3px solid #7c3aed;
  border-radius: 6px;
  padding: 1rem 1.25rem 1.15rem;
}

.ai-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ai-header-cursor {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #7c3aed;
  animation: blink-violet 1s step-end infinite;
}

.ai-badge {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: #a78bfa;
  background: #1e1535;
  border: 1px solid #3b2272;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.07em;
}

.ai-summary-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.8;
  min-height: 1.5rem;
}

/* Loading dots */
.ai-loading {
  color: var(--text-dim);
}

.ai-dots span {
  opacity: 0;
  animation: dot-pulse 1.4s infinite;
}
.ai-dots span:nth-child(1) { animation-delay: 0.0s; }
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 60%, 100% { opacity: 0; }
  30%            { opacity: 1; }
}

/* Typewriter inline cursor */
.ai-type-cursor {
  display: inline-block;
  color: #7c3aed;
  font-family: var(--font-mono);
  margin-left: 1px;
  animation: blink-violet 0.7s step-end infinite;
}

.ai-type-cursor.done {
  animation: none;
  opacity: 0;
}

@keyframes blink-violet {
  50% { opacity: 0; }
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.skill-category h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s;
}

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

.tag.small { font-size: 0.72rem; padding: 2px 8px; }

@media (max-width: 750px) {
  .about-grid   { grid-template-columns: 1fr; }
  .skills-grid  { grid-template-columns: 1fr; }
}

/* =========================================================
   WORK EXPERIENCE
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 2rem;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  transform: translateX(1px);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.25s;
}

.timeline-content:hover {
  border-color: var(--accent);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.timeline-header h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.timeline-company {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.75rem;
}

.timeline-bullets {
  list-style: none;
  margin-bottom: 1rem;
}

.timeline-bullets li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.35rem;
}

.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 3px;
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* =========================================================
   GITHUB PROJECTS
   ========================================================= */
.projects-meta {
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.projects-loading {
  grid-column: 1/-1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.25s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  opacity: 1;
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-icon { color: var(--text-dim); font-size: 1rem; }

.project-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  line-height: 1.5;
}

.project-footer {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: auto;
}

.project-lang::before { content: '● '; color: var(--accent); }

.projects-error {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 1rem;
  border: 1px dashed #ff5f5733;
  border-radius: 6px;
}

/* =========================================================
   RESUME
   ========================================================= */
.resume-actions {
  margin-bottom: 2rem;
}

.resume-document {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem 3rem;
  max-width: 820px;
}

.resume-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.resume-header h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.resume-contact-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.resume-tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.resume-section {
  margin-bottom: 1.75rem;
}

.resume-section h2 {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}

.resume-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.resume-job { margin-bottom: 1rem; }

.resume-job-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resume-job-header strong { color: var(--text); }

.resume-job-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.resume-job em {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: normal;
}

.resume-job ul {
  list-style: none;
  margin-top: 0.5rem;
}

.resume-job ul li {
  font-size: 0.87rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.resume-job ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 3px;
}

.resume-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.resume-skills-grid strong { color: var(--text-dim); }

@media (max-width: 600px) {
  .resume-document { padding: 1.5rem; }
  .resume-skills-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact-wrapper {
  max-width: 640px;
}

.contact-intro {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateX(6px);
  opacity: 1;
}

.contact-icon {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  width: 2.5rem;
  text-align: center;
  border: 1px solid var(--border);
  padding: 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.contact-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.1rem;
  font-size: 0.95rem;
}

.contact-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* =========================================================
   CERTIFICATIONS CARD
   ========================================================= */
.certs-card {
  margin-top: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.certs-header {
  margin-bottom: 0.9rem;
}

.certs-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.certs-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.cert-dot {
  color: var(--accent);
  font-size: 0.7rem;
  margin-top: 3px;
  flex-shrink: 0;
}

.cert-name {
  display: block;
  font-size: 0.83rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.cert-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* =========================================================
   PATENTS CARD
   ========================================================= */
.patents-card {
  margin-top: 2.5rem;
  background: #110e00;
  border: 1px solid #78350f44;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.patents-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.patents-icon {
  font-size: 1rem;
  color: #f59e0b;
}

.patents-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.03em;
  flex: 1;
}

.patents-badge {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: #f59e0b;
  background: #78350f33;
  border: 1px solid #92400e66;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.07em;
}

.patents-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.patent-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.patent-item:hover { opacity: 0.75; }

.patent-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #f59e0b;
  white-space: nowrap;
  flex-shrink: 0;
}

.patent-title {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.patent-uspto {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #92400e;
  background: #78350f22;
  border: 1px solid #92400e55;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: center;
  flex-shrink: 0;
}

/* =========================================================
   NAV AI DOT
   ========================================================= */
.nav-ai-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #7c3aed;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  animation: ai-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes ai-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.6); }
}

/* =========================================================
   AI MATCH SECTION
   ========================================================= */
.ai-match-intro {
  margin-bottom: 2rem;
}

.ai-match-headline {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.ai-match-subtext {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
}

/* =========================================================
   RESUME CTA CARD
   ========================================================= */
.resume-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  max-width: 820px;
}

.resume-cta-name {
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.resume-cta-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.resume-cta-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 480px;
}

.resume-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.resume-download-btn {
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  text-align: center;
}

@media (max-width: 600px) {
  .resume-cta { flex-direction: column; padding: 1.5rem; }
  .resume-cta-actions { flex-direction: row; width: 100%; }
}

.resume-last-updated {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* =========================================================
   RECRUITER AI TOOL
   ========================================================= */
.recruiter-tool {
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-top: 2px solid #7c3aed;
  border-radius: 6px;
  padding: 1.75rem 2rem;
  background: var(--bg-card);
  max-width: 820px;
}

.recruiter-header { margin-bottom: 0; }

.recruiter-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.recruiter-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recruiter-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.recruiter-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Textarea */
.jd-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  padding: 0.75rem 1rem;
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.2s;
  outline: none;
}

.jd-textarea:focus,
.jd-textarea:focus-visible {
  border-color: #7c3aed;
  outline: none;
  box-shadow: none;
}
.jd-textarea::placeholder { color: var(--text-dim); }

.jd-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.35rem 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.jd-counter         { color: var(--text-dim); }
.jd-counter.warn    { color: var(--yellow); }
.jd-rate            { color: var(--text-dim); }
.jd-rate.depleted   { color: var(--red); }

/* Loading */
.recruiter-loading {
  padding: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Results */
.recruiter-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

@media (max-width: 700px) {
  .recruiter-results  { grid-template-columns: 1fr; }
  .recruiter-tool     { padding: 1.25rem; }
}

.result-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
}

.result-panel-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.result-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.result-panel-header .result-panel-title { margin-bottom: 0; }

/* Score ring */
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.score-ring-container {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 263.9;
  stroke-dashoffset: 263.9;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.33, 1, 0.68, 1),
              stroke 0.3s ease;
}

.score-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.score-number {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.score-unit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  align-self: flex-end;
  margin-bottom: 5px;
}

.score-details { width: 100%; }

.score-group { margin-bottom: 0.85rem; }

.score-group-label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.score-group-label.strength { color: #22c55e; }
.score-group-label.gap      { color: #f59e0b; }

.score-item {
  font-size: 0.81rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.45rem;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.score-item .bullet      { flex-shrink: 0; margin-top: 1px; }
.score-item.strength .bullet { color: #22c55e; }
.score-item.gap      .bullet { color: #f59e0b; }

/* Cover letter */
.cover-letter-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.cover-letter-body p { margin-bottom: 0.65rem; }

.cover-letter-body::-webkit-scrollbar       { width: 4px; }
.cover-letter-body::-webkit-scrollbar-track { background: transparent; }
.cover-letter-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Copy button */
.btn-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

/* Notices */
.recruiter-notice {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  color: var(--text-dim);
  padding: 0.65rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
}

/* =========================================================
   HERO JD HOOK
   ========================================================= */
.hero-jd-hook {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s;
}

/* Blinking cursor prefix */
.hero-jd-hook::before {
  content: '▊';
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
  font-size: 0.72rem;
}

/* Trailing arrow — shifts right on hover */
.hero-jd-hook::after {
  content: '→';
  display: inline-block;
  color: var(--accent);
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s;
}

.hero-jd-hook:hover {
  color: var(--text);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-dim);
}

.hero-jd-hook:hover::after {
  transform: translateX(5px);
  opacity: 1;
}

/* =========================================================
   FLOATING AI MATCH BUTTON
   ========================================================= */
.fab-match {
  display: none; /* mobile-only, shown via media query below */
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--bg);
  background: var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(100, 255, 218, 0.35);
  animation: fab-glow 2.4s ease-in-out infinite;
  transition: opacity 0.3s, transform 0.3s;
}

.fab-match:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(100, 255, 218, 0.55);
}

.fab-match.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

@keyframes fab-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(100, 255, 218, 0.35); }
  50%       { box-shadow: 0 0 24px rgba(100, 255, 218, 0.6);  }
}

@media (max-width: 700px) {
  .fab-match {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.45rem 0.85rem;
    bottom: 1.25rem;
    right: 1rem;
  }
}

/* =========================================================
   SCROLL ANIMATIONS
   ========================================================= */

/* Base fade-up */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skill tags — scale pop */
.tag {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.3s ease, transform 0.3s ease,
              border-color 0.2s, color 0.2s;
}
.tag.visible {
  opacity: 1;
  transform: scale(1);
}

/* Section headers slide in from left */
.section-header {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.section-header.visible {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   SKIP LINK — screen readers / keyboard users
   ========================================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* =========================================================
   FOCUS VISIBLE — keyboard navigation outlines
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =========================================================
   INLINE TEXT BUTTON (retry, etc.)
   ========================================================= */
.btn-text-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.btn-text-link:hover { opacity: 0.75; }

/* =========================================================
   MOBILE NAV — animated open/close
   ========================================================= */
@media (max-width: 700px) {
  .nav-links {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease, padding 0.28s ease;
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    gap: 1rem;
  }
  .nav-links.open {
    max-height: 320px;
    padding: 1rem 2rem;
  }
}

/* =========================================================
   PREFERS-REDUCED-MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in,
  .section-header,
  .tag {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Featured work card ── */
.featured-card {
  margin-top: 2.5rem;
  background: rgba(100, 255, 218, 0.04);
  border: 1px solid rgba(100, 255, 218, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

body.light-mode .featured-card {
  background: rgba(91, 33, 182, 0.05);
  border: 1px solid rgba(91, 33, 182, 0.18);
  border-left: 3px solid var(--accent);
}

.featured-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.featured-icon { font-size: 1rem; color: var(--accent); }

.featured-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  flex: 1;
}

.featured-badge {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--accent);
  background: rgba(100, 255, 218, 0.08);
  border: 1px solid rgba(100, 255, 218, 0.25);
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.07em;
}

body.light-mode .featured-badge {
  background: rgba(91, 33, 182, 0.08);
  border: 1px solid rgba(91, 33, 182, 0.25);
}

.featured-tagline { font-size: 0.78rem; margin-bottom: 0.7rem; }

.featured-points { list-style: none; padding: 0; margin: 0; }

.featured-points li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding: 0.25rem 0;
  display: flex;
  gap: 0.55rem;
}

.featured-dot { flex-shrink: 0; }

/* ── About meta grid (Certs + Languages, side by side) ── */
.about-meta-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.about-meta-grid .certs-card {
  margin-top: 0;
}

@media (max-width: 720px) {
  .about-meta-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ── Card hover polish ── */
.featured-card,
.patents-card,
.certs-card,
.contact-card,
.project-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover,
.certs-card:hover,
.contact-card:hover,
.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(100, 255, 218, 0.4);
  box-shadow: 0 8px 24px rgba(100, 255, 218, 0.08);
}

body.light-mode .featured-card:hover,
body.light-mode .certs-card:hover,
body.light-mode .contact-card:hover,
body.light-mode .project-card:hover {
  border-color: rgba(91, 33, 182, 0.4);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.12);
}

.patents-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
  border-color: #92400e88;
}

.patent-item,
.cert-item {
  transition: transform 0.18s ease, background 0.18s ease;
}

.patent-item:hover {
  transform: translateX(3px);
  background: rgba(245, 158, 11, 0.06);
}

.cert-item:hover {
  background: rgba(100, 255, 218, 0.04);
  border-radius: 4px;
}

body.light-mode .cert-item:hover {
  background: rgba(91, 33, 182, 0.05);
}

/* ── Back-to-top ── */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  left: 1.75rem;
  z-index: 200;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s, border-color 0.2s;
}

.back-to-top.visible {
  opacity: 0.85;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

@media (max-width: 700px) {
  .back-to-top {
    bottom: 1.25rem;
    left: 1rem;
    width: 34px;
    height: 34px;
  }
}

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--bg);
  background: var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}