/* home.css — estilos específicos de la home */

/* Lockup alineado al shell v3 (misma altura que el resto del sitio público) */

/* HERO — 3 bandas explícitas: móvil ≤768 | tablet 769–1024 | desktop ≥1025
   (900px sigue solo en grids de secciones, no aquí) */
.hero {
  position: relative; overflow: hidden;
  /* Altura = contenido + padding; sin min-height 90vh que fuerce scroll en viewports bajos */
  padding-top: calc(var(--nav-header-height, 72px) + var(--space-lg));
  padding-bottom: var(--space-xl);
  display: flex;
  align-items: flex-start;
}
.hero > .container {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
}
/* Bloque de copy/H1 por encima del brand mark (misma prioridad que .container) */
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: min(680px, 100%);
  min-width: 0;
}

/* Eyebrow en hero: menos aire bajo la línea lime (sin tocar .section-eyebrow global fuera del hero) */
.hero .section-eyebrow {
  margin-bottom: var(--space-sm);
}

.hero-headline {
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-sm);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 300;
  line-height: 1.05;
  padding-top: 0.06em;
  padding-bottom: 0.08em;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  hyphens: manual;
  text-wrap: balance;
}
.hero-headline em { color: var(--accent); font-style: italic; }
.hero-headline em span {
  opacity: 0;
  transition: opacity 0.04s ease-out;
}
.hero-headline em span.visible { opacity: 1; }
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: var(--space-sm);
}
.hero-inner > .hero-sub:last-of-type {
  margin-bottom: var(--space-md);
}
.hero-cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.hero-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Viewports bajos (tablet/desktop reducido): compactar solo spacing; no toca .hero-dogs-img */
@media (max-height: 820px) and (min-width: 769px) {
  .hero {
    padding-top: clamp(88px, 11vh, calc(var(--nav-header-height, 72px) + var(--space-xl)));
    padding-bottom: clamp(24px, 4vh, 48px);
  }

  .hero .section-eyebrow {
    margin-bottom: 6px;
  }

  .hero-headline {
    margin-bottom: 8px;
    padding-bottom: 0.04em;
  }

  .hero-sub {
    margin-bottom: 6px;
  }

  .hero-inner > .hero-sub:last-of-type {
    margin-bottom: clamp(12px, 2vh, 20px);
  }

  .hero-cta {
    margin-top: 0;
    margin-bottom: clamp(12px, 2vh, 20px);
    gap: 8px;
  }

  .hero-tags {
    margin-top: 0;
  }
}

/* Desktop alto: un poco más de aire inferior sin recuperar min-height 90vh */
@media (min-width: 1025px) and (min-height: 900px) {
  .hero {
    padding-bottom: var(--space-2xl);
  }
}

/* Brand mark — detrás del texto; pointer-events none (no capta clics) */
.hero-visual-bg {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  display: flex;
  right: var(--space-sm);
  left: 40%;
  top: 4rem;
  bottom: auto;
  height: min(42vh, 320px);
  align-items: flex-start;
  justify-content: flex-end;
}

.hero-dogs-img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
  mix-blend-mode: soft-light;
  filter: saturate(0.9);
  /* Degradado un poco más temprano a la izquierda para no “invadir” el titular */
  -webkit-mask-image: linear-gradient(to left, #000 42%, rgba(0, 0, 0, 0.5) 72%, transparent 100%);
  mask-image: linear-gradient(to left, #000 42%, rgba(0, 0, 0, 0.5) 72%, transparent 100%);
  opacity: 0.26;
  max-width: min(92vw, 520px);
  max-height: min(38vh, 360px);
  transform: translate(1vw, 0);
}

.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(168,212,41,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,212,41,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 60% 50%, black 30%, transparent 100%);
}

