:root {
  --bg: #07111f;
  --bg-alt: #0e1a31;
  --panel: rgba(10, 18, 34, 0.72);
  --panel-strong: rgba(14, 24, 45, 0.92);
  --text: #eef3ff;
  --muted: #a7b3cf;
  --line: rgba(168, 188, 255, 0.16);
  --accent: #f0b35f;
  --accent-2: #88c8ff;
  --shadow: 0 24px 80px rgba(2, 8, 20, 0.45);
  --radius: 24px;
  --radius-sm: 16px;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(116, 184, 255, 0.22), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(255, 180, 84, 0.16), transparent 22%),
    radial-gradient(circle at 50% 78%, rgba(116, 184, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #050b15 0%, var(--bg) 55%, #050b15 100%);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button, input, textarea { font: inherit; }

html {
  scrollbar-gutter: stable;
}

.site-shell { position: relative; min-height: 100vh; }
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.navbar,
main,
.footer,
.chat-launcher,
.chatbot { position: relative; z-index: 1; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: rgba(5, 11, 21, 0.9);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(2, 8, 20, 0.22);
}

.brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.nav-home {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 180, 84, 0.26);
  background: rgba(255, 180, 84, 0.08);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.nav-links {
  justify-self: center;
  display: flex;
  gap: 0.95rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.2s ease;
  padding: 0.2rem 0;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-home:hover,
.nav-home:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible { color: var(--text); transform: translateY(-1px); }

.nav-mobile-cta {
  display: none;
}

.nav-cta,
.button,
.project-link,
.chatbot-actions button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-cta {
  padding: 0.95rem 1.2rem;
  background: linear-gradient(135deg, #f0b35f, #f8d9a4);
  color: #1c1408;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(240, 179, 95, 0.28);
}

.nav-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem;
  justify-self: end;
}
.nav-toggle span { display: block; height: 2px; margin: 4px 0; background: var(--text); border-radius: 99px; }

main { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }

section {
  position: relative;
  scroll-margin-top: 110px;
}

.section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 184, 255, 0.22), rgba(255, 180, 84, 0.12), transparent);
}

.hero {
  padding: clamp(4rem, 8vw, 7rem) 0 2rem;
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(6px);
}
.hero::before {
  width: 26rem;
  height: 26rem;
  top: -8rem;
  right: -6rem;
  background: radial-gradient(circle, rgba(116, 184, 255, 0.14), transparent 68%);
}
.hero::after {
  width: 18rem;
  height: 18rem;
  left: -4rem;
  bottom: 4rem;
  background: radial-gradient(circle, rgba(255, 180, 84, 0.12), transparent 68%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 1.8rem; align-items: center; position: relative; z-index: 1; }
.hero-copy h1,
.section-heading h2,
.glass-card h3,
.project-card h3,
.cert-card h3,
.experience-card h3,
.blog-card h3 {
  font-family: var(--font-head);
}

.eyebrow,
.project-tag,
.card-label,
.section-heading span {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-2);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 1rem 0 0.6rem;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #eaf3ff 42%, #f0b35f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  margin: 0;
  color: #f7cf8b;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.typewriter-wrap {
  min-height: 3rem;
  margin-top: 1rem;
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  color: var(--text);
}

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

