/* ============ Tokens ============ */
:root {
  --bg: #1f0021;
  --accent: #f5ff00;
  --text: #ffffff;
  --muted: #a99aae;
  --line: rgba(255, 255, 255, .22);
  --pad: clamp(24px, 7vw, 100px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
img { display: block; max-width: 100%; }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Icono genérico con máscara (hereda color del texto) */
.icon, .tech__icon {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}

/* ============ Nav ============ */
.nav {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: clamp(20px, 4.4vw, 64px);
  padding: 10px clamp(20px, 3.9vw, 56px);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  color: var(--muted);
  backdrop-filter: blur(6px);
}
.nav a { transition: color .2s; white-space: nowrap; }
.nav a:hover,
.nav a.is-active { color: var(--accent); }

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: 200px;
  padding-bottom: 100px;
  min-height: 560px;
}

.hero__bg {
  position: absolute;
  top: 0;
  right: 0;
  width: min(1248px, 100%);
  height: 100%;
  object-fit: cover;
  object-position: right top;
  /* funde la imagen con el fondo a la izquierda y abajo */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 35%), linear-gradient(to bottom, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent 0, #000 35%), linear-gradient(to bottom, #000 70%, transparent 100%);
          mask-composite: intersect;
}

.hero__content { position: relative; z-index: 1; }
/* Degradado oscuro difuso detrás del texto: mejora la lectura sobre la foto sin tocar el resto */
.hero__content::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40px;
  bottom: -40px;
  left: -120px;
  width: min(820px, 66vw);
  background: radial-gradient(ellipse at 35% 50%, rgba(31, 0, 33, .88) 0%, rgba(31, 0, 33, .6) 50%, rgba(31, 0, 33, 0) 100%);
  pointer-events: none;
}
.hero h1, .hero p { text-shadow: 0 2px 14px rgba(31, 0, 33, .9), 0 0 3px rgba(31, 0, 33, .6); }
.social .icon { filter: drop-shadow(0 2px 6px rgba(31, 0, 33, .9)); }
.hero__logo { width: 80px; height: auto; margin-bottom: 20px; }

.hero h1 {
  max-width: 620px;
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.hero p {
  max-width: 640px;
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
  font-weight: 300;
}

.social { display: flex; gap: 28px; margin-top: 24px; color: var(--muted); }
.social .icon { width: 24px; height: 24px; transition: color .2s; }
.social a:hover { color: var(--accent); }

/* ============ Proyectos (Swiper) ============ */
.projects { padding-block: 24px 40px; }

.projects__slider { overflow: hidden; padding-block: 36px; }
/* movimiento continuo y uniforme (sin aceleración entre slides) */
.projects__slider .swiper-wrapper { transition-timing-function: linear; }

.project.swiper-slide {
  width: clamp(260px, 25vw, 360px);
  aspect-ratio: 1 / 0.85;
  display: block;
  transform: rotate(var(--r, 0deg));
  transition: transform .4s ease;
  border-radius: 5px;
  overflow: hidden;
}

.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;                       /* estado base: con opacidad */
  transition: opacity .4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* Solo con mouse encima se ve la imagen sin opacidad */
.project:hover img,
.project:focus-visible img { opacity: 1; }
.project:hover { transform: rotate(var(--r, 0deg)) scale(1.02); }

/* Táctil (no hay hover): el slide centrado se ve completo */
@media (hover: none) {
  .project.swiper-slide-active img { opacity: 1; }
}

/* ============ Tecnologias ============ */
.tech { padding-block: 60px 80px; }

.tech__head { display: flex; align-items: center; gap: 14px; }
.tech__head h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .05);
}
.tech__line { flex: 1; height: 1px; background: var(--line); }

.tech__list {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(28px, 5.5vw, 80px);
  margin-top: 28px;
}
.tech__icon {
  width: 80px;
  height: 80px;
  color: rgba(255, 255, 255, .01);
  transition: color .25s;
}
.tech__icon--wide { width: 134px; }
/* .tech__icon:hover { color: var(--muted); } */

/* ============ Contacto ============ */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-block: 100px 150px;
}

.contact__cta::before {
  content: "";
  display: block;
  width: 190px;
  height: 4px;
  margin-bottom: 24px;
  background: var(--accent);
}
.contact__cta h2 {
  max-width: 360px;
  font-size: clamp(30px, 3.5vw, 36px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--muted);
}
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 20px;
  transition: color .2s, gap .2s;
}
.contact__link .icon { width: 24px; height: 24px; }
.contact__link:hover { color: var(--accent); gap: 14px; }

.contact__list { display: grid; gap: 18px; justify-self: start; padding-top: 4px; }
.contact__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  color: var(--muted);
}
.contact__list .icon { width: 24px; height: 24px; flex: none; }
.contact__list a { display: flex; align-items: center; gap: 14px; transition: color .2s; }
.contact__list a:hover { color: var(--accent); }
.contact__list .is-accent { color: var(--accent); }
.contact__list .is-accent a:hover .contact__text { text-decoration: underline; }

/* ============ Footer ============ */
.footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding-block: 32px 40px;
  font-size: 16px;
  font-weight: 100;
  color: rgba(255, 255, 255, .15);
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: var(--line);
}
.footer p { display: flex; align-items: center; gap: 6px; }
.footer .icon { width: 16px; height: 16px; }

/* ============ Responsive ============ */
/* Filtro de la foto del hero por debajo de 1500px */
@media (max-width: 1499px) {
  .hero__bg { filter: brightness(.3); }
}
/* Hasta 900px (móvil/tablet): imagen arriba (banner) y texto debajo, sin superponerse */
@media (max-width: 900px) {
  .hero { padding-top: 0; padding-bottom: 60px; min-height: 0; }
  .hero__bg {
    position: relative;
    width: 100%;
    height: clamp(240px, 62vw, 460px);
    object-position: 78% 30%;
    filter: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    -webkit-mask-composite: source-over;
            mask-composite: add;
  }
  .hero__content { margin-top: -56px; }
  .hero__content::before { display: none; }
}

@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .tech__list { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .nav { top: 20px; font-size: 14px; gap: 16px; padding: 8px 18px; }
  .hero p { font-size: 16px; }
  .contact__list li { font-size: 17px; }
  .tech__icon { width: 56px; height: 56px; }
  .tech__icon--wide { width: 94px; }
}

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