*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition:
    background-color 0.4s var(--ease-smooth),
    color 0.4s var(--ease-smooth);
}

::selection {
  background: var(--accent-crimson);
  color: #fff;
}

a {
  color: var(--accent-crimson);
  text-decoration: none;
  transition: color 0.3s var(--ease-smooth);
}

a:hover {
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-transform: lowercase;
}

.navbar {
  padding: 1rem 0;
  transition:
    padding 0.3s var(--ease-smooth),
    box-shadow 0.4s var(--ease-smooth);
  z-index: 1050;
}

.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: transparent;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition:
    background-color 0.4s var(--ease-smooth),
    backdrop-filter 0.4s var(--ease-smooth),
    -webkit-backdrop-filter 0.4s var(--ease-smooth);
  pointer-events: none;
  z-index: -1;
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled::before {
  background-color: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

.brand-dot {
  color: var(--accent-crimson);
}

.nav-link {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color 0.3s var(--ease-smooth);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-crimson);
  transition:
    width 0.3s var(--ease-smooth),
    left 0.3s var(--ease-smooth);
}

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

.nav-link.active::after,
.nav-link:hover::after {
  width: 60%;
  left: 20%;
}

.btn-resume {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-crimson) !important;
  border: 1px solid var(--accent-crimson);
  border-radius: 4px;
  padding: 0.4rem 1rem !important;
  transition:
    background-color 0.3s var(--ease-smooth),
    color 0.3s var(--ease-smooth);
}

.btn-resume:hover {
  background: var(--accent-crimson);
  color: #fff !important;
}

.control-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    color 0.3s var(--ease-smooth),
    border-color 0.3s var(--ease-smooth);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.control-toggle:hover {
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

.lang-toggle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.navbar-toggler {
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-toggler:focus {
  box-shadow: none;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--bg-primary);
    position: fixed;
    inset: 0;
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-smooth);
    overflow-y: auto;
  }

  .navbar-collapse.show {
    opacity: 1;
    pointer-events: auto;
  }

  .navbar-collapse .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-evenly !important;
    margin: 0 !important;
    padding: 5rem 2rem 3rem;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    list-style: none;
  }

  .navbar-collapse .nav-item {
    text-align: center;
  }

  .navbar-collapse .nav-link {
    font-size: 1.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    color: var(--text-primary) !important;
    display: inline-block;
  }

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

  .navbar-collapse .btn-resume {
    font-size: 1.1rem;
    padding: 2rem 2rem !important;
    display: inline-block;
  }

  .mobile-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1061;
  }

  .lang-toggle {
    margin-left: 0;
  }
}

@media (min-width: 992px) {
  .lang-toggle[data-pill],
  .theme-toggle[data-pill] {
    position: relative;
    width: 80px;
    height: 34px;
    border-radius: 17px;
    padding: 0;
    overflow: hidden;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    margin-left: 0.5rem;
  }

  .lang-toggle[data-pill]:hover,
  .theme-toggle[data-pill]:hover {
    border-color: var(--accent-crimson);
    color: inherit;
  }

  .lang-toggle[data-pill] .pill-opt,
  .theme-toggle[data-pill] .pill-opt {
    position: relative;
    z-index: 2;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.3s var(--ease-smooth);
    font-size: 0.65rem;
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    pointer-events: none;
  }

  .lang-toggle[data-pill] .pill-knob,
  .theme-toggle[data-pill] .pill-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    border-radius: 14px;
    background: var(--accent-crimson);
    transition: transform 0.35s var(--ease-bounce);
    z-index: 1;
  }

  /* Lang pill: knob slides right when ES is active */
  html[lang="es"] .lang-toggle[data-pill] .pill-knob {
    transform: translateX(calc(100% + 6px));
  }

  /* Lang pill: active label turns white */
  html[lang="en"] .lang-toggle[data-pill] .pill-opt:first-child,
  html[lang="es"] .lang-toggle[data-pill] .pill-opt:nth-child(2) {
    color: #fff;
  }

  /* Theme pill: knob slides right when light mode */
  [data-theme="light"] .theme-toggle[data-pill] .pill-knob {
    transform: translateX(calc(100% + 6px));
  }

  /* Theme pill: active icon turns white */
  body:not([data-theme="light"]) .theme-toggle[data-pill] .pill-opt:first-child,
  [data-theme="light"] .theme-toggle[data-pill] .pill-opt:nth-child(2) {
    color: #fff;
  }

  @media (prefers-reduced-motion: reduce) {
    .lang-toggle[data-pill] .pill-knob,
    .theme-toggle[data-pill] .pill-knob {
      transition: none;
    }
  }
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: url("../assets/icons/grid-pattern.svg");
  background-size: 60px 60px;
  opacity: 0.04;
  will-change: transform;
  pointer-events: none;
}

