/* =========
   DESIGN TOKENS
   ========= */
:root {
  --bg-dark: #050816;
  --bg-navy: #0f172a;
  --bg-elevated: rgba(15, 23, 42, 0.88);
  --accent-gold: #d4af37;
  --accent-blue: #1e90ff;
  --accent-soft: #38bdf8;
  --text-light: #f5f5f5;
  --text-muted: #9ca3af;

  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-soft: 0 22px 55px rgba(0, 0, 0, 0.65);

  --font-heading: "Playfair Display", serif;
  --font-body: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  --section-padding-y: 48px; /* desktop rhythm */
  --header-height: 72px;
}

/* Light theme overrides */
body[data-theme="light"] {
  --bg-dark: #f3f4f6;
  --bg-navy: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.95);
  --text-light: #020617;
  --text-muted: #6b7280;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.18);
}

/* =========
   RESET & GLOBAL
   ========= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(circle at top, #0b1120 0, #050816 45%, #020617 100%);
  color: var(--text-light);
  padding-top: var(--header-height); /* reserve space for fixed header */
}

body[data-theme="light"] {
  background: radial-gradient(circle at top, #e5e7eb 0, #f9fafb 40%, #e5e7eb 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  padding-left: 1.2rem;
}

button {
  font-family: inherit;
}

/* Visually hidden labels */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.5);
}

/* Util container & sections */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--section-padding-y) 0;
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Alternate soft backgrounds */
.section:nth-of-type(odd) {
  background: transparent;
}

.section:nth-of-type(even) {
  background: radial-gradient(circle at top left, #0b1220 0, #050816 50%, #020617 100%);
}

body[data-theme="light"] .section:nth-of-type(even) {
  background: #f9fafb;
}

/* Section title */
.section-title {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.section-title::before {
  content: "";
  width: 26px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  border-radius: 999px;
}

/* Reveal base */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="zoom-in"] {
  transform: scale(0.94);
}

[data-reveal="zoom-in"].is-visible {
  transform: scale(1);
}

/* =========
   HEADER / NAV
   ========= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  background: linear-gradient(90deg, #020617f0, #020617e6);
  backdrop-filter: blur(16px);
  z-index: 50;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.08);
}

body[data-theme="light"] .site-header {
  background: linear-gradient(90deg, #ffffffea, #f9fafbea);
}

.navbar {
  height: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #ffffffaa 0, #fbbf24 40%, #eab308 60%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #020617;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.nav-brand-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.92rem;
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  transition: width 0.22s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle,
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.15rem;
  cursor: pointer;
}

.theme-toggle {
  margin-right: 12px;
}

body[data-theme="light"] .theme-toggle i.fa-moon {
  display: none;
}

body[data-theme="light"] .theme-toggle::before {
  content: "\f185";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.nav-toggle {
  display: none;
}

/* =========
   GLASS / CARDS
   ========= */
.glass {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.82),
    rgba(15, 23, 42, 0.92)
  );
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

body[data-theme="light"] .glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), #ffffff);
  border-color: rgba(148, 163, 184, 0.25);
}

/* =========
   HERO
   ========= */
.section-hero {
  padding-top: var(--section-padding-y);
  padding-bottom: 48px;
}

.hero-wrapper {
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
  gap: 36px;
  align-items: center;
}

.hero-content {
  max-width: 640px;
}

.hero-eyebrow {
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.05rem;
  margin: 0 0 10px;
}

.hero-subtitle {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 24px;
  margin-bottom: 16px;
}

.hero-meta-item {
  border-left: 2px solid rgba(212, 175, 55, 0.7);
  padding-left: 10px;
}

.meta-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.meta-value {
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Hero stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
}

.hero-stat {
  min-width: 120px;
}

.hero-stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  will-change: transform;
  transform: translateZ(0);
}

.btn i {
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  color: #020617;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.75);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.btn-outline {
  background: transparent;
  color: var(--text-light);
  border: 1px solid rgba(212, 175, 55, 0.8);
}

body[data-theme="light"] .btn-outline {
  color: #020617;
}

.btn-outline:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-1px) scale(1.03);
}

body[data-theme="light"] .btn-outline:hover {
  background: #111827;
  color: #f9fafb;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid transparent;
  color: var(--accent-gold);
}

body[data-theme="light"] .btn-ghost {
  background: #111827;
  color: #facc15;
}

.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-1px) scale(1.03);
}

.btn-small {
  padding: 7px 16px;
  font-size: 0.8rem;
}

.btn:active {
  transform: scale(0.97);
}

/* Magnetic buttons */
.btn-magnetic {
  position: relative;
  overflow: hidden;
}

