/* ==================== ENHANCEMENTS: animations + responsive ==================== */
html, body { overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #67e8f9, #3b82f6, #a78bfa);
  z-index: 200; pointer-events: none;
}

/* Animated background blobs in hero */
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-bg .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45;
  animation: blobFloat 16s ease-in-out infinite alternate;
}
.hero-bg .b1 { width: 420px; height: 420px; background: #0891b2; top: -120px; right: -80px; }
.hero-bg .b2 { width: 360px; height: 360px; background: #4f46e5; bottom: -140px; left: -100px; animation-delay: -5s; }
.hero-bg .b3 { width: 260px; height: 260px; background: #0d9488; top: 40%; left: 45%; animation-delay: -10s; opacity: 0.3; }
.hero-bg .grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(103,232,249,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103,232,249,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, -30px) scale(1.12); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}
.hero-content { position: relative; z-index: 1; }

/* Hero kicker + typing line */
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
  color: #67e8f9; background: rgba(103,232,249,0.08);
  border: 1px solid rgba(103,232,249,0.25); border-radius: 999px;
  padding: 7px 14px; margin-bottom: 1.1rem;
}
.hero-kicker .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7); animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.hero-typed {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem; color: #e2e8f0; margin: -1rem 0 1.6rem; min-height: 1.9em;
}
.hero-typed .typed-text { color: #67e8f9; font-weight: 600; }
.hero-typed .caret {
  display: inline-block; width: 2px; height: 1.1em; background: #67e8f9;
  margin-left: 3px; vertical-align: -0.15em; animation: caretBlink 0.9s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* Gradient shimmer on name */
.hero-left h1 {
  background: linear-gradient(90deg, #ffffff 0%, #67e8f9 35%, #a78bfa 60%, #ffffff 100%) !important;
  background-size: 250% auto !important;
  -webkit-background-clip: text !important; background-clip: text;
  animation: nameShine 7s linear infinite;
}
@keyframes nameShine { to { background-position: 250% center; } }

/* Hero buttons (moved from inline) */
.hero-actions .btn-primary {
  background: linear-gradient(90deg, #67e8f9, #3b82f6); color: #0f172a;
  padding: 16px 36px; font-size: 1.05rem; position: relative; overflow: hidden;
}
.hero-actions .btn-ghost { border: 2px solid #67e8f9; color: #67e8f9; padding: 15px 34px; }
.hero-actions .btn-primary::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); animation: btnSweep 3.5s ease-in-out infinite;
}
@keyframes btnSweep { 0%, 60% { left: -75%; } 100% { left: 130%; } }
.hero-actions .btn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(59,130,246,0.35); }
.hero-actions .btn-ghost:hover { background: rgba(103,232,249,0.1); }

/* Portrait: rotating glow ring + float */
.hero-portrait-wrap { position: relative; display: grid; place-items: center; animation: floatY 6s ease-in-out infinite; }
.hero-portrait-wrap::before {
  content: ""; position: absolute; width: calc(100% + 26px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, #67e8f9, #3b82f6, #a78bfa, transparent 70%, #67e8f9);
  animation: spin 6s linear infinite; filter: blur(2px); opacity: 0.85;
}
.hero-portrait-wrap .hero-portrait { position: relative; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Orbiting tech chips around portrait */
.orbit-chip {
  position: absolute; z-index: 2; font-size: 0.78rem; font-weight: 700; color: #e2e8f0;
  background: rgba(15,23,42,0.9); border: 1px solid rgba(103,232,249,0.35);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4); animation: floatY 5s ease-in-out infinite;
}
.orbit-chip.c1 { top: 8%; left: -12%; }
.orbit-chip.c2 { top: 45%; right: -18%; animation-delay: -1.5s; }
.orbit-chip.c3 { bottom: 6%; left: -6%; animation-delay: -3s; }

/* Reveal variants + stagger */
.reveal { transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transform: translateY(30px); }
.reveal.from-left { transform: translateX(-40px); }
.reveal.from-right { transform: translateX(40px); }
.reveal.zoom { transform: scale(0.92); }
.reveal.in { opacity: 1; transform: none; }

/* Section label underline animation */
.section-label { position: relative; display: inline-block; }
.section-label::after {
  content: ""; display: block; height: 2px; width: 0; margin-top: 6px;
  background: linear-gradient(90deg, #f59e0b, transparent); transition: width 0.9s ease 0.2s;
}
.reveal.in .section-label::after, .section-label.reveal.in::after { width: 100%; }
#experience .section-label, #projects .section-label, #skills .section-label { display: block; text-align: center; }
#experience .section-label::after, #projects .section-label::after, #skills .section-label::after { margin-inline: auto; max-width: 120px; }
#skills h2, #projects h2, #experience h2 { margin-inline: auto; text-align: center; }

/* Skill meters fill on view */
.skill-meter span { transform-origin: left; transform: scaleX(0); transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s; }
.skill-card.in .skill-meter span { transform: scaleX(1); }

/* Card hover glow (mouse-follow) */
.skill-card, .project-card, .time-card, .highlight-card, .cert-card-item {
  position: relative; overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.7s ease;
}
.skill-card::before, .project-card::before, .time-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(103,232,249,0.12), transparent 45%);
}
.skill-card:hover::before, .project-card:hover::before, .time-card:hover::before { opacity: 1; }
.skill-card.in:hover, .project-card.in:hover, .time-card.in:hover {
  transform: translateY(-6px); border-color: rgba(103,232,249,0.45);
  box-shadow: 0 20px 40px rgba(2,8,18,0.5), 0 0 0 1px rgba(103,232,249,0.15);
}
.project-image { transition: transform 0.6s ease; }
.project-card:hover .project-image { transform: scale(1.04); }

/* Timeline current badge glow */
.time-range.current { color: #22c55e; display: inline-flex; align-items: center; gap: 8px; }
.time-range.current::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulseDot 1.8s infinite; }

/* WhatsApp float pulse */
.float-whatsapp { animation: waPulse 2.4s infinite; }
@keyframes waPulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.55), 0 14px 30px rgba(2,8,18,0.45); }
  70% { box-shadow: 0 0 0 16px rgba(22,163,74,0), 0 14px 30px rgba(2,8,18,0.45); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0), 0 14px 30px rgba(2,8,18,0.45); }
}

