/* index.html — landing light, tipográfica, asimétrica */

:root {
  --v4-bg: #e9ece9;
  --v4-bg-2: #dde2de;
  --v4-ink: #101413;
  --v4-mute: #5a635e;
  --v4-faint: #8a938d;
  --v4-line: rgba(16, 20, 19, 0.12);
  --v4-accent: #0f6e56;
  --v4-accent-soft: rgba(15, 110, 86, 0.12);
  --v4-paper: #f5f7f5;
  --v4-font: "Public Sans", system-ui, sans-serif;
  --v4-display: "Bricolage Grotesque", var(--v4-font);
  --v4-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --v4-gutter: clamp(1rem, 3.5vw, 2.25rem);
}

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

html {
  scroll-behavior: smooth;
}

body.v4 {
  margin: 0;
  min-height: 100vh;
  font-family: var(--v4-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--v4-ink);
  background: var(--v4-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.v4 a {
  color: inherit;
}

/* Mesh atmosphere — cool, not cream */
.v4-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(15, 110, 86, 0.09), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(16, 20, 19, 0.06), transparent 45%),
    linear-gradient(165deg, #edf0ed 0%, var(--v4-bg) 45%, #e2e7e3 100%);
}

.v4-page {
  position: relative;
  z-index: 1;
}

/* —— First viewport: bar + hero + ticker —— */
.v4-stage {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* —— Top bar —— */
.v4-bar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--v4-gutter);
  border-bottom: 1px solid var(--v4-line);
}

.v4-bar__mark {
  font-family: var(--v4-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.v4-bar__mark em {
  font-style: normal;
  color: var(--v4-accent);
}

.v4-bar__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.v4-bar__nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--v4-mute);
  transition: color 0.2s;
}

.v4-bar__nav a:hover {
  color: var(--v4-ink);
}

.v4-bar__nav .v4-pill {
  display: none;
}

@media (min-width: 640px) {
  .v4-bar__nav .v4-pill {
    display: inline-flex;
  }
}

/* —— Buttons —— */
.v4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1.5px solid var(--v4-ink);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--v4-ease);
}

.v4-btn:hover {
  transform: translate(-2px, -2px);
}

.v4-btn--fill {
  background: var(--v4-ink);
  color: #fff!important;
}

.v4-btn--fill:hover {
  background: var(--v4-accent);
  border-color: var(--v4-accent);
  color: #fff;
}

.v4-btn--ghost {
  background: transparent;
  color: var(--v4-ink);
}

.v4-btn--ghost:hover {
  background: var(--v4-ink);
  color: var(--v4-paper);
}

.v4-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--v4-accent);
  color: #fff!important;
  border: none;
  border-radius: 0;
  transition: background 0.2s;
}

.v4-pill:hover {
  background: var(--v4-ink);
}

.v4-btn i[class^="ph"],
.v4-pill i[class^="ph"],
.v4-bar__nav a i[class^="ph"] {
  font-size: 1.05em;
  line-height: 1;
}

/* —— Hero: tipográfico, sin foto —— */
.v4-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--v4-line);
}

.v4-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--v4-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--v4-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 20%, transparent 75%);
  opacity: 0.9;
}

.v4-hero__grid::after {
  content: "";
  position: absolute;
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  right: -6%;
  top: 50%;
  translate: 0 -50%;
  border: 1.5px solid rgba(15, 110, 86, 0.35);
  border-radius: 50%;
  animation: v4-ring 8s var(--v4-ease) infinite alternate;
}

@keyframes v4-ring {
  from { transform: scale(0.92); opacity: 0.45; }
  to { transform: scale(1.06); opacity: 1; }
}

.v4-hero__inner {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 5.5rem) var(--v4-gutter);
}

.v4-hero__brand {
  margin: 0 0 clamp(1.25rem, 3vh, 2rem);
  font-family: var(--v4-display);
  font-size: clamp(3.75rem, 15vw, 9.5rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.055em;
  color: var(--v4-ink);
  opacity: 0;
  animation: v4-in 0.85s var(--v4-ease) 0.05s forwards;
}

.v4-hero__brand i {
  font-style: normal;
  color: var(--v4-accent);
}

.v4-hero__body {
  max-width: 28rem;
  padding-top: 0.25rem;
  border-top: 1.5px solid var(--v4-ink);
}

.v4-hero h1 {
  margin: 1rem 0 0.65rem;
  max-width: 18ch;
  font-family: var(--v4-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--v4-ink);
  opacity: 0;
  animation: v4-in 0.85s var(--v4-ease) 0.18s forwards;
}

.v4-hero__lead {
  margin: 0 0 1.5rem;
  max-width: 34ch;
  font-size: 1.02rem;
  color: var(--v4-mute);
  opacity: 0;
  animation: v4-in 0.85s var(--v4-ease) 0.3s forwards;
}

.v4-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  opacity: 0;
  animation: v4-in 0.85s var(--v4-ease) 0.42s forwards;
}

@keyframes v4-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Ticker —— */
.v4-ticker {
  flex-shrink: 0;
  overflow: hidden;
  border-block: 1px solid var(--v4-line);
  background: var(--v4-paper);
  padding: 0.85rem 0;
}