.hero-text,
.glass-card p,
.timeline-item p,
.service-card p,
.project-card p,
.cert-card p,
.experience-card p,
.blog-card p,
.contact-card p,
.footer p,
.chatbot-message,
.chatbot-response,
.contact-list li {
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions,
.hero-badges,
.about-grid,
.skill-grid,
.service-grid,
.project-grid,
.stats-grid,
.cert-grid,
.experience-grid,
.blog-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

.hero-actions { grid-template-columns: repeat(3, minmax(0, max-content)); margin: 2rem 0 1.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 1.35rem; font-weight: 800; }
.button-primary { background: linear-gradient(135deg, #f0b35f, #fbe0b1); color: #160f05; box-shadow: 0 18px 40px rgba(240, 179, 95, 0.28); }
.button-secondary { background: rgba(136, 200, 255, 0.14); color: var(--text); border: 1px solid rgba(136, 200, 255, 0.3); }
.button-ghost { background: rgba(255, 255, 255, 0.03); color: var(--text); border: 1px solid var(--line); }
.button:hover,
.button:focus-visible,
.project-link:hover,
.project-link:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible,
.chatbot-actions button:hover,
.chatbot-actions button:focus-visible { transform: translateY(-2px); }

.hero-badges { grid-template-columns: repeat(4, minmax(0, max-content)); margin-top: 1rem; }
.hero-badges span {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-weight: 700;
}

.hero-card,
.glass-card,
.testimonial-shell,
.contact-form,
.contact-card {
  background:
    radial-gradient(circle at top right, rgba(116, 184, 255, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(18, 29, 52, 0.92), rgba(8, 14, 27, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  backface-visibility: hidden;
  transform: translateZ(0);
}

.glass-card:hover,
.service-card:hover,
.project-card:hover,
.stat-card:hover,
.cert-card:hover,
.experience-card:hover,
.blog-card:hover {
  transform: translateY(-7px);
  border-color: rgba(116, 184, 255, 0.32);
  box-shadow: 0 34px 84px rgba(2, 8, 20, 0.55);
}

.hero-card {
  padding: 1rem;
  border-radius: calc(var(--radius) + 8px);
  display: grid;
  gap: 1rem;
  max-width: 440px;
  justify-self: end;
  position: relative;
  will-change: transform;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(116, 184, 255, 0.35), rgba(255, 180, 84, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.hero-photo { border-radius: calc(var(--radius) - 6px); overflow: hidden; min-height: 360px; aspect-ratio: 4 / 5; background: #0a1324; }
.hero-photo img {
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.05) contrast(1.03);
}
.hero-card-info { display: grid; gap: 0.8rem; }
.hero-card-info h2 { margin: 0.2rem 0 0; font-family: var(--font-head); font-size: 1.6rem; }
.hero-card-info ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.hero-card-info li { color: var(--text); display: flex; align-items: center; gap: 0.6rem; }
.hero-card-info i { color: var(--accent); }

.section { padding: clamp(4rem, 7vw, 6rem) 0 0; }
.section-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.1rem); }

.section-heading span {
  color: var(--accent);
  border-color: rgba(255, 180, 84, 0.22);
  background: rgba(255, 180, 84, 0.08);
}

.about-grid,
.skill-grid,
.service-grid,
.project-grid,
.cert-grid,
.experience-grid,
.blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contact-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; }

.glass-card {
  border-radius: var(--radius);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(116, 184, 255, 0.12), rgba(255, 180, 84, 0.1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-card::after,
.hero-card::after,
.testimonial-shell::after,
.contact-form::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 35%); pointer-events: none; }

.timeline { display: grid; gap: 1rem; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(116, 184, 255, 0.7), transparent);
}
.timeline-item {
  position: relative;
  margin-left: 2.5rem;
  padding: 1.3rem 1.3rem 1.3rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 1.35rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 180, 84, 0.15);
}
.timeline-item span { color: var(--accent-2); font-weight: 800; font-size: 0.85rem; }
.timeline-item h3 { margin: 0.45rem 0; }

.skill-card i,
.service-card i { color: var(--accent); font-size: 1.45rem; margin-bottom: 0.9rem; }
.progress-grid { display: grid; gap: 0.9rem; margin-top: 1.4rem; }
.progress-item span { display: block; margin-bottom: 0.45rem; font-weight: 700; }
.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 1.2s ease;
}

.project-card { padding: 0; overflow: hidden; }
.project-card img { height: 220px; object-fit: cover; filter: saturate(1.03) contrast(1.04); }
.project-card-network img {
  height: 240px;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(8, 17, 33, 0.96), rgba(12, 24, 45, 0.96));
  padding: 1rem;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  z-index: 1;
}
.project-body { padding: 1.2rem 1.2rem 1.35rem; }
.project-body h3 { margin: 0.25rem 0 0.75rem; font-size: 1.28rem; }
.project-meta { display: grid; gap: 0.4rem; margin: 1rem 0; font-size: 0.94rem; }
.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.15rem;
  background: rgba(116, 184, 255, 0.14);
  border: 1px solid rgba(116, 184, 255, 0.3);
  color: var(--text);
}

.project-card,
.service-card,
.stat-card,
.cert-card,
.experience-card,
.blog-card {
  will-change: transform;
}

.project-link:hover {
  background: rgba(116, 184, 255, 0.2);
}

.project-tag {
  color: var(--accent);
  border-color: rgba(255, 180, 84, 0.2);
  background: rgba(255, 180, 84, 0.08);
}