.hero-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
  width: 100%;
}

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

.hero-visual {
  flex: 1;
  min-width: 0;
  height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", "Space Grotesk", sans-serif;
  min-height: 1.2em;
}

.hero-title .char {
  display: inline-block;
  transition: font-family 0.3s;
}

.hero-title .char.resolved {
  font-family: "Space Grotesk", sans-serif;
}

.hero-tagline {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

.tagline-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transition:
    opacity 0.5s ease,
    filter 0.5s ease;
}

.tagline-word.revealed {
  opacity: 1;
  filter: blur(0);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -50%;
  width: 300%;
  height: 300%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  animation: grain 6s steps(8) infinite;
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  12% {
    transform: translate(-5%, -8%);
  }
  25% {
    transform: translate(-12%, 4%);
  }
  37% {
    transform: translate(7%, -12%);
  }
  50% {
    transform: translate(-3%, 9%);
  }
  62% {
    transform: translate(10%, -3%);
  }
  75% {
    transform: translate(-8%, 6%);
  }
  87% {
    transform: translate(4%, -10%);
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(6px);
  }
}

section {
  padding: 6rem 0;
}

main > section:nth-child(odd) {
  background-color: var(--bg-secondary);
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.about-text p:first-of-type {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-canvas-wrapper {
  width: 320px;
  height: 320px;
  position: relative;
}

.about-canvas-wrapper canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Mexico Map (Hero) ---------- */

.mexico-map {
  width: 100%;
  height: 100%;
  max-width: 500px;
}

.mexico-outline {
  fill: var(--bg-secondary);
  fill-opacity: 0.15;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.35;
}

.tepic-pin {
  fill: var(--accent-crimson);
  r: 6;
}

.tepic-pulse {
  fill: none;
  stroke: var(--accent-crimson);
  stroke-width: 2.5;
  transform-origin: 0 0;
  animation: tepicPulse 2.2s ease-out infinite;
}

.tepic-pulse-outer {
  animation-delay: 0.7s;
}

@keyframes tepicPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  100% {
    transform: scale(11.25);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tepic-pulse {
    animation: none;
    opacity: 0.3;
  }

  .hero::after {
    animation: none;
  }
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.skill-group-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.skill-group-title:first-child {
  margin-top: 0;
}

.skill-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: default;
  transition:
    transform 0.3s var(--ease-smooth),
    border-color 0.3s var(--ease-smooth),
    box-shadow 0.3s var(--ease-smooth);
}

.skill-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent-crimson);
  box-shadow: 0 0 12px rgba(var(--accent-crimson-rgb), 0.15);
}

.skills-philosophy {
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2rem;
  font-size: 0.95rem;
}

