/* ==========================================================================
   fud0dev — "Ink on Paper" — Dark Minimal Editorial
   Ultra-clean, typographic-first portfolio design
   ========================================================================== */

/* --- Google Fonts: Geist (via Fontsource CDN alternative) --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Colors */
  --bg:           #0A0A0A;
  --surface:      #111111;
  --surface-2:    #1C1C1C;
  --border:       #242424;
  --border-hover: rgba(255, 107, 43, 0.5);

  --accent:       #FF6B2B;
  --accent-dim:   rgba(255, 107, 43, 0.10);
  --accent-glow:  rgba(255, 107, 43, 0.25);

  --text:         #F5F5F5;
  --text-muted:   #737373;
  --text-dim:     #3A3A3A;
  --text-inv:     #0A0A0A;

  /* Typography */
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'DM Mono', 'JetBrains Mono', monospace;

  /* Spacing */
  --max-w:        1140px;
  --section-gap:  9rem;
  --card-radius:  12px;
  --pill-radius:  9999px;

  /* Motion */
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:       0.15s;
  --t-med:        0.3s;
  --t-slow:       0.6s;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   3. UTILITY
   ========================================================================== */
.accent { color: var(--accent); }
.mono   { font-family: var(--font-mono); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 10, 10, 0.85);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--t-med);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Brand */
.brand {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0;
}

.brand span {
  color: var(--accent);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--t-fast);
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--text);
}

/* Nav right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--pill-radius);
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: #4ade80;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 5px #4ade80;
  animation: blink 2.5s infinite;
}

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

.github-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.github-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.github-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */
.hero {
  padding: 8.5rem 0 0;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero-content {
  max-width: 760px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(3.2rem, 6.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 1.75rem;
}

.hero-title .line-accent {
  color: var(--accent);
  display: block;
}

.hero-title .line-muted {
  color: var(--text-muted);
  font-weight: 300;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 2.75rem;
  font-weight: 400;
}

.hero-desc strong {
  color: var(--text);
  font-weight: 500;
}

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

/* Hero Avatar */
.hero-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.hero-avatar-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 60%);
  position: relative;
}

.hero-avatar-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  filter: drop-shadow(0 0 24px rgba(255, 107, 43, 0.18));
}

/* Stats bar */
.hero-stats {
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  background: rgba(17, 17, 17, 0.4);
}

.stats-row {
  display: flex;
  align-items: center;
  padding: 2rem 0;
  gap: 0;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 2rem;
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* Hero background dot */
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,43,0.06) 0%, transparent 65%);
  pointer-events: none;
}

/* Case Study */
.case-study-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.55rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all var(--t-med) var(--ease);
  font-family: var(--font-sans);
}

.case-study-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.case-study-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.case-study-toggle i {
  width: 14px;
  height: 14px;
}

.cs-chevron {
  margin-left: auto;
  transition: transform var(--t-med) var(--ease);
}

.case-study-toggle[aria-expanded="true"] .cs-chevron {
  transform: rotate(180deg);
}

.case-study-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  animation: cs-open var(--t-med) var(--ease);
}

@keyframes cs-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cs-section {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cs-section:last-child {
  border-bottom: none;
}

.cs-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.cs-text {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.cs-text strong {
  color: var(--text);
  font-weight: 500;
}



/* ==========================================================================
   7. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--card-radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--t-med) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

.btn svg, .btn i {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inv);
  font-weight: 600;
}

.btn-primary:hover {
  background: #ff7d45;
  box-shadow: 0 0 0 4px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 0.75rem 1rem;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

/* ==========================================================================
   8. SECTION HEADER
   ========================================================================== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
}

/* ==========================================================================
   9. SKILLS SECTION
   ========================================================================== */
.skills-section .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6rem;
  align-items: start;
}

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

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.skill-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.skill-bar-track {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0;
  transition: width 1s var(--ease);
}

.skill-bar-fill.animated {
  /* Width set via inline style */
}

/* ==========================================================================
   10. PROJECTS SECTION
   ========================================================================== */
.projects-section .section-header {
  margin-bottom: 3.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

/* Full-width card for third item */
.projects-grid .project-card:nth-child(3) {
  grid-column: 1 / -1;
}

.project-card {
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background var(--t-med);
}

.project-card:hover {
  background: var(--surface);
}

.project-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

/* Full-width card image is shorter */
.project-card:nth-child(3) .project-card-img-wrap {
  aspect-ratio: 21 / 7;
}

.project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease), filter var(--t-med);
  filter: brightness(0.85) saturate(0.9);
}

