/* ============================================================
   PERSONAL PORTFOLIO — CAR GUY EDITION
   Palette: Carbon black · Racing red · Chrome silver · Asphalt
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Poppins', sans-serif;

  /* Racing red accent */
  --red:         #e8001c;
  --red-dark:    #b8001a;
  --red-glow:    rgba(232, 0, 28, 0.25);

  /* Chrome / silver highlight */
  --chrome:      #c0c8d4;
  --chrome-dim:  #8899aa;

  --radius:  14px;
  --nav-h:   74px;
  --ease:    0.3s ease;
}

/* ---------- Dark (carbon) theme — DEFAULT ---------- */
[data-theme="dark"] {
  --bg:        #0d0d0f;          /* near-black carbon */
  --bg-alt:    #131318;          /* slightly lighter panel */
  --card:      #18181f;          /* card surface */
  --border:    #2a2a35;
  --text:      #f0f2f5;
  --muted:     #8899aa;
  --shadow:    0 8px 28px rgba(0,0,0,0.6);
  --nav-bg:    rgba(10,10,12,0.92);
  --accent:        var(--red);
  --accent-strong: var(--red-dark);
  --accent-soft:   rgba(232,0,28,0.12);
  color-scheme: dark;
}

/* ---------- Light (asphalt) theme ---------- */
[data-theme="light"] {
  --bg:        #f2f2f4;
  --bg-alt:    #e6e6ea;
  --card:      #ffffff;
  --border:    #d0d0d8;
  --text:      #0d0d0f;
  --muted:     #555566;
  --shadow:    0 8px 24px rgba(0,0,0,0.10);
  --nav-bg:    rgba(242,242,244,0.92);
  --accent:        var(--red);
  --accent-strong: var(--red-dark);
  --accent-soft:   rgba(232,0,28,0.08);
  color-scheme: light;
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--ease), color var(--ease);
  overflow-x: hidden;
}

/* Carbon-fiber texture overlay on dark mode */
[data-theme="dark"] body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.013) 0px,
      rgba(255,255,255,0.013) 1px,
      transparent 1px,
      transparent 6px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.013) 0px,
      rgba(255,255,255,0.013) 1px,
      transparent 1px,
      transparent 6px
    );
}

img    { max-width: 100%; display: block; }
a      { color: var(--accent); text-decoration: none; }
ul     { list-style: none; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.container { width: min(1120px, 92%); margin-inline: auto; }
.muted { color: var(--muted); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease), border-color var(--ease);
}
/* Racing stripe under nav */
.navbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--red-dark) 20%,
    var(--red) 50%,
    var(--red-dark) 80%,
    transparent 100%
  );
}
.nav-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

/* ---- LOGO ---- */
.logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.4rem; color: var(--text);
  flex-shrink: 0;
}
/*
  The logo PNG has a solid teal background.
  We clip it tightly and use a hue-rotate + invert trick so the
  teal bg blends away on dark, and we size it big enough to read clearly.
*/
.logo-img {
  height: 60px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform var(--ease), filter var(--ease);
}
.logo-img:hover { transform: scale(1.06); }

/* Light mode: invert turns black bg → white, red stays red (hue-rotate 0 keeps red intact) */
[data-theme="light"] .logo-img {
  filter: invert(1) hue-rotate(180deg) saturate(2) brightness(0.95);
}

.logo-text { display: none; }
.logo-text span { color: var(--accent); }
.logo.no-logo .logo-text { display: inline; }

/* ---- Nav links ---- */
.nav-links { display: flex; gap: 0.2rem; }
.nav-link {
  color: var(--muted); font-weight: 500; font-size: 0.91rem;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  transition: var(--ease);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: 2px; left: 50%; right: 50%;
  height: 2px; background: var(--red); border-radius: 2px;
  transition: left var(--ease), right var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link:hover::after, .nav-link.active::after { left: 14%; right: 14%; }
.nav-link.active { color: var(--red); background: var(--accent-soft); }

.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  display: grid; place-items: center;
  transition: var(--ease);
}
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.menu-btn { display: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.78rem 1.5rem; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem;
  border: 2px solid transparent;
  transition: var(--ease); cursor: pointer;
  letter-spacing: 0.03em; text-transform: uppercase;
  position: relative; overflow: hidden;
}
/* Shine sweep on hover */
.btn::before {
  content: '';
  position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.4s ease;
}
.btn:hover::before { left: 150%; }

