/* TMX Concretos — paleta y tipografía según Manual de Identidad Corporativa 2025 */
:root {
  --rojo: #c63a36;        /* PMS 1795 C */
  --rojo-oscuro: #a52d2a;
  --amarillo: #f1b747;    /* PMS 1235 C */
  --blanco: #ffffff;
  --negro: #1a1a1a;

  --font-display: "Lexend", "Neo Chic", system-ui, sans-serif;     /* primaria: Neo Chic Bold */
  --font-body: "Barlow", "DIN Next LT Pro", system-ui, sans-serif; /* secundaria: DIN Next LT Pro */

  --greca-h: clamp(28px, 4vh, 40px);
  --corte: 14vw;            /* ancho del corte diagonal */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

body {
  min-height: 100vh;
  background: var(--rojo);
  color: var(--blanco);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- Layout ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
}

/* ---------- Panel rojo (izquierda, corte diagonal como en el manual) ---------- */
.panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(20px, 4vh, 48px);
  margin-right: calc(var(--corte) * -1);
  padding:
    clamp(24px, 6vh, 72px)
    calc(var(--corte) + clamp(20px, 3vw, 48px))
    calc(var(--greca-h) + clamp(16px, 3vh, 32px))
    clamp(20px, 5vw, 96px);
  background: var(--rojo);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--corte)) 100%, 0 100%);
  animation: telon 1.3s var(--ease) .1s both;
}

/* Al cargar, el panel cubre todo y se "abre" en diagonal revelando la obra */
@keyframes telon {
  from { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  to   { clip-path: polygon(0 0, 100% 0, calc(100% - var(--corte)) 100%, 0 100%); }
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 55%, rgba(0,0,0,.08) 100%);
  pointer-events: none;
}

.panel__inner {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-block: auto;
}

/* ---------- Entrada escalonada ---------- */
.reveal {
  animation: subir .9s var(--ease) both;
  animation-delay: calc(.55s + var(--i, 0) * .12s);
}

@keyframes subir {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Contenido ---------- */
.logo {
  width: clamp(120px, min(15vw, 24vh), 250px);
  height: auto;
  margin-bottom: clamp(18px, 4.5vh, 52px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(12px, 2.4vh, 22px);
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.35);
  font-weight: 600;
  font-size: clamp(.7rem, 1.6vh, .82rem);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.dot {
  width: 8px; height: 8px;
  flex: none;
  background: var(--amarillo);
  animation: pulso 1.8s ease-in-out infinite;
}

@keyframes pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

h1 {
  margin: 0 0 clamp(12px, 2.4vh, 22px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, min(4.4vw, 7.4vh), 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.accent {
  position: relative;
  display: inline-block;
  color: var(--amarillo);
}

/* Subrayado que se "cuela" bajo la palabra */
.accent::after {
  content: "";
  position: absolute;
  left: 0; right: .35em;
  bottom: -.06em;
  height: .09em;
  background: var(--amarillo);
  transform: scaleX(0);
  transform-origin: left;
  animation: colar .8s var(--ease) 1.5s forwards;
}

@keyframes colar { to { transform: scaleX(1); } }

.lead {
  margin: 0 0 clamp(20px, 4.4vh, 40px);
  max-width: 46ch;
  font-size: clamp(1rem, min(1.3vw, 2.3vh), 1.25rem);
  line-height: 1.55;
  color: rgba(255,255,255,.9);
}

/* ---------- Botón ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: clamp(14px, 2.2vh, 18px) 30px;
  overflow: hidden;
  background: var(--amarillo);
  color: var(--negro);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  /* esquinas cortadas, eco de las grecas angulosas del logotipo */
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: background-color .25s ease, transform .25s var(--ease);
}

/* Destello periódico */
.btn::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  transform: skewX(-20deg);
  animation: destello 4s ease-in-out 2.2s infinite;
}

@keyframes destello {
  0%   { left: -60%; }
  30%, 100% { left: 130%; }
}

.btn svg { position: relative; transition: transform .25s var(--ease); }
.btn:hover { background: var(--blanco); transform: translateY(-2px); }
.btn:hover svg { transform: translateX(5px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--blanco); outline-offset: 4px; }

.actions__note {
  font-size: .95rem;
  color: rgba(255,255,255,.75);
}

/* ---------- Pie ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.foot__sep { color: var(--amarillo); }

/* ---------- Foto (derecha) ---------- */
.visual {
  position: relative;
  z-index: 1;
  grid-column: 2;
  min-height: 100%;
  overflow: hidden;
  background: var(--negro);
}

/* Carrusel de proyectos: fundido cruzado + zoom lento en la foto activa */
.visual { --slide-ms: 6000ms; }

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.slide.is-active { opacity: 1; z-index: 1; }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, center);
  transform: scale(1.04);
}