/* Hero media */
.hero-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo {
  max-width: 360px;
  width: 100%;
  border-radius: 32px;
  overflow: hidden;
  padding: 10px;
  background: radial-gradient(circle at top, #1f2937, #020617);
  box-shadow: var(--shadow-soft);
  will-change: transform;
  transform: translateZ(0);
}

body[data-theme="light"] .hero-photo {
  background: radial-gradient(circle at top, #e5e7eb, #ffffff);
}

.hero-photo img {
  width: 100%;
  height: 410px;
  object-fit: cover;
  border-radius: 24px;
}

/* =========
   ABOUT
   ========= */
.section-about {
  padding-top: var(--section-padding-y);
}

.section-description {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 650px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 36px;
  align-items: flex-start;
}

.about-list {
  margin: 10px 0 0;
  color: var(--text-light);
  line-height: 1.6;
}

.about-list li + li {
  margin-top: 6px;
}

.about-card {
  padding: 20px 22px;
  max-width: 360px;
  margin-left: auto;
}

.about-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.about-card ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.9rem;
}

.about-card li + li {
  margin-top: 8px;
}

.about-card span {
  color: var(--text-muted);
}

/* =========
   SKILLS
   ========= */
.section-skills {
  padding-top: var(--section-padding-y);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 18px;
  align-items: stretch;
}

.skill-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.skill-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.skill-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.skill-level-label {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
}

.skill-card p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.skill-progress {
  width: 100%;
  height: 6px;
  background: rgba(30, 64, 175, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

body[data-theme="light"] .skill-progress {
  background: rgba(203, 213, 225, 0.9);
}

.skill-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

/* =========
   EXPERIENCE TIMELINE
   ========= */
.section-experience {
  padding-top: var(--section-padding-y);
}

.timeline {
  position: relative;
  margin-top: 10px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-gold));
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  padding-left: 52px;
  margin-bottom: 18px;
  display: flex;
  align-items: stretch;
}

.timeline-icon {
  position: absolute;
  left: 5px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #ffffffaa 0, #22c55e 40%, #16a34a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.timeline-content {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  flex: 1;
  height: 100%;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-role {
  font-size: 0.9rem;
  margin-top: 2px;
  color: var(--text-muted);
}

.timeline-content ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* =========
   PROJECTS
   ========= */
.section-projects {
  padding-top: var(--section-padding-y);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 18px;
  align-items: stretch;
}

.project-card {
  padding: 18px 20px 16px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-md);
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.18s ease;
  height: 100%;
  will-change: transform;
  transform: translateZ(0);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  border-color: rgba(212, 175, 55, 0.7);
}

body[data-theme="light"] .project-card:hover {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.project-meta {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-meta i {
  margin-right: 4px;
}

.project-card ul {
  margin: 0 0 8px;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
}

.project-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body[data-theme="light"] .project-tags span {
  background: #111827;
  color: #e5e7eb;
}

/* =========
   CERTIFICATIONS + AWARDS (GALLERY STYLE)
   ========= */
.section-certs,
.section-awards {
  padding-top: var(--section-padding-y);
}

/* Featured gallery row */
.cert-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin: 20px 0 28px;
}

/* Shared cert/award grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 8px;
  align-items: stretch;
}

/* Card shell */
.cert-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  height: 100%;
  will-change: transform;
  transform: translateZ(0);
}

/* Text block */
.cert-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Typography inside cards */
.cert-title {
  font-size: 0.95rem;
}

.cert-cta {
  font-size: 0.8rem;
  color: var(--accent-soft);
}

.cert-year {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* For icon-based cards (appreciations) */
.cert-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-thumb {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at 30% 0, #ffffffaa 0, #22c55e 40%, #16a34a 100%);
}

.cert-thumb i {
  font-size: 1.1rem;
  color: #0b1120;
}

.award-thumb {
  background: radial-gradient(circle at 30% 0, #ffffffc4 0, #fbbf24 40%, #d97706 100%);
}

/* Featured certificates/awards – larger, more premium */
.cert-card.featured {
  min-height: 160px;
  padding: 20px 20px 18px;
  border: 2px solid transparent;
  background:
    linear-gradient(#020617, #020617) padding-box,
    linear-gradient(135deg, #d4af37, #1e90ff) border-box;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.75);
}

body[data-theme="light"] .cert-card.featured {
  background:
    linear-gradient(#ffffff, #f9fafb) padding-box,
    linear-gradient(135deg, #d4af37, #1e90ff) border-box;
}

/* === Featured Awards with real photos === */
.award-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.award-photo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.9);
  background: #020617;
}

.award-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.award-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Hover state */
.cert-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.75);
}

body[data-theme="light"] .cert-card:hover {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

/* Featured stronger hover */
.cert-card.featured:hover {
  transform: translateY(-5px) scale(1.04);
}

/* =========
   CONTACT
   ========= */
.section-contact {
  padding-top: var(--section-padding-y);
}

.contact-form {
  max-width: 640px;
  margin: 16px auto 24px;
  padding: 22px 24px 26px;
}

.contact-form .form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.contact-form input,
.contact-form textarea {
  flex: 1;
  background: #020617;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 12px 16px;
  min-height: 44px;
  color: var(--text-light);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body[data-theme="light"] .contact-form input,
body[data-theme="light"] .contact-form textarea {
  background: #f9fafb;
  color: #020617;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row-actions {
  justify-content: flex-end;
  align-items: center;
}

.form-success {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #22c55e;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.form-success.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Contact icons */
.contact-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
}

.contact-links a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

body[data-theme="light"] .contact-links a {
  background: #111827;
}

.contact-links a:hover {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(212, 175, 55, 0.9);
}

/* =========
   FOOTER
   ========= */
.site-footer {
  text-align: center;
  padding: 18px 16px 22px;
  background: #020617;
  font-size: 0.85rem;
  color: var(--text-muted);
}

body[data-theme="light"] .site-footer {
  background: #111827;
  color: #9ca3af;
}

/* =========
   FLOATING BUTTONS / SOCIAL
   ========= */
.floating-whatsapp {
  position: fixed;
  right: 20px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  z-index: 40;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-whatsapp:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 40;
}

body[data-theme="light"] .back-to-top {
  background: #111827;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Floating social */
.floating-social {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 35;
}

.floating-social a {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body[data-theme="light"] .floating-social a {
  background: #111827;
}

.floating-social a:hover {
  transform: translateX(2px) scale(1.05);
  border-color: rgba(212, 175, 55, 0.9);
}

/* =========
   SCROLL PROGRESS BAR
   ========= */
#scrollProgressBar {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
}

/* =========
   EXPERIENCE POPUP
   ========= */
.exp-popup-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.94));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 80;
}

body[data-theme="light"] .exp-popup-overlay {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.9));
}

.exp-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.exp-popup {
  position: relative;
  max-width: 460px;
  width: 92%;
  padding: 20px 22px 22px 0;
  display: flex;
  border-radius: 24px;
  transform: translateY(24px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.exp-popup.is-active {
  opacity: 1;
  transform: translateY(0);
}

.exp-flag-bar {
  width: 10px;
  border-radius: 24px 0 0 24px;
  flex-shrink: 0;
}

.exp-popup-content {
  padding: 4px 18px 4px 18px;
}

.exp-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

body[data-theme="light"] .exp-tag {
  background: #020617;
  color: #e5e7eb;
}

.exp-title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.exp-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.exp-close-btn {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: transform 0.18s ease, color 0.18s ease;
}

.exp-close-btn:hover {
  transform: scale(1.08);
  color: var(--accent-soft);
}

/* Flag colors */
.flag-spain {
  background: linear-gradient(
    to bottom,
    #c1121f 0,
    #c1121f 25%,
    #f5c32c 25%,
    #f5c32c 75%,
    #c1121f 75%,
    #c1121f 100%
  );
}

.flag-italy {
  background: linear-gradient(
    to bottom,
    #009246 0,
    #009246 33.3%,
    #f1f2f1 33.3%,
    #f1f2f1 66.6%,
    #ce2b37 66.6%,
    #ce2b37 100%
  );
}

/* =========
   RESPONSIVE
   ========= */
@media (max-width: 960px) {
  .hero-wrapper {
    align-items: flex-start;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .hero-media {
    justify-content: flex-start;
  }

  .hero-photo {
    max-width: 320px;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-card {
    margin: 10px 0 0;
  }

  .projects-grid,
  .skills-grid {
    gap: 18px;
  }

  .floating-social {
    display: none;
  }

  .cert-featured {
    gap: 18px;
  }

  .cert-card.featured {
    min-height: 140px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--header-height);
    right: 0;
    left: 0;
    padding: 14px 22px 16px;
    background: rgba(2, 6, 23, 0.98);
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.5);
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  body[data-theme="light"] .nav-links {
    background: #020617;
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .section {
    padding: 32px 0; /* tablet rhythm */
  }

  .contact-form .form-row {
    flex-direction: column;
  }

  .back-to-top {
    right: 16px;
    bottom: 86px;
  }

  .floating-whatsapp {
    right: 14px;
    bottom: 18px;
  }

  .hero-wrapper {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .section {
    padding: 24px 0; /* mobile rhythm */
  }

  .hero-title {
    font-size: 2.45rem;
  }

  .section-title {
    font-size: 1.9rem;
  }

  .hero-photo img {
    height: 320px;
  }

  .timeline::before {
    left: 16px;
  }

  .timeline-icon {
    left: 3px;
  }

  .timeline-item {
    padding-left: 48px;
  }

  .exp-popup {
    padding-right: 16px;
  }

  .hero-actions {
    gap: 8px;
  }
}
