/* ==========================================================
   Tokens (tomados de las variables del diseño en Figma)
   ========================================================== */
:root {
  --color-principal: #8f2a4b;
  --color-dark: #290c16;
  --rosa-petalo: #ffbaba;
  --rosa-electrico: #ff82b3;
  --color1: #f9e9ff;
  --white: #ffffff;
  --btn-text: #9d4646;
  --glass: rgba(255, 255, 255, 0.2);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-card: "Poppins", system-ui, sans-serif;

  --radius-lg: 16px;
  --radius-full: 1000px;

  --shadow-normal: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1);

  --gutter: 70px;
  --container: 1523px;
  --header-h: 80px;

  /* Tipografía fluida: el valor máximo coincide con el diseño a 1663px */
  --fs-hero: clamp(2.5rem, 4.93vw, 82px);
  --fs-h2: clamp(2.25rem, 3.85vw, 64px);
  --fs-h2-sm: clamp(2rem, 2.9vw, 48px);
  --fs-xl: clamp(1.5rem, 2.17vw, 36px);
  --fs-lg: clamp(1.25rem, 1.93vw, 32px);
  --fs-md: clamp(1.25rem, 1.69vw, 28px);
  --fs-body: clamp(1.0625rem, 1.45vw, 24px);
  --fs-sm: clamp(1rem, 1.2vw, 20px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--white);
  background: var(--color-dark);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.page {
  position: relative;
  overflow-x: clip;
  background: linear-gradient(to bottom, var(--color-principal), var(--color-dark));
}

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: normal;
}

.section-title--center {
  text-align: center;
}

/* ==========================================================
   Botones
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 2;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-full);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--rosa-petalo);
  outline-offset: 3px;
}

.btn--white {
  background: var(--white);
  color: var(--color-principal);
  border: 2px solid var(--white);
  padding: 8px 32px;
  box-shadow: var(--shadow-medium);
}

.btn--outline {
  color: var(--white);
  border: 2px solid var(--white);
  padding: 8px 32px;
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--pink {
  background: var(--rosa-electrico);
  color: var(--white);
  font-size: var(--fs-sm);
  padding: 6px 22px;
  box-shadow: var(--shadow-normal);
}

.btn--pink:hover {
  background: #ff6ba3;
}

.btn--lg {
  font-size: var(--fs-lg);
}

.btn--md {
  font-size: var(--fs-body);
}

/* Botón "Hablemos": en el diseño su texto usa un tono distinto */
.hero .btn--white {
  color: var(--btn-text);
  border: 0;
}

/* ==========================================================
   Header
   ========================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-normal);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 13.1vw, 218px);
  height: 100%;
  padding: 4px 16px;
}

.nav__item {
  position: relative;
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  padding-top: 7px;
}

.nav__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 30px;
  background: var(--rosa-petalo);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav__item:hover::before,
.nav__item.is-active::before {
  transform: scaleX(1);
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  padding-block: var(--gutter);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.hero__pill-row {
  display: flex;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 50px;
  background: var(--glass);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.4;
  text-align: center;
}

.pill strong {
  font-weight: 800;
}

.hero__main {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.hero__title {
  flex: 0 1 935px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: normal;
}

.hero__lead {
  flex: 0 1 564px;
  padding-block: 20px;
  font-size: var(--fs-body);
  line-height: 1.4;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero__question {
  font-size: var(--fs-lg);
  line-height: normal;
}

/* Arcoíris decorativo */
.page__rainbow {
  position: absolute;
  top: 441px;
  right: -86px;
  width: 500px;
  height: 500px;
  pointer-events: none;
}

/* ==========================================================
   Servicios
   ========================================================== */
.services {
  padding-block: var(--gutter);
}

.services__inner {
  display: flex;
  align-items: center;
  gap: 64px;
}

.services__title {
  flex: 0 0 352px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: normal;
}

.services__grid {
  flex: 0 1 1081px;
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 100px;
}

.service {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: var(--glass);
}

.service__name {
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.4;
}

.service__text {
  margin-top: -12px; /* gap de 4px entre título y texto */
  font-size: var(--fs-sm);
  line-height: 1.4;
}

/* ==========================================================
   Proceso
   ========================================================== */
