/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f5f2ec;
  --bg-2:      #ebe6db;
  --paper:     #ffffff;
  --ink:       #0e0e10;
  --ink-soft:  #232225;
  --ink-mute:  #6e6b66;
  --accent:    #ff4a1c;
  --accent-2:  #1fe0ad;
  --line:      rgba(14, 14, 16, 0.12);

  --display: "Anton", "Archivo Black", sans-serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-crearte: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 84px;
  --container: 1240px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: .98; letter-spacing: -0.01em; font-family: var(--display); font-weight: 400; text-transform: uppercase; }
em { font-style: normal; color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .3s var(--ease-crearte);
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.kicker {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.kicker::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  display: inline-block;
}
.kicker-light { color: #ffe2d6; }
.kicker-light::before { background: #ffe2d6; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-crearte), transform .9s var(--ease-crearte); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
/* No-JS / JS-failed safety: content must never depend on script execution */
.no-js .reveal { opacity: 1; transform: none; }
.no-js .hero-bg { clip-path: none; }
.no-js .mosaic { clip-path: none; }
.no-js .micro-intro { display: none; }
.no-js .manifiesto-text em { opacity: 1; transform: none; }

/* =============================================================
   4. Nav
   ============================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  transition: box-shadow .5s var(--ease-crearte), height .4s var(--ease-crearte);
}
/* backdrop-filter lives on a ::before, never directly on .nav — a filter/backdrop-filter
   on .nav would create a containing block for its fixed-position descendants (the mobile
   menu panel), trapping it inside the 68px nav bar instead of covering the viewport. */
.nav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(245, 242, 236, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transition: opacity .5s var(--ease-crearte);
}
.nav.is-solid::before { opacity: 1; }
.nav.is-solid {
  box-shadow: 0 1px 0 var(--line);
  height: 68px;
}
.nav.is-solid .nav-brand img { filter: none; }
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: inline-flex; align-items: center; }
.nav-brand img { height: 26px; width: auto; filter: brightness(0) invert(1); transition: filter .4s var(--ease-crearte); }
.nav.is-solid .nav-brand img { filter: none; }
.nav-links { display: none; align-items: center; gap: 2.2rem; }
.nav-link { font-size: .88rem; font-weight: 700; position: relative; color: var(--ink); }
.nav:not(.is-solid) .nav-link { color: #fff; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-crearte);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: .7rem; }
.nav-right .nav-cta { display: none; }

.nav-portfolio-link {
  display: flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 700; color: rgba(255,255,255,.75);
  padding: .5rem .65rem; border: 1px solid rgba(255,255,255,.3); border-radius: 100px;
  transition: opacity .3s var(--ease-crearte), border-color .3s var(--ease-crearte), color .3s var(--ease-crearte);
}
.nav.is-solid .nav-portfolio-link { color: var(--ink-mute); border-color: var(--line); }
.nav-portfolio-link:hover { border-color: var(--accent); color: var(--accent); }
.nav-portfolio-link svg { width: 12px; height: 12px; flex-shrink: 0; }
.nav-portfolio-text { display: none; }
@media (min-width: 540px) { .nav-portfolio-text { display: inline; } }

/* Mobile nav — native <details> disclosure, works with zero JS */
.nav-mobile { position: relative; }
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px; padding: .5rem;
  list-style: none; cursor: pointer;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; transition: transform .3s var(--ease-crearte), opacity .3s var(--ease-crearte), background .3s var(--ease-crearte); }
.nav.is-solid .nav-toggle span { background: var(--ink); }
.nav-mobile[open] .nav-toggle span { background: var(--ink); }
.nav-mobile[open] .nav-toggle span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-mobile[open] .nav-toggle span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu-panel { display: none; }
.nav-mobile[open] .mobile-menu-panel {
  position: fixed; inset: 0; z-index: 490;
  background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
}
.mobile-menu-panel a { font-family: var(--display); font-size: 2rem; color: var(--bg); text-transform: uppercase; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-right .nav-cta { display: inline-flex; }
  .nav-mobile { display: none; }
}

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.9rem;
  font-size: .9rem; font-weight: 800;
  letter-spacing: .01em;
  border-radius: 100px;
  transition: transform .5s var(--ease-crearte), background .3s var(--ease-crearte), color .3s var(--ease-crearte), box-shadow .3s var(--ease-crearte);
  will-change: transform;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 14px 30px -14px rgba(255,74,28,.6); }
.btn-primary:hover { background: #ff6a3f; }
.btn-primary svg { width: 18px; height: 18px; }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
.nav.is-solid ~ * .btn-ghost {}
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-lg { padding: 1.25rem 2.6rem; font-size: 1rem; }

/* Custom cursor */
.cursor { display: none; position: fixed; top: 0; left: 0; z-index: 800; pointer-events: none; }
.cursor.is-ready { display: block; }
.cursor-dot { position: fixed; top: 0; left: 0; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; pointer-events: none; z-index: 801; transform: translate(-50%, -50%); }
.cursor-ring {
  position: fixed; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--ink); pointer-events: none; z-index: 800;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width .3s var(--ease-crearte), height .3s var(--ease-crearte), border-color .3s var(--ease-crearte);
}
.cursor-ring.is-hover { width: 64px; height: 64px; background: rgba(255, 74, 28, 0.18); border-color: transparent; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot, .cursor-ring { display: none; } }

/* Grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Micro-intro */
.micro-intro {
  position: fixed; inset: 0; z-index: 900;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.micro-intro-line {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  transform: scale(0);
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  z-index: 0;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
  background: var(--ink);
}
/* Visible by default — JS applies the clip-path reveal itself (and only if it can
   actually finish it). Never hide the hero photo from base CSS: if the JS reveal
   stalls for any reason, the image must still show, not stay clipped forever. */
.hero-bg { position: absolute; inset: 0; z-index: -2; clip-path: inset(0%); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1); will-change: transform; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,14,16,.55) 0%, rgba(14,14,16,.4) 35%, rgba(14,14,16,.6) 65%, rgba(14,14,16,.95) 100%),
    linear-gradient(90deg, rgba(14,14,16,.6) 0%, rgba(14,14,16,.1) 60%);
}
.hero-content {
  position: relative; z-index: 1;
  width: 100%;
  padding-block: 1rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.hero-title {
  font-size: clamp(2.6rem, 8.6vw, 6.4rem);
  color: #fff;
  max-width: 14ch;
}
.hero-sub {
  max-width: 46ch;
  font-size: 1.05rem;
  color: rgba(255,255,255,.82);
  font-weight: 500;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.hero-scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; z-index: 1;
  width: 26px; height: 40px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 100px;
  transform: translateX(-50%);
}
.hero-scroll-cue span {
  position: absolute; top: 6px; left: 50%; width: 4px; height: 8px; border-radius: 4px;
  background: var(--accent); transform: translateX(-50%);
  animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue { 0% { top: 6px; opacity: 1; } 70% { top: 20px; opacity: 0; } 100% { top: 20px; opacity: 0; } }

/* =============================================================
   7. Manifiesto — palabras clave gigantes superpuestas
   ============================================================= */
.manifiesto {
  background: var(--ink);
  color: rgba(245,242,236,.42);
  padding-block: 8rem;
  position: relative;
  z-index: 2;
}
.manifiesto-inner { max-width: 900px; }
.manifiesto-text {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.5rem, 4.2vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.manifiesto-text em {
  display: inline-block;
  color: var(--bg);
  font-style: normal;
  opacity: .3;
  transform: scale(.92);
  transition: opacity .4s ease, transform .4s ease, color .4s ease;
}
.manifiesto-text em.is-active { opacity: 1; color: var(--accent); transform: scale(1.06); }

/* =============================================================
   8. Programas
   ============================================================= */
.programas {
  padding: 4rem 0 7rem;
  position: relative; z-index: 3; background: var(--bg);
  margin-top: -48px;
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -30px 60px -20px rgba(14,14,16,.25);
}
.programas-head { max-width: 50ch; margin-bottom: 3.5rem; padding-top: 1rem; }
.programas-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.programas-grid { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.programa-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.2rem 2rem 2.4rem;
  overflow: hidden;
  transition: transform .5s var(--ease-crearte), box-shadow .5s var(--ease-crearte);
}
.programa-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(14,14,16,.35); }
.programa-num {
  position: absolute; top: -.6rem; right: .6rem;
  font-family: var(--display);
  font-size: 7.5rem;
  color: var(--ink);
  opacity: .06;
  line-height: 1;
  pointer-events: none;
  will-change: transform;
}
.programa-figure { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; margin-bottom: 1.4rem; position: relative; }
.programa-figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-crearte); }
.programa-card:hover .programa-figure img { transform: scale(1.06); }
.programa-card h3 { font-size: 1.5rem; margin-bottom: .8rem; position: relative; }
.programa-card p { color: var(--ink-mute); font-size: .96rem; margin-bottom: 1.2rem; position: relative; }
.programa-meta { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); position: relative; }