.project-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-smooth),
    box-shadow 0.4s var(--ease-smooth),
    border-color 0.4s var(--ease-smooth);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-crimson);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-smooth);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(
    135deg,
    var(--bg-secondary),
    var(--surface-elevated)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.project-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.btn-project {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: var(--accent-crimson);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  text-align: center;
  align-self: flex-start;
}

.btn-project:hover {
  background: var(--accent-crimson-dark);
  box-shadow: 0 0 20px rgba(var(--accent-crimson-rgb), 0.3);
  color: #fff;
}

.project-card.featured {
  border-color: rgba(var(--accent-crimson-rgb), 0.2);
}

.project-card.featured .project-card-img-placeholder {
  height: 240px;
}

.project-card.coming-soon {
  cursor: default;
}

.project-card.coming-soon .project-card-img-placeholder {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-warm-dark));
}

.coming-soon-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.75rem;
}

.pawn-icon {
  color: var(--accent-gold);
  opacity: 0.6;
  transition: all 0.5s var(--ease-smooth);
}

.project-card.coming-soon:hover .pawn-icon {
  opacity: 1;
  transform: rotate(12deg);
}

.project-card.coming-soon::before {
  background: var(--accent-gold);
}

.interactive-element:hover {
  box-shadow: 0 0 20px rgba(var(--accent-crimson-rgb), 0.15);
}

.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-crimson);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 3rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-crimson);
  border: 2px solid var(--bg-primary);
}

.timeline-role {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-company {
  color: var(--accent-crimson);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.timeline-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-1px);
  }

  .timeline-item {
    width: 45%;
    padding-left: 0;
    padding-right: 2rem;
  }

  .timeline-item::before {
    left: auto;
    right: -6px;
  }

  .timeline-item:nth-child(even) {
    margin-left: 55%;
    padding-left: 2rem;
    padding-right: 0;
  }

  .timeline-item:nth-child(even)::before {
    left: -6px;
    right: auto;
  }
}

.contact-section {
  background-color: var(--bg-primary);
}

.contact-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.contact-form .form-floating {
  margin-bottom: 1.25rem;
}

.contact-form .form-control {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 1rem 0.75rem;
  font-family: "Inter", sans-serif;
  transition:
    border-color 0.3s var(--ease-smooth),
    box-shadow 0.3s var(--ease-smooth);
}

.contact-form .form-control:focus {
  background: var(--input-bg);
  border-color: var(--accent-crimson);
  box-shadow: 0 0 0 3px rgba(var(--accent-crimson-rgb), 0.15);
  color: var(--text-primary);
}

.contact-form .form-floating label {
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
}

.contact-form textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn-submit {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  background: var(--accent-crimson);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  width: 100%;
}

.btn-submit:hover {
  background: var(--accent-crimson-dark);
  box-shadow: 0 0 20px rgba(var(--accent-crimson-rgb), 0.3);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-submit.sent {
  background: var(--color-success);
}

.btn-submit.error {
  background: transparent;
  color: var(--accent-crimson);
  box-shadow: inset 0 0 0 1px var(--accent-crimson);
}

.contact-direct {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-direct a {
  color: var(--text-primary);
  transition: color 0.3s var(--ease-smooth);
}

.contact-direct a:hover {
  color: var(--accent-crimson);
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icons a {
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: all 0.3s var(--ease-smooth);
}

.social-icons a:hover {
  color: var(--accent-crimson);
  transform: translateY(-2px);
}

.form-control.is-invalid {
  border-color: var(--accent-crimson);
}

.form-control.is-valid {
  border-color: var(--color-success);
}

.invalid-feedback {
  font-size: 0.8rem;
  color: var(--accent-crimson);
}

.site-footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-dot {
  color: var(--accent-crimson);
  margin: 0 0.5rem;
}

.site-footer .social-icons {
  justify-content: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.55s var(--ease-out-expo),
    transform 0.55s var(--ease-out-expo);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.55s var(--ease-out-expo),
    transform 0.55s var(--ease-out-expo);
}

.slide-in-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.55s var(--ease-out-expo),
    transform 0.55s var(--ease-out-expo);
}

.slide-in-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.5s var(--ease-out-expo),
    transform 0.5s var(--ease-out-expo);
}

.scale-in.is-visible {
  opacity: 1;
  transform: scale(1);
}

.about-visual.fade-up {
  transition-delay: 0.1s;
}

.skill-chip.fade-up:nth-child(2) {
  transition-delay: 0.04s;
}

.skill-chip.fade-up:nth-child(3) {
  transition-delay: 0.08s;
}

.skill-chip.fade-up:nth-child(4) {
  transition-delay: 0.12s;
}

.skill-chip.fade-up:nth-child(5) {
  transition-delay: 0.16s;
}

#projects .col-lg-4:nth-child(2) .slide-in-right {
  transition-delay: 0.1s;
}