.process {
  position: relative;
  overflow: clip;
  padding-block: 100px;
}

.process__deco {
  position: absolute;
  top: -11px;
  bottom: 11px;
  left: -26px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: end;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 96px;
  line-height: 96px;
  color: var(--rosa-petalo);
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
}

.process__deco span {
  font-weight: 400;
}

.process__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 50px;
}

.process__header {
  text-align: right;
}

.process__subtitle {
  max-width: 791px;
  margin-left: auto;
  font-size: var(--fs-xl);
  line-height: 1.4;
}

.steps {
  list-style: none;
  padding: 0;
  width: min(1079px, 100%);
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.step {
  display: grid;
  grid-template-columns: minmax(80px, 106px) 1fr;
  align-items: center;
  gap: 40px;
}

.step__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: normal;
  text-align: right;
}

.step__text {
  font-size: var(--fs-body);
  line-height: 1.4;
}

.step__text strong {
  font-weight: 700;
}

/* ==========================================================
   Interfaces
   ========================================================== */
.interfaces {
  padding-block: var(--gutter);
}

.iface-list {
  display: flex;
  flex-direction: column;
  gap: 100px;
  margin-top: 50px;
}

.iface {
  /* Sistema de coordenadas del collage (en px del diseño). */
  --vx: 0;
  --vy: 0;
  position: relative;
  display: flex;
  align-items: center;
  aspect-ratio: var(--vw) / var(--vh);
  padding: 50px 80px;
  border: 1px solid var(--white);
  border-radius: var(--radius-lg);
}

.iface--mobile,
.iface--devices {
  background: linear-gradient(to right, rgba(255, 186, 186, 0.5), rgba(255, 255, 255, 0.5) 75.481%);
}

.iface--web {
  align-items: flex-start;
  justify-content: flex-end;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.5) 24.519%, rgba(255, 186, 186, 0.5));
}

.iface--mobile { --vw: 1521; --vh: 543; }
.iface--web { --vw: 1521; --vh: 798; }
.iface--devices { --vw: 1521; --vh: 668; }

.iface__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-body);
  line-height: 1.4;
}

.iface__text p + p {
  margin-top: 1.4em; /* línea en blanco entre párrafos, como en el diseño */
}

.iface__text strong {
  font-weight: 700;
}

.iface__title {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  line-height: normal;
}

.iface--mobile .iface__text {
  width: min(427px, 30%);
  gap: 24px;
}

.iface--mobile .iface__title {
  margin-bottom: 0;
}

.iface--mobile .iface__text p + p {
  margin-top: calc(1.4em - 24px);
}

.iface--web .iface__text {
  width: min(654px, 43%);
}

.iface--devices .iface__text {
  width: min(615px, 40%);
}

.collage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: var(--vw) / var(--vh);
  pointer-events: none;
}

.shot {
  position: absolute;
  left: calc((var(--x) - var(--vx)) / var(--vw) * 100%);
  top: calc((var(--y) - var(--vy)) / var(--vh) * 100%);
  width: calc(var(--w) / var(--vw) * 100%);
  height: calc(var(--h) / var(--vh) * 100%);
  overflow: hidden;
}

.shot--rounded {
  border-radius: var(--radius-lg);
}

.shot img {
  position: absolute;
  max-width: none;
}

.shot img.cover {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================
   Proyectos
   ========================================================== */
.projects {
  padding-block: var(--gutter);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 30px;
  row-gap: 100px;
  margin-top: 50px;
}

.project {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 50px 46px;
  border: 1px solid var(--color1);
  border-radius: var(--radius-lg);
  color: var(--color1);
}

.project--filled {
  justify-content: flex-start;
  padding: 20px 0;
  background: var(--glass);
}

.project--filled .project__info {
  padding: 20px 46px;
}

.project__media {
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project__media--image {
  margin-inline: 20px;
  height: 297px;
}

.project__media--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project__media--screens {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-self: center;
  width: min(713px, 100% - 32px);
  aspect-ratio: 713 / 346;
}

.project__media--screens img {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 231 / 500;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.project__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project__date {
  font-size: var(--fs-sm);
  line-height: 2;
}

.project__title {
  margin-top: 4px;
  font-family: var(--font-card);
  font-weight: 700;
  font-size: var(--fs-xl);
  line-height: 1.4;
}

.project__text {
  margin-top: 4px;
  font-size: var(--fs-body);
  line-height: 2;
}

.project__info .btn {
  margin-top: 16px;
}

/* ==========================================================
   Sobre mí
   ========================================================== */
.about {
  padding-block: var(--gutter);
  background: linear-gradient(to left, var(--color-principal) 6.4%, var(--rosa-petalo));
}

.about__inner {
  display: flex;
  align-items: flex-start;
  gap: 70px;
}

.about__intro {
  flex: 0 1 633px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about__kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-lg);
}

.about__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: normal;
}

.about__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 633 / 391;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.about__body {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.4em;
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.4;
  text-align: right;
}

.about__body p {
  max-width: 751px;
}

.about__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
  margin-top: calc(24px - 1.4em);
}