.slide.is-active img {
  animation: deriva calc(var(--slide-ms) + 1.4s) ease-out both;
}

/* La primera foto entra con un zoom más marcado junto con el telón */
.slide:first-child.is-active img {
  animation: acercar 2.2s var(--ease) both, deriva calc(var(--slide-ms) + 1.4s) ease-out 2.2s both;
}

@keyframes acercar {
  from { transform: scale(1.18); }
  to   { transform: scale(1.04); }
}

@keyframes deriva {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.13) translate(-1.5%, -1%); }
}

.visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 25%, transparent 50%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}

.visual__info {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 3vw, 48px);
  bottom: calc(var(--greca-h) + clamp(16px, 3vh, 32px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: min(300px, calc(100% - 32px));
  animation: subir .9s var(--ease) 1.4s both;
}

.visual__tag {
  padding-left: 14px;
  border-left: 4px solid var(--amarillo);
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
  transition: opacity .35s ease, transform .35s ease;
}
.visual__tag.is-changing { opacity: 0; transform: translateY(8px); }

.tag__tipo {
  display: block;
  margin-bottom: 2px;
  font-style: normal;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amarillo);
}
.tag__nombre { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.tag__lugar { font-size: .9rem; color: rgba(255,255,255,.88); }

/* Barras de progreso (también sirven para elegir proyecto) */
.progress {
  display: flex;
  gap: 6px;
  width: 100%;
}

.progress__bar {
  position: relative;
  flex: 1;
  height: 16px;            /* área táctil */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.progress__bar::before,
.progress__bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
}
.progress__bar::before { background: rgba(255,255,255,.35); }
.progress__bar::after {
  background: var(--amarillo);
  transform: scaleX(0);
  transform-origin: left;
}
.progress__bar.is-active::after { animation: llenar var(--slide-ms) linear both; }
.progress__bar:hover::before { background: rgba(255,255,255,.65); }
.progress__bar:focus-visible { outline: 2px solid var(--blanco); outline-offset: 2px; }

@keyframes llenar { to { transform: scaleX(1); } }

/* ---------- Franja de greca maya (base, como en el manual) ---------- */
.greca {
  position: absolute;
  z-index: 3;
  left: 0; right: 0; bottom: 0;
  height: var(--greca-h);
  background-color: var(--rojo-oscuro);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 32h16V8h16v16h-8v-8h-4v12h16' fill='none' stroke='%23f1b747' stroke-opacity='.55' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E");
  background-size: var(--greca-h) var(--greca-h);
  background-repeat: repeat-x;
  border-top: 3px solid var(--amarillo);
  animation:
    greca-entra .8s var(--ease) .3s both,
    greca-corre 30s linear infinite;
}

@keyframes greca-entra { from { transform: translateY(100%); } to { transform: none; } }
@keyframes greca-corre { to { background-position: calc(var(--greca-h) * 20) 0; } }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root { --corte: 10vw; }
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .actions__note { flex-basis: 100%; }
}

/* ---------- Móvil: apilado, foto abajo ---------- */
@media (max-width: 760px), (max-width: 1024px) and (orientation: portrait) {
  :root { --corte: 0px; --inclina: 9vw; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(240px, 42vh);
  }

  .panel {
    margin: 0 0 calc(var(--inclina) * -1);
    padding: 28px 20px calc(var(--inclina) + 32px);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--inclina)), 0 100%);
    animation-name: telon-movil;
  }

  @keyframes telon-movil {
    from { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    to   { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--inclina)), 0 100%); }
  }

  .panel__inner { margin-block: 0; }
  .logo { width: 132px; margin-bottom: 28px; }
  h1 { font-size: clamp(2rem, 9.5vw, 2.8rem); }
  .lead { font-size: 1.05rem; }
  .btn { width: 100%; }
  .actions__note { flex-basis: auto; width: 100%; text-align: center; }
  .foot { font-size: .7rem; justify-content: center; text-align: center; }
  .foot__sep { display: none; }
  .panel__inner { max-width: 600px; }

  .visual { grid-column: 1; grid-row: 2; }
  .visual__info { left: 16px; right: auto; width: min(320px, calc(100% - 32px)); }
}

@media (max-width: 380px) {
  .eyebrow { letter-spacing: .12em; }
}

/* ---------- Ventana emergente de Calendly ---------- */
/* Más alta que el máximo de 680px de Calendly para que el calendario quepa sin scroll */
.calendly-overlay {
  background-color: rgba(26, 10, 10, .78) !important;
  backdrop-filter: blur(4px);
}
.calendly-overlay .calendly-popup {
  height: min(92vh, 860px) !important;
  max-height: none !important;
}
.calendly-overlay .calendly-popup-close {
  top: 20px !important;
  right: 20px !important;
}

/* ---------- Accesibilidad: sin movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
  .btn::before { display: none; }
}