.stat-card,
.cert-card,
.experience-card,
.blog-card { min-height: 170px; }
.stat-card { display: grid; gap: 0.35rem; align-content: start; }
.stat-card strong { font-size: 3rem; font-family: var(--font-head); color: var(--accent); }

.cert-card span,
.project-tag,
.card-label { margin-bottom: 0.8rem; }
.cert-card small { color: var(--accent-2); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.testimonial-shell { border-radius: calc(var(--radius) + 8px); padding: 1.4rem; position: relative; overflow: hidden; }
.testimonial-track { display: flex; transition: transform 0.45s ease; }
.testimonial-slide { min-width: 100%; padding: 0.5rem 0.3rem 1rem; }
.testimonial-slide p { font-size: 1.05rem; }
.testimonial-slide strong { display: block; margin-top: 1rem; color: var(--accent); }
.testimonial-dots { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.8rem; }
.testimonial-dots button {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.24);
}
.testimonial-dots button.active { background: var(--accent); }

.contact-grid { margin-top: 1rem; }
.contact-list { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.8rem; }
.contact-list li { display: flex; align-items: center; gap: 0.7rem; }
.contact-list i { color: var(--accent); width: 1.2rem; }

.contact-form { border-radius: calc(var(--radius) + 8px); padding: 1.4rem; display: grid; gap: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contact-form label { display: grid; gap: 0.45rem; color: var(--text); font-weight: 700; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(255, 180, 84, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.12);
}
.contact-form button { justify-self: start; }
.hidden-field { position: absolute; left: -9999px; }
.form-status { min-height: 1.2rem; margin: 0; }

.footer {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 2.8rem;
  border-top: 1px solid rgba(168, 188, 255, 0.12);
  text-align: center;
  color: var(--muted);
}

.chat-launcher {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 3.8rem;
  height: 3.8rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ffd59c);
  color: #150f05;
  font-size: 1.4rem;
  box-shadow: 0 16px 40px rgba(255, 180, 84, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-launcher:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 20px 50px rgba(255, 180, 84, 0.4);
}

.chatbot {
  position: fixed;
  right: 1.2rem;
  bottom: 5.6rem;
  width: min(400px, calc(100vw - 2.4rem));
  padding: 1.2rem;
  border-radius: 24px;
  background: rgba(10, 18, 34, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(116, 184, 255, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 1.2rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s;
  z-index: 999999 !important;
}
.chatbot.open { 
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbot-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.chatbot-header div { display: grid; gap: 0.2rem; }
.chatbot-header p { margin: 0; color: var(--accent-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; }
.chatbot-header strong { font-family: var(--font-head); font-size: 1.2rem; color: #fff; }
.chatbot-header button { 
  width: 2.4rem; 
  height: 2.4rem; 
  border: none; 
  border-radius: 50%; 
  background: rgba(255, 255, 255, 0.05); 
  color: var(--muted); 
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.chatbot-header button:hover {
  background: rgba(255, 84, 84, 0.2);
  color: #ff6b6b;
  transform: scale(1.1);
}

.chatbot-body {
  display: grid;
  gap: 0.8rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.chatbot-body::-webkit-scrollbar { width: 4px; }
.chatbot-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }

.chatbot-message {
  display: inline-flex;
  max-width: 88%;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: messageSlide 0.3s ease-out forwards;
}
@keyframes messageSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-message.bot {
  background: linear-gradient(135deg, rgba(116, 184, 255, 0.15), rgba(116, 184, 255, 0.05));
  color: #eaf3ff;
  border: 1px solid rgba(116, 184, 255, 0.25);
  border-bottom-left-radius: 4px;
  justify-self: start;
}

.chatbot-message.user {
  background: linear-gradient(135deg, var(--accent), #ffd59c);
  color: #120c04;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  justify-self: end;
}

.chatbot-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chatbot-actions button { 
  flex: 1 1 auto;
  padding: 0.6rem 0.8rem; 
  border: 1px solid rgba(255, 255, 255, 0.1); 
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); 
  color: var(--text); 
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chatbot-actions button:hover {
  background: rgba(116, 184, 255, 0.15);
  border-color: rgba(116, 184, 255, 0.4);
  transform: translateY(-2px);
}

.chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}
.chatbot-form input {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 0.9rem 1.1rem;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.chatbot-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 179, 95, 0.2);
  outline: none;
}
.chatbot-form button {
  border-radius: 14px;
  padding: 0 1.2rem;
  background: linear-gradient(135deg, var(--accent), #ffd59c);
  color: #150f05;
  border: none;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chatbot-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(240, 179, 95, 0.3);
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal { transition-delay: var(--reveal-delay, 0ms); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.hidden { display: none !important; }

@media (max-width: 1024px) {
  .hero-grid,
  .contact-grid,
  .about-grid,
  .skill-grid,
  .service-grid,
  .project-grid,
  .cert-grid,
  .experience-grid,
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { align-items: start; }
  .hero-card { max-width: 100%; justify-self: stretch; }
  .hero-photo { min-height: 320px; }
  .section {
    contain-intrinsic-size: 1px 760px;
  }
}

@media (max-width: 768px) {
  .navbar { grid-template-columns: auto auto auto; }
  .nav-home { display: none; }
  .nav-links {
    position: absolute;
    left: auto;
    right: 0.75rem;
    top: 100%;
    margin-top: 0.45rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    gap: 0.14rem;
    width: min(272px, calc(100vw - 1rem));
    border-radius: 18px;
    padding: 0.55rem;
    background: rgba(5, 11, 21, 0.98);
    border-color: rgba(116, 184, 255, 0.16);
    box-shadow: 0 18px 38px rgba(2, 8, 20, 0.4);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-mobile-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.88rem 0.95rem;
    margin-top: 0.28rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0b35f 0%, #ffe6bd 100%);
    color: #120c04 !important;
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    text-align: center;
    box-shadow: 0 12px 24px rgba(240, 179, 95, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }
  .nav-links a {
    width: 100%;
    padding: 0.56rem 0.78rem;
    border-radius: 11px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
  }
  .nav-links a[href="#hero"] {
    background: rgba(136, 200, 255, 0.16);
    border: 1px solid rgba(136, 200, 255, 0.22);
    font-weight: 800;
  }
  .nav-links a[href="#contact"] {
    background: rgba(240, 179, 95, 0.12);
    border: 1px solid rgba(240, 179, 95, 0.2);
    font-weight: 800;
  }
  .nav-links a:hover,
  .nav-links a:focus-visible {
    background: rgba(116, 184, 255, 0.14);
  }
  .nav-links a[href="#hero"]:hover,
  .nav-links a[href="#hero"]:focus-visible {
    background: rgba(136, 200, 255, 0.24);
  }
  .nav-links a[href="#contact"]:hover,
  .nav-links a[href="#contact"]:focus-visible {
    background: rgba(240, 179, 95, 0.2);
  }
  .nav-mobile-cta:hover,
  .nav-mobile-cta:focus-visible {
    background: linear-gradient(135deg, #f5bf71 0%, #fff0d0 100%);
    color: #0f0a03 !important;
    transform: translateY(-1px);
  }
  .hero-grid,
  .contact-grid,
  .about-grid,
  .skill-grid,
  .service-grid,
  .project-grid,
  .cert-grid,
  .experience-grid,
  .blog-grid,
  .field-grid { grid-template-columns: 1fr; }
  .hero-actions,
  .hero-badges { grid-template-columns: 1fr; }
  .hero-actions { gap: 0.8rem; }
  .hero-badges { gap: 0.7rem; }
  .hero-photo { min-height: 260px; aspect-ratio: auto; }
  .hero-copy h1 { font-size: clamp(2.3rem, 12vw, 3.2rem); }
  .hero-title { font-size: 1rem; }
  .button { width: 100%; }
  .project-card-network img { height: 210px; padding: 0.75rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .timeline::before { left: 0.4rem; }
  .timeline-item { margin-left: 1.5rem; }
  .timeline-item::before { left: -1.35rem; }
  .chatbot-actions { grid-template-columns: repeat(2, 1fr); }
  .chatbot-form { grid-template-columns: 1fr auto; }
  .chatbot { 
    width: calc(100vw - 1.2rem); 
    right: 0.6rem; 
    bottom: 5rem; 
    padding: 1rem;
  }
  .chatbot-body {
    max-height: 50vh; /* S'adapte à la hauteur de l'écran, surtout quand le clavier est ouvert */
  }
  .section {
    contain-intrinsic-size: 1px 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