.about__buttons .btn--white {
  box-shadow: none;
}

/* ==========================================================
   Contacto
   ========================================================== */
.contact {
  position: relative;
  overflow: hidden;
  padding-block: 100px;
  background: var(--color-principal);
}

.contact__deco {
  position: absolute;
  top: 126px;
  right: -71px;
  width: 400px;
  height: 400px;
  pointer-events: none;
}

.contact__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2-sm);
  line-height: normal;
}

.contact__text {
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.8;
}

.contact__big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: normal;
}

.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.contact__info {
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 52px;
}

.contact__info a {
  text-decoration: none;
}

.contact__info a:hover {
  text-decoration: underline;
}

.contact__sep {
  margin-inline: 0.75em;
}

/* ==========================================================
   Responsive
   ========================================================== */

/* El texto vertical decorativo solo entra cuando hay espacio a la izquierda */
@media (max-width: 1500px) {
  .process__deco {
    display: none;
  }
}

/* Las tarjetas de interfaces pasan a texto + collage apilados */
@media (max-width: 1400px) {
  .iface {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
    aspect-ratio: auto;
    padding: 40px;
  }

  .iface .iface__text {
    width: auto;
    max-width: 654px;
  }

  .iface .collage {
    position: relative;
  }

  .iface--mobile { --vx: 565; --vy: -57; --vw: 931; --vh: 587; }
  .iface--web { --vx: -15; --vy: -54; --vw: 1516; --vh: 829; }
  .iface--devices { --vx: 772; --vy: 70.5; --vw: 715; --vh: 528; }
}

@media (max-width: 1100px) {
  .hero__main,
  .services__inner,
  .about__inner {
    flex-direction: column;
  }

  .hero__title,
  .hero__lead,
  .services__title,
  .services__grid,
  .about__intro {
    flex: none;
  }

  .services__inner {
    align-items: flex-start;
    gap: 48px;
  }

  .services__grid {
    width: 100%;
    margin-left: 0;
    gap: 56px 48px;
  }

  .about__inner {
    gap: 40px;
  }

  .about__body {
    align-items: flex-start;
    text-align: left;
  }

  .about__buttons {
    justify-content: flex-start;
  }

  .projects__grid {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }

  .page__rainbow {
    width: 300px;
    height: 300px;
    top: 420px;
    right: -90px;
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 20px;
    --header-h: 64px;
  }

  .hero__inner {
    gap: 32px;
  }

  .pill {
    font-size: 0.95rem;
  }

  .services__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .process {
    padding-block: 64px;
  }

  .process__header {
    text-align: left;
    align-self: flex-start;
  }

  .step {
    grid-template-columns: 64px 1fr;
    gap: 16px;
    align-items: start;
  }

  .step__num {
    text-align: left;
  }

  .iface {
    padding: 24px;
  }

  .iface-list {
    gap: 40px;
  }

  .project,
  .project--filled .project__info {
    padding-inline: 20px;
  }

  .project__media--image {
    height: auto;
    aspect-ratio: 787 / 332;
  }

  .contact {
    padding-block: 64px;
  }

  .contact__deco {
    width: 220px;
    height: 220px;
    top: auto;
    bottom: -40px;
    right: -60px;
  }

  .contact__info {
    line-height: 1.6;
  }

  .contact__sep {
    display: none;
  }

  .contact__info a {
    display: block;
  }

  .page__rainbow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .nav__item::before {
    transition: none;
  }
}
