/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #111118;
  --border-color: #2a2a3a;
  --border-hover: #3a3a4f;

  --text-primary: #e8e8ef;
  --text-secondary: #9898ab;
  --text-muted: #6a6a80;
  --text-heading: #ffffff;

  --accent: #6c5ce7;
  --accent-hover: #7f71eb;
  --accent-glow: #6c5ce740;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --nav-height: 64px;
  --max-width: 1100px;
  --section-padding: 80px 0;
  --card-radius: 12px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ========================================
   Circuit Background Animation
   ======================================== */
#circuit-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Push all content above the canvas */
.site-nav { z-index: 1000; }
main { position: relative; z-index: 1; }
.site-footer { position: relative; z-index: 1; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ========================================
   Custom Scrollbar
   ======================================== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

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

ul, ol {
  list-style: none;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 12px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ========================================
   Layout
   ======================================== */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding);
}

/* ========================================
   Navigation
   ======================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.site-nav.scrolled {
  border-bottom-color: var(--border-color);
  background: rgba(10, 10, 15, 0.95);
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

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

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

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

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

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: background var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: transform var(--transition-base);
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle.open .hamburger {
  background: transparent;
}

.nav-toggle.open .hamburger::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .hamburger::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 24px;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.hero-content {
  flex: 1 1 0%;
  min-width: 0;
}

.hero-image {
  flex: 0 0 400px;
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  animation: heroFadeIn 0.6s ease 0.1s forwards;
}

.hero-image img {
  position: relative;
  top: -10px;
  right: -10px;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
}

/* Hero entrance animation */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-greeting,
.hero-name,
.hero-role,
.hero-tagline,
.hero-cta {
  animation: heroFadeIn 0.6s ease forwards;
}

.hero-greeting { animation-delay: 0.1s; opacity: 0; }
.hero-name { animation-delay: 0.2s; opacity: 0; }
.hero-role { animation-delay: 0.3s; opacity: 0; }
.hero-tagline { animation-delay: 0.4s; opacity: 0; }
.hero-cta { animation-delay: 0.5s; opacity: 0; }

.hero-greeting {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 4px;
}

.hero-role {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

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

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ========================================
   About
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}

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

.about-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 24px;
}

.detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-item:first-child {
  padding-top: 0;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ========================================
   Project Cards
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: inherit;
}

.card-preview {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.card-preview-icon {
  font-size: 2.5rem;
  font-weight: 800;
  opacity: 0.6;
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.card-tagline {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.tag-sm {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  transition: color var(--transition-fast);
}

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

/* ========================================
   Skills
   ======================================== */
.skills-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 32px;
  align-items: center;
}

.skill-section-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
}

.skill-section-title i {
  width: 1.2em;
  text-align: center;
  margin-right: 0.25em;
  color: var(--accent);
}

.skill-section-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

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

.skill-tag {
  font-size: 0.85rem;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

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

/* ========================================
   AI & Machine Learning
   ======================================== */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ai-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.ai-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), #00b894);
}

.ai-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-heading);
}

.ai-group-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ai-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-item {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color var(--transition-fast);
}

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

.ai-item-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ai-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* AI LLM Tabs */
.ai-llm-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.ai-llm-tab {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--transition-fast);
}

.ai-llm-tab:hover {
  border-color: var(--accent);
}

.ai-llm-tab-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ai-llm-tab-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* AI Prose Paragraphs */
.ai-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ai-paragraph-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.ai-paragraph-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.ai-paragraph-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========================================
   User Experience
   ======================================== */
.ux-intro {
  /* max-width: 720px; */
  margin-bottom: 32px;
}

.ux-intro p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.ux-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ux-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 28px 24px;
  transition: all var(--transition-base);
}

.ux-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.ux-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ux-card-icon {
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.ux-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.ux-card-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ========================================
   Job History Timeline
   ======================================== */
.history-timeline {
  position: relative;
  padding-left: 32px;
}

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

.history-item {
  position: relative;
  padding-bottom: 36px;
}

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

.history-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
}

.history-item:first-child .history-marker {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.history-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 24px 28px;
  transition: border-color var(--transition-base);
}

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

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.history-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.history-company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.history-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 2px;
}

.history-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

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

/* ========================================
   Contact Form
   ======================================== */
.contact-form {
  max-width: 640px;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

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

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

.form-input.error {
  border-color: #e74c3c;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  display: block;
  font-size: 0.78rem;
  color: #e74c3c;
  margin-top: 4px;
  min-height: 18px;
}

.btn-submit {
  margin-top: 4px;
  width: auto;
}

/* ========================================
   Project Detail Page
   ======================================== */
.project-hero {
  padding: calc(var(--nav-height) + 48px) 0 48px;
  border-bottom: 1px solid var(--border-color);
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color var(--transition-fast);
}

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

.project-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.project-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 20px;
  max-width: 600px;
}

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

.project-detail {
  padding: 48px 0 80px;
}

.project-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 48px;
  align-items: start;
}

.project-description p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.project-section-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  margin-top: 32px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-item {
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.feature-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--project-accent, var(--accent));
}

.project-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.project-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.project-screenshot {
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}

.screenshot-icon {
  font-size: 3rem;
  font-weight: 800;
}

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

.project-meta {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 20px;
}

.meta-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

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

/* ========================================
   Footer
   ======================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

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

/* ========================================
   Error Page
   ======================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.error-status {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.error-message {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* ========================================
   Reveal Animations
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* stagger children slightly */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal:nth-child(6) { transition-delay: 0.4s; }

/* ========================================
   Responsive — Tablet
   ======================================== */
@media (max-width: 1024px) {
  .hero-image {
    flex: 0 0 400px;
    max-width: 400px;
  }

  .hero-image img {
    top: 0px;
    right: 0;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }

  .ai-llm-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .ux-principles {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .project-screenshot {
    margin-bottom: 0;
  }
}

/* ========================================
   Responsive — Mobile
   ======================================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 56px 0;
    --nav-height: 56px;
  }

  /* Mobile nav */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 0;
    transform: translateX(100%);
    transition: transform var(--transition-base);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    padding: 14px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-link::after {
    display: none;
  }

  /* Layout adjustments */
  .hero-inner {
    flex-direction: column-reverse;
    gap: 24px;
    position: relative;
    top: -50px;
  }

  .hero-image {
    flex: 0 0 auto;
    max-width: 75%;
    width: 75%;
  }

  .hero-image img {
    margin-bottom: 30px;
    top: 0px;
    right: 0px;
  }

  .hero-name {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .skill-section {
    padding: 20px;
    gap: 16px;
  }

  .ai-llm-tabs {
    grid-template-columns: 1fr;
  }

  .ux-principles {
    grid-template-columns: 1fr;
  }

  .history-header {
    flex-direction: column;
    gap: 4px;
  }

  .history-content {
    padding: 20px;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .project-sidebar {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.6rem;
  }
}

/* ========================================
   Mobile Nav Overlay
   ======================================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