/* Nav shrink on scroll */
.nav { transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease; }
.nav.scrolled { background: rgba(8,20,35,0.94); box-shadow: 0 10px 30px rgba(0,0,0,0.35); padding: 10px 16px; }
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: #67e8f9; transform: scaleX(0); transition: transform 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* ==================== FAQ ==================== */
.faq-list { max-width: 900px; margin: 28px auto 0; display: grid; gap: 14px; }
#faq h2, #faq .section-label { text-align: center; margin-inline: auto; display: block; }
#faq .section-label::after { margin-inline: auto; max-width: 120px; }
.faq-item {
  border: 1px solid rgba(154,176,200,0.2); border-radius: 16px;
  background: rgba(13,28,46,0.72); overflow: hidden; transition: border-color 0.3s ease;
}
.faq-item[open] { border-color: rgba(103,232,249,0.45); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; position: relative;
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.05rem; color: #e2e8f0;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: #67e8f9; transition: transform 0.3s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 20px 20px; line-height: 1.75; animation: faqIn 0.4s ease; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==================== RESPONSIVE ==================== */
/* Tablet: 2 columns where space allows */
@media (min-width: 641px) and (max-width: 980px) {
  .skills-grid, .projects-grid, .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card.featured { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .footer-brand { grid-column: 1 / -1; max-width: 100% !important; text-align: center; }
  .footer-brand .social-icons { justify-content: center; }
  .contact-copy { padding-right: 0 !important; }
}

@media (max-width: 1024px) {
  .hero-typed { margin-top: -0.6rem; }
  .hero-tagline, .hero-description { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .orbit-chip.c1 { left: -4%; }
  .orbit-chip.c2 { right: -6%; }
}

@media (max-width: 980px) {
  .hero-portrait { width: 300px !important; height: 300px !important; aspect-ratio: 1 !important; margin: 0 auto !important; }
  .nav-links { z-index: 150; }
}

@media (max-width: 640px) {
  .hero { padding: 96px 5% 70px !important; min-height: auto !important; }
  .hero-left h1 { font-size: clamp(2.3rem, 11vw, 3rem) !important; }
  .hero-tagline { font-size: 1.08rem !important; margin-bottom: 1.4rem !important; }
  .hero-typed { font-size: 1.05rem; }
  .hero-description { font-size: 1rem !important; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 0.8rem !important; }
  .hero-actions .btn { width: 100%; padding: 14px 20px !important; }
  .hero-portrait { width: 230px !important; height: 230px !important; }
  .hero-image-info { padding: 1rem 1.2rem !important; }
  .hero-image-info .badge { font-size: 0.8rem !important; padding: 6px 14px !important; }
  .orbit-chip { font-size: 0.68rem; padding: 5px 9px; }
  .orbit-chip.c1 { left: -2%; top: 2%; }
  .orbit-chip.c2 { right: -4%; }
  .orbit-chip.c3 { left: 2%; bottom: 2%; }
  .hero-bg .blob { filter: blur(50px); }
  .hero-bg .b1 { width: 260px; height: 260px; }
  .hero-bg .b2 { width: 240px; height: 240px; }
  .about-content h2 { font-size: 1.8rem !important; }
  .about-highlights { grid-template-columns: repeat(2, 1fr) !important; gap: 0.8rem !important; }
  .about-visual { min-height: auto !important; }
  .about-visual-content { padding: 1.2rem !important; }
  .skill-card, .project-card, .time-card { padding: 18px; }
  .skill-top { flex-wrap: wrap; }
  .contact-professional { padding: 1.5rem 1.2rem !important; }
  .faq-item summary { font-size: 0.98rem; padding: 16px 46px 16px 16px; }
  .faq-item p { padding: 0 16px 16px; }
  .cert-list { padding: 14px !important; }
}

@media (max-width: 380px) {
  .nav { padding: 10px 12px; }
  .logo { font-size: 17px; }
  .hero-portrait { width: 200px !important; height: 200px !important; }
  .orbit-chip.c2 { display: none; }
  .about-highlights { grid-template-columns: 1fr 1fr !important; }
  .highlight-number { font-size: 1.5rem !important; }
}

/* Large screens */
@media (min-width: 1600px) {
  .hero-content, #about .container.split { max-width: 1440px !important; }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .skill-meter span { transform: none !important; }
}