.project-card:hover .project-card-img {
  transform: scale(1.04);
  filter: brightness(0.7) saturate(0.7);
}

/* Hover overlay */
.project-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-med);
  background: rgba(10, 10, 10, 0.5);
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  background: var(--accent);
  color: var(--text-inv);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--card-radius);
  transform: translateY(6px);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med);
}

.project-card:hover .project-overlay-btn {
  transform: translateY(0);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.project-card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: border-color var(--t-fast), color var(--t-fast);
}

.project-card:hover .tag {
  border-color: var(--border);
  color: var(--text-muted);
}

/* ==========================================================================
   11. PYTHON LAB / METHODOLOGY (Horizontal steps)
   ========================================================================== */
.lab-section .section-header {
  margin-bottom: 4rem;
}

.lab-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

/* Connecting line */
.lab-steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 2.5%;
  right: 2.5%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 15%, var(--border) 85%, transparent);
}

.lab-step {
  padding: 0 2rem 0 0;
  position: relative;
}

.lab-step-num-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.lab-step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: border-color var(--t-med), color var(--t-med);
}

.lab-step:hover .lab-step-num {
  border-color: var(--accent);
  color: var(--accent);
}

.lab-step-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.lab-step-icon svg {
  width: 16px;
  height: 16px;
}

.lab-step-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.lab-step-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.lab-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ==========================================================================
   12. TIMELINE SECTION
   ========================================================================== */
.timeline-section .section-header {
  margin-bottom: 4rem;
}

.timeline {
  position: relative;
  max-width: 720px;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 11px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  padding-bottom: 3.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.5rem;
  align-items: start;
}

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

/* Orange dot */
.timeline-dot {
  position: absolute;
  left: 5px;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  transition: border-color var(--t-med), background var(--t-med);
}

.timeline-item:hover .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding-top: 0.05rem;
  white-space: nowrap;
  min-width: 42px;
}

.timeline-content {
  padding-bottom: 0;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.timeline-org {
  font-size: 0.825rem;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 0.6rem;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ==========================================================================
   12b. FAQ SECTION
   ========================================================================== */
.faq-section {
  border-top: 1px solid var(--border);
}

.faq-section .section-header {
  margin-bottom: 3.5rem;
}

.faq-accordion {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: border-color var(--t-med), background var(--t-med);
}

.faq-item:hover {
  border-color: rgba(255, 107, 43, 0.35);
}

.faq-item.active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: left;
  cursor: pointer;
  transition: color var(--t-fast);
}

.faq-question:hover {
  color: var(--accent);
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform var(--t-med) var(--ease), color var(--t-med);
}

.faq-question[aria-expanded="true"] .faq-icon,
.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  padding: 0 1.5rem 1.35rem;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.75;
  animation: faq-reveal var(--t-med) var(--ease);
}

@keyframes faq-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.faq-answer strong {
  color: var(--text);
  font-weight: 500;
}

/* ==========================================================================
   13. CONTACT SECTION
   ========================================================================== */
.contact-section {
  border-top: 1px solid var(--border);
}

.contact-section .container {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.contact-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.contact-label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.contact-title {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.contact-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.contact-sub strong {
  color: var(--text);
  font-weight: 500;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* Right side: email display */
.contact-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.contact-email-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.contact-email-display {
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
  transition: border-color var(--t-med);
}

.contact-email-display:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-footer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.footer-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

/* ==========================================================================
   13b. CONTACT FORM
   ========================================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--t-med), box-shadow var(--t-med);
  width: 100%;
  resize: none;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input.error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.form-textarea {
  min-height: 130px;
  line-height: 1.6;
}

.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
  position: relative;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Spinner on submit */
.form-submit.loading .btn-send-icon {
  display: none;
}

.form-submit .spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.form-submit.loading .spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Feedback message */
.form-feedback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.form-feedback-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.form-feedback.error .form-feedback-dot {
  background: #f87171;
}

.form-privacy-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: -0.25rem;
}

.form-privacy-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Site footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-brand span {
  color: var(--accent);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--t-fast);
}

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

.footer-copy {
  font-size: 0.775rem;
  color: var(--text-dim);
}

/* ==========================================================================
   13c. LEGAL PAGE STYLES
   ========================================================================== */
.legal-page {
  padding: 8rem 0 5rem;
  min-height: 85vh;
}

.legal-article {
  max-width: 800px;
  margin: 0 auto;
}

.legal-header {
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.legal-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.legal-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.legal-subtitle {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-section p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.legal-section strong {
  color: var(--text);
  font-weight: 500;
}

.legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 0;
}

.legal-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  position: relative;
  padding-left: 1.25rem;
}

.legal-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.5;
}