@media (min-width: 769px) {
  .hero-visual-bg {
    top: 0;
    bottom: 0;
    left: 51%;
    right: var(--space-md);
    height: auto;
    align-items: center;
    justify-content: center;
  }

  .hero-dogs-img {
    opacity: 0.42;
    max-width: min(680px, 58vw);
    max-height: min(70vh, 640px);
    -webkit-mask-image: linear-gradient(to left, #000 44%, rgba(0, 0, 0, 0.52) 73%, transparent 100%);
    mask-image: linear-gradient(to left, #000 44%, rgba(0, 0, 0, 0.52) 73%, transparent 100%);
    transform: translate(2vw, 0.5vh);
  }
}

@media (min-width: 1025px) {
  .hero-visual-bg {
    left: calc(50% + var(--space-sm));
    right: max(var(--space-md), calc((100vw - min(100vw, 1100px)) / 2 + var(--space-lg)));
  }

  .hero-dogs-img {
    opacity: 0.52;
    max-width: min(920px, 68vw);
    max-height: min(80vh, 920px);
    -webkit-mask-image: linear-gradient(to left, #000 44%, rgba(0, 0, 0, 0.52) 74%, transparent 100%);
    mask-image: linear-gradient(to left, #000 44%, rgba(0, 0, 0, 0.52) 74%, transparent 100%);
    transform: translate(3vw, 0.5vh);
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: calc(var(--nav-header-height, 72px) + var(--space-lg));
    padding-bottom: var(--space-lg);
    min-height: 0;
  }
}

/* SERVICIOS */
.services { background: var(--bg-surface); }
.section-intro {
  font-size: 15px; color: var(--text-secondary);
  max-width: 56ch; margin-bottom: var(--space-md);
}
.section-method-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: var(--space-xl);
}
.section-method-note strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* === Wordmarks inline (HME84 hero / Loop84 method-note) === */
.wordmark-inline {
  display: inline-block;
  height: 0.95em;
  width: auto;
  vertical-align: -0.12em;
  user-select: none;
  -webkit-user-drag: none;
}
.hero-sub .wordmark-inline {
  height: 1.05em;
  vertical-align: -0.16em;
  margin-right: 0.04em;
}
.wordmark-inline-loop84 {
  height: 1.1em;
  vertical-align: -0.18em;
  margin: 0 0.04em;
  filter: brightness(1.05);
}
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
@media (max-width: 900px) { .services-grid { grid-template-columns: 1fr; } }
.service-num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); margin-bottom: var(--space-md);
  letter-spacing: 0.08em;
}
.services-grid h3 { margin-bottom: var(--space-sm); }
.services-grid p { font-size: 13px; line-height: 1.7; margin-bottom: var(--space-sm); }
.service-note {
  font-size: 12px; color: var(--text-muted);
  font-style: italic; border-left: 2px solid var(--accent-border);
  padding-left: var(--space-sm); margin-top: var(--space-sm) !important;
}
.service-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent); margin-top: var(--space-md);
  transition: gap var(--ease);
}
.service-link:hover { gap: 8px; }
.services-cta { margin-top: var(--space-xl); text-align: center; }

/* TRABAJO — rejilla de fichas (/trabajo); ver .cursor/rules/hme84-trabajo-naming.mdc */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
@media (max-width: 1100px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
}

.work-card,
.proyecto-card {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease;
  display: flex; flex-direction: column;
}
.work-card:hover,
.proyecto-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
}
a.work-card {
  cursor: pointer;
  outline: none;
}
a.work-card::-moz-focus-inner {
  border: 0;
}
a.work-card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.work-card-internal { cursor: default; opacity: 0.85; }

/* Mismo ratio que los PNG de ficha en assets/images (1015×473) */
.work-img {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 1015 / 473;
  min-height: 0;
  box-sizing: border-box;
  padding: 0;
  background: var(--bg-elevated);
  overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.work-img img,
.proyecto-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.work-card:hover .work-img img,
.proyecto-card:hover .proyecto-img {
  transform: scale(1.04);
}
.work-img-dark { background: #080808; }
.work-img-logo { background: var(--bg); }
.work-img-aap {
  background: #e85d0f;
}
.work-img-miranda {
  background: #0c0c0c;
}
.work-img-logo-plate {
  background:
    radial-gradient(ellipse 85% 75% at 50% 45%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(165deg, #101018 0%, #060608 100%);
}
.work-img-guardian {
  background:
    radial-gradient(ellipse 75% 65% at 50% 42%, rgba(168, 212, 41, 0.07), transparent 58%),
    linear-gradient(168deg, #101218 0%, #07080c 100%);
}

.work-info { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; gap: var(--space-sm); }
.work-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-content: flex-start;
  /* Reserva altura para 2 filas de .tag: los h3 quedan alineados entre columnas */
  min-height: 3.5rem;
}
.work-info h3 { font-size: 1.2rem; }
.work-info p { font-size: 12px; line-height: 1.7; margin: 0; }
.work-cta { text-align: center; }

/* MANIFIESTO */
.manifesto { background: var(--bg-surface); }
.manifesto-inner { max-width: 640px; }
.manifesto-quote {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300; color: var(--text-primary);
  line-height: 1.4; margin: var(--space-lg) 0;
  border-left: 3px solid var(--accent);
  padding-left: var(--space-lg);
}
.manifesto-sub {
  max-width: 52ch; margin-bottom: var(--space-lg);
  font-size: 14px; line-height: 1.75;
}
.manifesto-cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .hero-headline em span {
    opacity: 1;
    transition: none;
  }
}
