/* ==========================================================================
   Diple Studio · Under construction
   Tokens tomados del manual corporativo (Figma · Manual corporativo)
   ========================================================================== */

:root {
  /* Color */
  --tinta-900: #1a1a1a;
  --papel-000: #ffffff;
  --cian-700: #0e5c6b;
  --carbon-900: #0d1112;
  --indigo-600: #5146d8;

  /* Tipografía */
  --font-titulares: "Rubik", system-ui, sans-serif;
  --font-texto: "Work Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --gutter: clamp(20px, 8.33vw, 160px);

  /* Movimiento */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-entrance: cubic-bezier(0.22, 0.61, 0.36, 1);
  --entrance-duration: 1600ms;
  --entrance-delay: 350ms;
  --entrance-stagger: 140ms;
  --background-duration: 3200ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel-000);
  color: var(--tinta-900);
  font-family: var(--font-texto);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

p,
h1,
h2 {
  margin: 0;
}

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

/* ==========================================================================
   Estructura: rótulo arriba · imagen respira · respuesta abajo · créditos
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
}

/* Fondo ------------------------------------------------------------------- */

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  animation: settle var(--background-duration) var(--ease-entrance) both;
}

.hero__shade {
  position: absolute;
  inset: auto 0 0 0;
  z-index: -1;
  height: max(48%, 420px);
  background: linear-gradient(
    to bottom,
    rgb(13 17 18 / 0) 0%,
    rgb(13 17 18 / 0.55) 45%,
    rgb(13 17 18 / 0.88) 100%
  );
}

/* Rótulo superior -------------------------------------------------------- */

.hero__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(24px, 5.4vh, 58px) var(--gutter) 0;
  text-align: center;
}

.hero__logo {
  width: clamp(120px, 10.42vw, 200px);
  height: auto;
  margin-bottom: clamp(18px, 4.4vh, 47px);
}

.hero__kicker {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
  color: var(--cian-700);
  margin-bottom: clamp(12px, 1.7vh, 18px);
}

.hero__title {
  font-family: var(--font-titulares);
  font-weight: 300;
  font-size: clamp(36px, 4.58vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--tinta-900);
  text-wrap: balance;
}

/* Respuesta inferior ----------------------------------------------------- */

.hero__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--gutter) 40px;
  color: var(--papel-000);
}

.hero__subtitle {
  font-family: var(--font-titulares);
  font-weight: 400;
  font-size: clamp(28px, 2.5vw, 48px);
  line-height: 1.125;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}

.hero__text {
  max-width: 620px;
  font-size: 17px;
  line-height: 28px;
  color: rgb(255 255 255 / 0.78);
  margin-bottom: 32px;
}

/* CTA -------------------------------------------------------------------- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: 6px;
  background: var(--papel-000);
  color: var(--tinta-900);
  font-family: var(--font-texto);
  font-weight: 500;
  font-size: 15px;
  line-height: 24px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cta:hover {
    background: var(--indigo-600);
    color: var(--papel-000);
  }
}

.cta:active {
  transform: scale(0.97);
  background: var(--indigo-600);
  color: var(--papel-000);
}

.cta:focus-visible {
  outline: 2px solid var(--papel-000);
  outline-offset: 3px;
}

/* Créditos --------------------------------------------------------------- */

.hero__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter) 48px;
}

.hero__copy {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
  color: rgb(255 255 255 / 0.6);
}

.hero__social {
  display: flex;
  gap: 24px;
}

.hero__social a {
  font-size: 13px;
  line-height: 20px;
  color: rgb(255 255 255 / 0.75);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero__social a:hover {
    color: var(--papel-000);
    text-decoration: underline;
  }
}

.hero__social a:focus-visible {
  outline: 2px solid var(--papel-000);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Saltos de línea según dispositivo -------------------------------------- */

.br-mobile {
  display: none;
}

/* ==========================================================================
   Móvil y tablet vertical
   ========================================================================== */

@media (max-width: 640px) {
  .br-mobile {
    display: inline;
  }

  .br-desktop {
    display: none;
  }

  .hero__top {
    padding-top: 24px;
  }

  .hero__logo {
    margin-bottom: 18px;
  }

  .hero__title {
    line-height: 1.167;
    letter-spacing: -0.01em;
  }

  .hero__subtitle {
    margin-bottom: 12px;
  }

  .hero__text {
    font-size: 15px;
    line-height: 24px;
    margin-bottom: 24px;
  }

  .hero__bottom {
    padding-bottom: 24px;
  }

  .hero__bottom > .reveal {
    width: 100%;
  }

  .cta {
    width: 100%;
  }

  .hero__footer {
    flex-direction: column-reverse;
    gap: 10px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 900px) {
  .br-desktop {
    display: none;
  }
}

/* Pantallas verticales con la imagen de escritorio (tablets): centrar en las figuras */
@media (max-aspect-ratio: 1/1) {
  .hero__bg img {
    object-position: 38% 50%;
  }
}

/* Portátiles bajos (1366×768, 1440×900…): el bloque inferior baja un poco */
@media (min-width: 641px) and (max-height: 860px) {
  .hero__subtitle {
    margin-bottom: 12px;
  }

  .hero__text {
    font-size: 16px;
    line-height: 26px;
    margin-bottom: 24px;
  }

  .hero__bottom {
    padding-bottom: 28px;
  }

  .hero__footer {
    padding-bottom: 32px;
  }
}

/* Móviles estrechos: el titular cabe en dos líneas */
@media (max-width: 400px) {
  .hero__title {
    font-size: 32px;
  }
}

/* Móviles bajos (360×640, SE…): todo más compacto y la imagen anclada arriba */
@media (max-width: 640px) and (max-height: 720px) {
  .hero__bg img {
    object-position: 50% 0%;
  }

  .hero__top {
    padding-top: 16px;
  }

  .hero__logo {
    width: 100px;
    margin-bottom: 12px;
  }

  .hero__kicker {
    margin-bottom: 8px;
  }

  .hero__subtitle {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .hero__text {
    font-size: 14px;
    line-height: 22px;
    margin-bottom: 20px;
  }

  .cta {
    padding-block: 14px;
  }
}

/* ==========================================================================
   Animación de entrada: un único momento orquestado
   ========================================================================== */

.reveal {
  animation: rise var(--entrance-duration) var(--ease-entrance) both;
  animation-delay: calc(var(--entrance-delay) + var(--i, 0) * var(--entrance-stagger));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: scale(1.065);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: fade 400ms ease both;
    animation-delay: 0ms;
  }

  .hero__bg img {
    animation: fade 400ms ease both;
  }
}