.btn-primary {
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 100%);
  color: #fff;
  box-shadow: 0 4px 18px var(--red-glow);
}
.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--red-glow);
}
.btn-outline {
  border-color: var(--red); color: var(--red); background: transparent;
}
.btn-outline:hover {
  background: var(--red); color: #fff; transform: translateY(-2px);
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 5.5rem 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2;
}
/* Red racing-stripe underline */
.section-head h2::after {
  content: '';
  display: block; width: 56px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-dark) 100%);
  margin-top: 0.6rem;
}
.section-head p { color: var(--muted); margin-top: 0.8rem; }
.sub-head { font-size: 1.2rem; margin: 2rem 0 1.2rem; color: var(--chrome); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
  position: relative; overflow: hidden;
}
/* Top-edge racing stripe on cards */
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0;
  transition: opacity var(--ease);
}
.card:hover::before { opacity: 1; }

.grid { display: grid; gap: 1.3rem; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.8rem; }

/* ============================================================
   HERO  — speed-track design
   ============================================================ */
.hero {
  padding: 4rem 0 5rem;
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}

/* Animated speed lines */
.hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    /* diagonal speed lines */
    repeating-linear-gradient(
      110deg,
      transparent 0px,
      transparent 60px,
      rgba(232, 0, 28, 0.04) 60px,
      rgba(232, 0, 28, 0.04) 61px
    ),
    repeating-linear-gradient(
      110deg,
      transparent 0px,
      transparent 120px,
      rgba(232, 0, 28, 0.025) 120px,
      rgba(232, 0, 28, 0.025) 122px
    );
}

/* Red glow bottom-left corner */
.hero::after {
  content: '';
  position: absolute; bottom: -120px; left: -80px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,0,28,0.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

.hero-grid {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: 3rem; align-items: center;
  position: relative; z-index: 1;
}

.hero-greeting {
  color: var(--red); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.6rem;
}
.hero-greeting::before {
  content: '';
  display: inline-block; width: 28px; height: 2px;
  background: var(--red); border-radius: 2px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08; margin: 0.4rem 0;
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: 0.02em;
}
[data-theme="dark"] .hero h1 {
  background: linear-gradient(135deg, #ffffff 30%, var(--chrome) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 500; color: var(--muted); margin-bottom: 1.2rem;
}
.hero-intro { color: var(--muted); max-width: 60ch; margin-bottom: 2rem; }

/* Profile photo */
.hero-photo { display: flex; justify-content: center; }
.hero-photo { --photo-size: clamp(260px, 34vw, 420px); --photo-pos: center 20%; }
.photo-frame {
  position: relative; width: var(--photo-size); max-width: 85vw;
  aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--red);
  box-shadow:
    0 0 0 10px rgba(232,0,28,0.08),
    0 0 50px rgba(232,0,28,0.22),
    var(--shadow);
  overflow: hidden; background: var(--card);
}
.photo-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 0.4rem; padding: 2rem; color: var(--muted);
}
.photo-placeholder i { font-size: 4rem; color: var(--accent); }
.photo-placeholder span { font-weight: 500; font-size: 0.9rem; }
.photo-placeholder small { font-size: 0.75rem; }
.photo-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--photo-pos);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.5rem; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 1rem; max-width: 65ch; }
.about-facts { display: grid; gap: 0.9rem; }
.about-facts li {
  display: flex; gap: 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  transition: border-color var(--ease), transform var(--ease);
}
.about-facts li:hover { transform: translateX(4px); border-color: var(--red); }
.about-facts i {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--red); flex-shrink: 0;
}
.about-facts strong { display: block; font-size: 0.9rem; }
.about-facts span { color: var(--muted); font-size: 0.88rem; }

/* ============================================================
   SKILLS & DOCUMENTS
   ============================================================ */