@media (min-width: 720px) { .programas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .programas-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .programas { margin-top: -88px; border-radius: 48px 48px 0 0; } }

/* =============================================================
   9. Historia — mosaico + copy
   ============================================================= */
.historia { padding-block: 7rem; position: relative; z-index: 3; background: var(--bg); }
.historia-grid { display: grid; gap: 3rem; grid-template-columns: 1fr; align-items: center; }
.historia-figure { position: relative; }
.mosaic {
  position: relative;
  aspect-ratio: 4/5; max-width: 420px; margin-inline: auto;
  border-radius: 8px; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(5, 1fr);
}
.mosaic img {
  grid-column: 1 / -1; grid-row: 1 / -1;
  width: 100%; height: 100%; object-fit: cover;
  will-change: transform;
}
.historia-copy h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 1.4rem; }
.historia-copy p { max-width: 58ch; color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 1.1rem; }
.historia-sign { margin-top: 1.4rem; font-family: var(--display); text-transform: uppercase; font-size: .95rem; letter-spacing: .04em; color: var(--ink-mute); }

@media (min-width: 960px) {
  .historia-grid { grid-template-columns: .8fr 1.2fr; gap: 4.5rem; }
}

/* =============================================================
   10. CTA final / Contacto
   ============================================================= */
.cta-final {
  position: relative;
  background: var(--ink);
  color: var(--bg);
  padding-block: 7rem;
  text-align: center;
  overflow: hidden;
  z-index: 3;
}
.cta-spotlight {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px circle at var(--x, 50%) var(--y, 30%), rgba(255,74,28,.22), transparent 70%);
}
.cta-final-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.cta-final h2 { font-size: clamp(2.2rem, 6vw, 4rem); max-width: 16ch; color: #fff; }
.cta-final-sub { max-width: 46ch; margin: 1.2rem auto 2.2rem; color: rgba(245,242,236,.72); }

.cta-map {
  margin-top: 3.5rem;
  width: 100%; max-width: 720px;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(245,242,236,.14);
  filter: grayscale(.55) contrast(1.05) brightness(.95);
  transition: filter .5s var(--ease-crearte);
}
.cta-map:hover { filter: none; }
.cta-map iframe { width: 100%; height: 340px; }

/* =============================================================
   11. Footer
   ============================================================= */
.footer { background: var(--ink); color: var(--bg); padding-block: 2.4rem; border-top: 1px solid rgba(245,242,236,.1); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.footer-brand img { height: 22px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.footer-tag { font-size: .8rem; color: rgba(245,242,236,.5); letter-spacing: .04em; text-transform: uppercase; }

.credit-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 600;
  color: rgba(245,242,236,.85);
  padding: .5rem .9rem; border: 1px solid rgba(245,242,236,.22); border-radius: 100px;
}
.credit-badge svg { width: 12px; height: 12px; transition: transform .35s var(--ease-crearte); }
.credit-badge:hover { border-color: var(--accent); color: #fff; }
.credit-badge:hover svg { transform: translate(3px, -3px); }

@media (min-width: 720px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* =============================================================
   12. Responsive base
   ============================================================= */
@media (min-width: 1280px) { .container { padding-inline: 3rem; } }

/* =============================================================
   13. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue span { animation: none; top: 20px; opacity: .6; }
  .micro-intro { display: none; }
}