#projects .col-lg-4:nth-child(3) .slide-in-left {
  transition-delay: 0.2s;
}

.timeline-item.fade-up:nth-child(2) {
  transition-delay: 0.1s;
}

.timeline-item.fade-up:nth-child(3) {
  transition-delay: 0.2s;
}

.col-lg-5.fade-up {
  transition-delay: 0.1s;
}

.fade-up.is-visible,
.scale-in.is-visible {
  opacity: var(--exit-opacity, 1);
  transform: translateY(var(--exit-y, 0)) scale(var(--exit-scale, 1));
}

.slide-in-left.is-visible,
.slide-in-right.is-visible {
  opacity: var(--exit-opacity, 1);
  transform: translateX(0) translateY(var(--exit-y, 0)) scale(var(--exit-scale, 1));
}

@media (max-width: 575.98px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  section {
    padding: 3.5rem 0;
  }

  h2 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .hero {
    min-height: 100svh;
    padding-top: 70px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-tagline {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  }

  .hero-visual {
    height: 200px;
  }

  .scroll-indicator {
    bottom: 1.5rem;
  }

  .about-photo-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
  }

  .about-canvas-wrapper {
    width: 240px;
    height: 240px;
    margin: 0 auto 1.5rem;
  }

  .about-text p {
    font-size: 0.95rem;
  }

  .skills-grid {
    gap: 0.5rem;
  }

  .skill-chip {
    font-size: 0.75rem;
    padding: 0.45rem 0.85rem;
  }

  .project-card-img-placeholder {
    height: 170px;
  }

  .project-card.featured .project-card-img-placeholder {
    height: 190px;
  }

  .project-card-body {
    padding: 1.25rem;
  }

  .project-card-title {
    font-size: 1.1rem;
  }

  .project-card-desc {
    font-size: 0.85rem;
  }

  .btn-project {
    width: 100%;
    text-align: center;
    padding: 0.6rem 1rem;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 0;
    margin-left: 0;
    margin-bottom: 2rem;
  }

  .timeline-item::before,
  .timeline-item:nth-child(even)::before {
    left: -5px;
    right: auto;
  }

  .timeline-role {
    font-size: 1rem;
  }

  .timeline-desc {
    font-size: 0.85rem;
  }

  .contact-form .form-control {
    font-size: 1rem;
    padding: 1rem 0.85rem;
  }

  .contact-form textarea.form-control {
    min-height: 120px;
  }

  .btn-submit {
    padding: 0.85rem 2rem;
    font-size: 1rem;
  }

  .navbar-collapse .nav-link {
    font-size: 1.3rem;
    padding: 0.5rem 0 !important;
  }

  .navbar-collapse .btn-resume {
    font-size: 1rem;
    padding: 1rem 2rem !important;
  }

  .site-footer {
    padding: 1.5rem 0;
    font-size: 0.8rem;
  }
}

@media (max-width: 767.98px) {
  .hero-row {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual {
    height: 250px;
    width: 100%;
    margin-top: 0;
  }

  .about-visual {
    order: -1;
    margin-bottom: 1.5rem;
  }

  .contact-direct {
    text-align: center;
  }

  .contact-direct .social-icons {
    justify-content: center;
  }

  .project-card:hover {
    transform: none;
  }

  .skill-chip:hover {
    transform: none;
  }

  #projects .row {
    gap: 0;
  }
}