.legal-back-cta {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   14. TOAST
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 400;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

/* ==========================================================================
   15. MOBILE NAVIGATION & RESPONSIVE
   ========================================================================== */

/* Mobile menu toggle & drawer */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.mobile-menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-btn i,
.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
}

.mobile-menu-btn #menu-icon-close,
.mobile-menu-btn svg:last-child {
  display: none;
}

.mobile-menu-btn.active #menu-icon-open,
.mobile-menu-btn.active svg:first-child {
  display: none !important;
}

.mobile-menu-btn.active #menu-icon-close,
.mobile-menu-btn.active svg:last-child {
  display: block !important;
}

.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-med) var(--ease);
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color var(--t-fast), padding-left var(--t-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  color: var(--accent);
  padding-left: 0.5rem;
}

/* Tablet Breakpoint (1024px) */
@media (max-width: 1024px) {
  .skills-section .container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-section .container {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .hero-avatar-ring {
    width: 160px;
    height: 160px;
  }
}

/* Mobile & Tablet Breakpoint (768px) */
@media (max-width: 768px) {
  :root {
    --section-gap: 5rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  /* Navigation */
  .nav-links {
    display: none;
  }

  .mobile-menu-btn,
  .mobile-nav-drawer {
    display: flex;
  }

  .nav-inner {
    padding: 0 1.25rem;
  }

  /* Hero */
  .hero {
    padding: 6.5rem 0 3rem;
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: left;
  }

  .hero-avatar-wrap {
    order: -1;
    align-self: flex-start;
  }

  .hero-avatar-ring {
    width: 110px;
    height: 110px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 7.5vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
  }

  .hero-desc {
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 2rem;
  }

  .hero-cta {
    gap: 0.75rem;
  }

  .hero-stats {
    margin-top: 2.5rem;
  }

  /* Stats row as 2x2 grid */
  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
    padding: 1.5rem 0;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    padding: 0;
  }

  .stat-num {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

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

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid .project-card:nth-child(3) {
    grid-column: 1;
  }

  .project-card:nth-child(3) .project-card-img-wrap {
    aspect-ratio: 16 / 9;
  }

  /* On mobile touch, make project action visible and comfortable */
  .project-card-overlay {
    background: rgba(10, 10, 10, 0.3);
    opacity: 1;
    position: relative;
    inset: auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
  }

  .project-overlay-btn {
    transform: none;
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
  }

  .project-card:hover .project-card-img {
    transform: none;
  }

  /* Python Lab Steps */
  .lab-steps {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .lab-steps::before {
    display: none;
  }

  .lab-step {
    padding: 0;
  }

  /* Timeline */
  .timeline::before {
    left: 8px;
  }

  .timeline-dot {
    left: 2px;
    top: 4px;
    width: 13px;
    height: 13px;
  }

  .timeline-item {
    padding-left: 2.25rem;
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding-bottom: 2.25rem;
  }

  .timeline-year {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.2rem;
  }

  /* FAQ Mobile */
  .faq-section .section-header {
    margin-bottom: 2.5rem;
  }

  .faq-question {
    padding: 1.1rem 1.25rem;
    font-size: 0.95rem;
    gap: 0.75rem;
  }

  .faq-answer {
    padding: 0 1.25rem 1.15rem;
    font-size: 0.875rem;
  }

  /* Contact Section */
  .contact-section .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
  }

  /* Toast Notification */
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1.25rem;
    justify-content: center;
  }

  /* Footer */
  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Small Phones (< 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-actions {
    flex-direction: column;
    width: 100%;
  }

  .contact-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .status-pill span:not(.status-dot) {
    font-size: 0.65rem;
  }
}