.skill-card, .doc-card { text-align: center; }
.skill-card:hover, .doc-card:hover, .project-card:hover {
  transform: translateY(-6px);
  border-color: var(--red);
  box-shadow: 0 12px 32px rgba(232,0,28,0.18);
}
.skill-card > i, .doc-card > .doc-icon {
  font-size: 1.8rem; color: var(--red);
  background: var(--accent-soft);
  width: 60px; height: 60px; border-radius: 14px;
  display: grid; place-items: center; margin: 0 auto 1rem;
}
.skill-card h4, .doc-card h4 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.skill-card p,  .doc-card p  { color: var(--muted); font-size: 0.88rem; }
.doc-card { display: flex; flex-direction: column; }
.doc-card p { flex: 1; margin-bottom: 1.1rem; }
.doc-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   LIGHTBOX  (project screenshot full-view inside modal)
   ============================================================ */
.lightbox-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}
.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
/* Reuse .carousel-btn but make it always visible in the lightbox */
.lightbox-prev,
.lightbox-next {
  opacity: 1 !important;
  position: static !important;
  transform: none !important;
  width: 42px; height: 42px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--red) !important;
  transform: scale(1.1) !important;
}
.lightbox-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 48px;
  text-align: center;
}

/* ============================================================
   PROJECT CARD CAROUSEL
   ============================================================ */
.carousel {
  position: relative;      /* anchor for buttons, dots, counter */
  background: #111;
  border-bottom: 1px solid var(--border);
}

/* Track: block container, only active slide is shown */
.carousel-track {
  display: block;
  width: 100%;
}

/* Each slide — hidden by default */
.carousel-slide {
  display: none;
  width: 100%;
  background: #111;
}
.carousel-slide.active {
  display: block;
  animation: slideFadeIn 0.3s ease;
}
@keyframes slideFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.carousel-slide .shot-placeholder {
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem; color: var(--muted); font-size: 0.85rem;
  padding: 3rem 1rem; min-height: 160px;
}
.carousel-slide .shot-placeholder i { font-size: 2.4rem; color: var(--red); }

/* Image: full width, natural height, never cropped */
.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* Prev / Next — anchored to the carousel box */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 38px; height: 38px; border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ease), background var(--ease);
  backdrop-filter: blur(4px);
}
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: var(--red); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* Dot indicators */
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: none; padding: 0;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background var(--ease), width var(--ease);
}
.carousel-dot.active { background: var(--red); width: 22px; border-radius: 4px; }
.carousel-dot:hover:not(.active) { background: rgba(255,255,255,0.75); }

/* Counter badge */
.carousel-counter {
  position: absolute; bottom: 10px; right: 12px; z-index: 10;
  font-size: 0.75rem; font-weight: 600; color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 2px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.04em;
  /* hide when dots are also shown to avoid overlap */
  pointer-events: none;
}