.v4-ticker__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  animation: v4-marquee 32s linear infinite;
  font-family: var(--v4-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--v4-mute);
}

.v4-ticker__track span {
  white-space: nowrap;
}

.v4-ticker__track span::before {
  content: "·";
  margin-right: 2.5rem;
  color: var(--v4-accent);
}

@keyframes v4-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* —— Work / demos —— */
.v4-work {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.v4-work__head {
  display: grid;
  gap: 1rem;
  padding: 0 var(--v4-gutter) clamp(2rem, 4vw, 3rem);
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 800px) {
  .v4-work__head {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
}

.v4-work__head .label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--v4-accent);
}

.v4-work__head h2 {
  margin: 0;
  font-family: var(--v4-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.v4-work__head p {
  margin: 0;
  color: var(--v4-mute);
  max-width: 32ch;
  justify-self: end;
}

/* Asymmetric rows */
.v4-row {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--v4-gutter);
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--v4-line);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s var(--v4-ease), transform 0.75s var(--v4-ease);
}

.v4-row.is-in {
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  .v4-row {
    grid-template-columns: minmax(200px, 0.38fr) 1fr;
    gap: 2.5rem;
    align-items: start;
  }

  .v4-row--flip {
    grid-template-columns: 1fr minmax(200px, 0.38fr);
  }

  .v4-row--flip .v4-row__copy {
    order: 2;
  }

  .v4-row--flip .compare-wrap {
    order: 1;
  }
}

.v4-row__copy .num {
  display: block;
  font-family: var(--v4-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: rgba(15, 110, 86, 0.22);
  margin-bottom: 0.5rem;
}

.v4-row__copy h3 {
  margin: 0 0 0.5rem;
  font-family: var(--v4-display);
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.v4-row__copy h3 i[class^="ph"] {
  color: var(--v4-accent);
  font-size: 0.95em;
}

.v4-row__copy p {
  margin: 0;
  color: var(--v4-mute);
  font-size: 0.98rem;
  max-width: 28ch;
}

/* Compare — sharp, paper-like */
.compare-wrap {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--v4-ink);
  border-radius: 0;
  touch-action: none;
  user-select: none;
  aspect-ratio: 16 / 9;
  max-height: min(62vh, 520px);
  background: #1a1e1c;
  cursor: ew-resize;
  box-shadow: 8px 8px 0 rgba(16, 20, 19, 0.12);
}

.compare-wrap img.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.compare-wrap img.before {
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
  z-index: 2;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 3px;
  margin-left: -1.5px;
  z-index: 4;
  cursor: ew-resize;
  background: var(--v4-accent);
}

.compare-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--v4-accent);
  border: 1.5px solid var(--v4-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0;
  animation: v4-nudge 2.4s ease-in-out infinite;
}

.compare-knob::before,
.compare-knob::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
}

.compare-knob::before {
  border-width: 5px 7px 5px 0;
  border-color: transparent #fff transparent transparent;
  margin-right: 3px;
}

.compare-knob::after {
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

@keyframes v4-nudge {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(calc(-50% + 3px), -50%); }
}

.compare-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.35rem 0.65rem;
  background: var(--v4-ink);
  pointer-events: none;
}

.compare-badges {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

.compare-badges span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.3rem 0.5rem;
  background: rgba(16, 20, 19, 0.7);
}

/* —— Close CTA —— */
.v4-close {
  margin: 0 var(--v4-gutter) clamp(2.5rem, 5vw, 4rem);
  max-width: calc(1400px - 2 * var(--v4-gutter));
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--v4-gutter);
  background: var(--v4-ink);
  color: var(--v4-paper);
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .v4-close {
    grid-template-columns: 1.4fr auto;
    align-items: center;
  }
}

.v4-close h2 {
  margin: 0 0 0.4rem;
  font-family: var(--v4-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.v4-close p {
  margin: 0;
  color: rgba(245, 247, 245, 0.65);
  max-width: 36ch;
}

.v4-close__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.v4-close .v4-btn--fill {
  background: var(--v4-accent)!important;
  border-color: var(--v4-accent)!important;
  color: #fff!important;
}

.v4-close .v4-btn--fill:hover {
  background: #fff;
  border-color: #fff;
  color: var(--v4-ink);
}

.v4-close .v4-btn--ghost {
  border-color: rgba(245, 247, 245, 0.35);
  color: var(--v4-paper);
}

.v4-close .v4-btn--ghost:hover {
  background: #fff;
  border-color: #fff;
  color: var(--v4-ink);
}

/* —— Footer —— */
.v4-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--v4-gutter) 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--v4-faint);
  border-top: 1px solid var(--v4-line);
}

.v4-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.v4-foot a {
  text-decoration: none;
  color: var(--v4-mute);
  transition: color 0.2s;
}

.v4-foot a:hover {
  color: var(--v4-accent);
}

@media (prefers-reduced-motion: reduce) {
  .v4-hero__grid::after,
  .v4-ticker__track,
  .compare-knob,
  .v4-hero__brand,
  .v4-hero h1,
  .v4-hero__lead,
  .v4-hero__cta {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .v4-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