/* ============================================================
   PROJECTS (keep existing rules)
   ============================================================ */
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-shot {
  position: relative; aspect-ratio: 16/10;
  background: var(--bg-alt); border-bottom: 1px solid var(--border); overflow: hidden;
}
.project-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.3rem;
  color: var(--muted); font-size: 0.85rem;
}
.shot-placeholder i { font-size: 2.4rem; color: var(--red); }
.project-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; gap: 0.7rem; }
.project-body h3 { font-size: 1.2rem; }
.project-body > p { color: var(--muted); font-size: 0.93rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.78rem; padding: 0.2rem 0.75rem; border-radius: 4px;
  background: var(--accent-soft); color: var(--red); font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.project-body .btn { margin-top: auto; align-self: flex-start; }

/* ============================================================
   EDUCATION TIMELINE
   ============================================================ */
.timeline {
  position: relative; max-width: 760px;
  padding-left: 3.4rem; display: grid; gap: 1.8rem;
}
.timeline::before {
  content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(to bottom, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 3px;
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -3.4rem; top: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 6px var(--bg-alt), 0 0 16px rgba(232,0,28,0.5);
}
.timeline-item h3 { font-size: 1.2rem; }
.edu-degree { color: var(--red); font-weight: 500; margin: 0.2rem 0 0.8rem; }
.edu-meta { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.92rem; }
.edu-meta i { color: var(--red); width: 1.2rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; align-items: start; }
.contact-info .card { text-align: center; }
.big-icon {
  font-size: 2rem; color: var(--red);
  background: var(--accent-soft);
  width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center; margin: 0 auto 1rem;
}
.contact-info a { word-break: break-all; font-weight: 500; color: var(--red); }
.contact-form h3 { margin-bottom: 1.2rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.35rem; }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 1rem; font: inherit;
  color: var(--text); background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 10px;
  transition: var(--ease); resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(232,0,28,0.15);
}
.field.invalid input, .field.invalid textarea { border-color: #ef4444; }
.error-msg { display: block; min-height: 1.1em; color: #ef4444; font-size: 0.8rem; margin-top: 0.25rem; }
.form-status { margin-top: 1rem; padding: 0; font-size: 0.92rem; border-radius: 10px; }
.form-status.success, .form-status.error { padding: 0.8rem 1rem; }
.form-status.success { background: rgba(34,197,94,0.14);  color: #16a34a; }
.form-status.error   { background: rgba(239,68,68,0.14);  color: #ef4444; }
[data-theme="dark"] .form-status.success { color: #4ade80; }
[data-theme="dark"] .form-status.error   { color: #f87171; }

/* ============================================================
   SKILLS GROUPS & LANGUAGES
   ============================================================ */
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.skill-group:hover { transform: translateY(-6px); border-color: var(--red); }
.skill-group > i {
  font-size: 1.6rem; color: var(--red);
  background: var(--accent-soft);
  width: 56px; height: 56px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 1rem;
}
.skill-group h4 { font-size: 1.05rem; margin-bottom: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips .tag { font-size: 0.82rem; padding: 0.3rem 0.8rem; }

.lang-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.lang-badge {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: 0.9rem 1.3rem;
  transition: transform var(--ease);
}
.lang-badge:hover { transform: translateX(4px); }
.lang-badge i {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--red);
}
.lang-badge strong { display: block; font-size: 0.95rem; }
.lang-badge span { color: var(--muted); font-size: 0.85rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.5rem 0;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.footer-grid { display: grid; grid-template-columns: 1.2fr 2fr auto; gap: 1.5rem; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--red); }
.socials { display: flex; gap: 0.6rem; }
.socials a {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text); transition: var(--ease);
}
.socials a:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* Back to top */
.to-top {
  position: fixed; right: 1.4rem; bottom: 1.4rem;
  width: 46px; height: 46px; border-radius: 8px; border: none;
  background: var(--red); color: #fff;
  box-shadow: 0 4px 18px rgba(232,0,28,0.45);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: var(--ease); z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { filter: brightness(1.15); }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(5px);
}
.modal-box {
  position: relative; width: min(900px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--red);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: pop 0.25s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.15rem; }
.modal-body { padding: 1.4rem; overflow-y: auto; }
.cert-view { display: block; width: 100%; height: 72vh; border: none; border-radius: 10px; background: var(--bg-alt); }
.cert-fallback {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
  display: grid; gap: 1rem; justify-items: center;
}
.cert-fallback i { font-size: 2.6rem; color: var(--red); }
.cert-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.9rem; }
.cert-img { max-height: 70vh; margin: 0 auto; border-radius: 10px; object-fit: contain; }
.cert-missing { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.detail h4 { font-size: 1.05rem; margin: 1.3rem 0 0.5rem; color: var(--red); }
.detail h4:first-child { margin-top: 0; }
.detail p { color: var(--muted); }
.detail ul { list-style: disc; padding-left: 1.3rem; color: var(--muted); display: grid; gap: 0.3rem; }
body.modal-open { overflow: hidden; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero { text-align: center; }
  .hero-greeting { justify-content: center; }
  .hero-intro { margin-inline: auto; }
  .btn-row { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-links, .socials { justify-content: center; }
}
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0.2rem; padding: 1rem 4%;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; padding-block: 0; visibility: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, visibility 0.35s;
  }
  .nav-links.open { max-height: 80vh; padding-block: 1rem; visibility: visible; }
  .nav-link { display: block; border-radius: 8px; }
}
@media (max-width: 520px) {
  .section { padding: 4rem 0; }
  .modal-body { padding: 1rem; }
  .cert-view { height: 62vh; }
  .timeline { padding-left: 3rem; }
  .timeline-dot { left: -3rem; width: 40px; height: 40px; }
  .timeline::before { left: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
