/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f6efe4;
  --bg-2:      #ece0cb;
  --paper:     #fffaf2;
  --ink:       #241a1a;
  --ink-soft:  #3a2c2b;
  --ink-mute:  #8a7a6e;
  --accent:    #7a2436;
  --accent-2:  #b8935a;
  --accent-3:  #9c3a4e;
  --gold-line: #c9a15f;
  --line:      rgba(36,26,26,0.14);
  --line-soft: rgba(36,26,26,0.08);

  --footer-bg: #3a0f18;
  --footer-ink: #f2e6d8;

  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-crearte: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 84px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  cursor: default;
}
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, h4 { text-wrap: balance; line-height: 1.05; font-family: var(--display); font-weight: 500; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--paper); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: 1280px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .7rem 1.2rem; background: var(--ink); color: var(--paper);
  z-index: 9999; border-radius: 4px; font-weight: 500; font-family: var(--sans);
  transition: top .3s var(--ease-crearte);
}
.skip-link:focus { top: 1rem; }

.section-kicker {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .9rem;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  color: var(--ink);
  max-width: 20ch;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.9rem;
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .01em;
  border-radius: 2px;
  transition: transform .5s var(--ease-crearte), background-color .4s var(--ease-crearte), color .4s var(--ease-crearte), border-color .4s var(--ease-crearte);
}
.btn-primary {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-3); border-color: var(--accent-3); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================
   4. Firma de autor — cursor, grain, progress thread, splash
   ============================================================= */
.cursor { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease-crearte); }
.cursor.is-ready { opacity: 1; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); transform: translate3d(-50%,-50%,0); }
.cursor-ring { width: 34px; height: 34px; border: 1px solid var(--ink); mix-blend-mode: difference; transform: translate3d(-50%,-50%,0); transition: width .25s var(--ease-crearte), height .25s var(--ease-crearte); }
.cursor-ring.is-hover { width: 54px; height: 54px; border-color: var(--paper); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.grain {
  position: fixed; inset: -10%; z-index: 6; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.progress-thread {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 9997; pointer-events: none;
  background: var(--line-soft);
}
.progress-thread span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.splash {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  animation: splashSafety .01s 2.6s forwards;
}
.splash-line {
  position: absolute; top: 50%; left: 0; width: 100%; height: 1px;
  background: var(--accent-2); transform: scaleX(0); transform-origin: left;
}
.splash-mark {
  font-family: var(--display); font-style: italic; font-size: 2.2rem; color: var(--accent);
  opacity: 0;
}
.splash.is-out { animation: none; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease-crearte); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; } }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 500;
  height: var(--nav-h);
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(246,239,228,0);
  transition: background .4s var(--ease-crearte), box-shadow .4s var(--ease-crearte);
}
.nav.is-solid::before {
  background: rgba(246,239,228,.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-logo { font-family: var(--display); font-size: 1.35rem; letter-spacing: .02em; color: var(--ink); }
.nav-links { display: none; gap: 2.1rem; }
.nav-links a { font-size: .9rem; color: var(--ink-soft); position: relative; padding-block: .3rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-crearte);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-right .nav-cta { display: none; }

.nav-burger { list-style: none; cursor: pointer; width: 26px; height: 18px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.nav-burger::-webkit-details-marker { display: none; }
.nav-burger span { display: block; height: 1.5px; width: 100%; background: var(--ink); transition: transform .35s var(--ease-crearte), opacity .35s var(--ease-crearte); }
.nav-mobile[open] .nav-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-mobile[open] .nav-burger span:nth-child(2) { opacity: 0; }
.nav-mobile[open] .nav-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu-panel { display: none; }
.nav-mobile[open] .mobile-menu-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg);
  padding-top: var(--nav-h);
}
.mobile-menu-panel a { font-family: var(--display); font-size: 1.6rem; color: var(--ink); }
.mobile-menu-panel .btn { margin-top: 1rem; }

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

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  margin-top: calc(var(--nav-h) * -1);
  padding-top: var(--nav-h);
}
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-photo {
  width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
  animation: heroKenBurns 22s var(--ease-soft) infinite alternate;
}
@keyframes heroKenBurns { from { transform: scale(1); } to { transform: scale(1.08); } }
.hero-tint {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(36,20,20,.82) 0%, rgba(36,20,20,.42) 42%, rgba(36,20,20,.18) 68%, rgba(36,20,20,.35) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%;
  padding: 0 clamp(1.25rem, 5vw, 4rem) clamp(3.5rem, 8vw, 6rem);
  color: var(--paper);
  text-align: center;
  margin-inline: auto;
  max-width: 1100px;
}
.hero-kicker {
  font-size: .78rem; letter-spacing: .2em; font-weight: 600;
  color: var(--accent-2); margin-bottom: 1.4rem;
}
.hero-title {
  font-size: clamp(3rem, 10.5vw, 8rem);
  line-height: .95;
  letter-spacing: .01em;
  color: var(--paper);
  margin-bottom: 1.6rem;
}
.hero-title-line { display: block; clip-path: inset(0 0 0 0); }
.hero-title-em { font-style: italic; color: var(--accent-2); font-weight: 400; }
.hero-sub {
  font-family: var(--sans); font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: rgba(242,235,222,.88);
  max-width: 52ch; margin-inline: auto; margin-bottom: 2.2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-ghost { color: var(--paper); border-color: rgba(242,235,222,.4); }
.hero .btn-ghost:hover { border-color: var(--paper); color: var(--paper); }

.hero-scroll {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  z-index: 1; width: 1px; height: 46px; overflow: hidden;
}
.hero-scroll-line {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent-2) 55%, transparent);
  animation: scrollLine 2.4s ease-in-out infinite;
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* =============================================================
   7. Manifesto
   ============================================================= */
.manifesto { padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg); }
.manifesto-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.manifesto-num { font-family: var(--display); font-style: italic; font-size: 2rem; color: var(--accent-2); }
.manifesto-text {
  font-family: var(--display); font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.45; color: var(--ink-soft);
  max-width: 42ch;
}

/* =============================================================
   8. Historia — horizontal pinned tour
   ============================================================= */
.historia { padding-block: clamp(3rem, 7vw, 5rem) 0; background: var(--bg-2); }
.historia-head { margin-bottom: clamp(2rem, 5vw, 3rem); }

.historia-track { display: flex; flex-direction: column; }
.historia-panel {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) clamp(3rem, 6vw, 4rem);
}
.historia-panel-media { aspect-ratio: 3 / 2; overflow: hidden; border-radius: 2px; }
.historia-panel-media img { width: 100%; height: 100%; object-fit: cover; }
.historia-panel-text { max-width: 46ch; }
.historia-panel-num { font-family: var(--display); font-style: italic; font-size: 1.4rem; color: var(--accent-2); display: block; margin-bottom: .6rem; }
.historia-panel-text h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .8rem; color: var(--ink); }
.historia-panel-text p { color: var(--ink-mute); font-size: 1rem; max-width: 40ch; }

@media (min-width: 960px) {
  .historia-pin.is-pinned { height: 100vh; overflow: hidden; position: relative; }
  .historia-pin.is-pinned .historia-track { flex-direction: row; height: 100%; width: max-content; will-change: transform; }
  .historia-pin.is-pinned .historia-panel {
    width: 100vw; height: 100%; flex: 0 0 100vw;
    grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem);
    padding-inline: clamp(2rem, 6vw, 6rem);
  }
  .historia-pin.is-pinned .historia-panel-media { aspect-ratio: 4 / 3; }
}

/* =============================================================
   9. Servicios — lista editorial numerada
   ============================================================= */
.servicios { padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg); }
.servicios-list { border-top: 1px solid var(--line); }
.servicio-item {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(1.8rem, 4vw, 2.8rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.servicio-num {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1; color: var(--accent);
  opacity: .16;
  will-change: transform, opacity;
}
.servicio-body h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: .5rem; color: var(--ink); }
.servicio-body p { color: var(--ink-mute); max-width: 56ch; }
.servicio-item-media { grid-template-columns: auto 1fr; }
.servicio-media { display: none; }

@media (min-width: 720px) {
  .servicio-item-media { grid-template-columns: auto 1fr auto; }
  .servicio-media { display: block; width: 148px; aspect-ratio: 4/3; overflow: hidden; border-radius: 2px; }
  .servicio-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-crearte); }
  .servicio-item-media:hover .servicio-media img { transform: scale(1.08); }
}

/* =============================================================
   10. Galería — slideshow pinneado
   ============================================================= */
.galeria { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 8vw, 6rem); background: var(--bg-2); }
.galeria-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

.galeria-stage {
  display: flex; gap: 1rem; overflow-x: auto; overflow-y: visible;
  scroll-snap-type: x mandatory; padding-inline: clamp(1.25rem, 4vw, 3rem); padding-block: .5rem 1.5rem;
  scrollbar-width: none;
}
.galeria-stage::-webkit-scrollbar { display: none; }
.galeria-slide { flex: 0 0 82%; scroll-snap-align: center; position: relative; }
.galeria-slide img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; }
.galeria-slide figcaption {
  margin-top: .8rem; font-size: .85rem; color: var(--ink-mute); display: flex; gap: .6rem; align-items: baseline;
}
.galeria-slide-num { font-family: var(--display); font-style: italic; color: var(--accent-2); }
.galeria-progress { display: none; }

@media (min-width: 540px) { .galeria-slide { flex-basis: 46%; } }
@media (min-width: 960px) {
  .galeria-pin.is-pinned { height: 100vh; position: relative; overflow: hidden; }
  .galeria-pin.is-pinned .galeria-stage {
    display: block; overflow: visible; scroll-snap-type: none; height: 100%; padding: 0;
  }
  .galeria-pin.is-pinned .galeria-slide {
    position: absolute; inset: 0; opacity: 0; padding-inline: clamp(2rem, 6vw, 6rem);
    display: flex; flex-direction: column; justify-content: center;
  }
  .galeria-pin.is-pinned .galeria-slide img { aspect-ratio: 16/9; max-height: 72vh; }
  .galeria-pin.is-pinned .galeria-slide.is-active { opacity: 1; z-index: 2; }
  .galeria-progress {
    display: block; position: absolute; left: clamp(2rem, 6vw, 6rem); right: clamp(2rem, 6vw, 6rem); bottom: 2.4rem;
    height: 2px; background: var(--line);
  }
  .galeria-progress span { display: block; height: 100%; width: 0%; background: var(--accent); }
}

/* =============================================================
   11. Testimonios — stack 3D rotativo
   ============================================================= */
.testimonios { padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg); }
.testi-stack {
  display: grid; gap: 1.5rem;
  max-width: 640px; margin-inline: auto;
  perspective: 1400px;
}
.testi-card {
  background: var(--paper); border: 1px solid var(--line);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  border-radius: 3px;
}
.testi-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-2); color: var(--accent);
  font-family: var(--display); font-style: italic; font-size: 1rem;
  margin-bottom: 1.2rem;
}
.testi-card blockquote { font-family: var(--display); font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.42; color: var(--ink-soft); margin-bottom: 1.2rem; }
.testi-meta { font-size: .85rem; color: var(--ink-mute); }
.testi-controls { display: none; }

@media (min-width: 720px) {
  .testi-stack.is-3d {
    display: block; position: relative;
    max-width: 760px; height: 380px;
    perspective: 1600px;
  }
  .testi-stack.is-3d .testi-card {
    position: absolute; top: 0; left: 50%;
    width: min(88%, 460px); height: 100%;
    margin-left: calc(min(88%, 460px) / -2);
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: 0 24px 60px rgba(36,26,26,.14);
    backface-visibility: hidden;
  }
  .testi-controls { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 2.2rem; }
  .testi-arrow {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    transition: border-color .3s var(--ease-crearte), color .3s var(--ease-crearte);
  }
  .testi-arrow:hover { border-color: var(--accent); color: var(--accent); }
  .testi-dots { display: flex; gap: .5rem; }
  .testi-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .3s var(--ease-crearte), transform .3s var(--ease-crearte); }
  .testi-dots span.is-active { background: var(--accent); transform: scale(1.3); }
}

/* =============================================================
   12. CTA — formulario progresivo
   ============================================================= */
.cta { position: relative; padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg-2); overflow: hidden; }
.cta-spotlight {
  position: absolute; inset: -20%; pointer-events: none; z-index: 0;
  background: radial-gradient(480px circle at var(--x, 50%) var(--y, 30%), rgba(122,36,54,.14), transparent 65%);
}
.cta-inner { position: relative; z-index: 1; max-width: 640px; }
.cta-sub { color: var(--ink-mute); margin-top: -1.5rem; margin-bottom: 2.2rem; max-width: 46ch; }

.cta-form { display: flex; flex-direction: column; gap: 0; }
.form-field {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .55s var(--ease-crearte), opacity .5s var(--ease-crearte), margin-bottom .55s var(--ease-crearte);
}
.form-field.is-active { max-height: 140px; opacity: 1; margin-bottom: 1.3rem; }
.form-field label { display: block; font-size: .82rem; color: var(--ink-mute); margin-bottom: .5rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  padding: .85rem 1rem;
  transition: border-color .3s var(--ease-crearte);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); outline: none; }
.cta-submit { align-self: flex-start; margin-top: .5rem; }
.cta-form-note { font-size: .85rem; color: var(--ink-mute); margin-top: 1.4rem; }
.cta-form-note a { color: var(--accent); border-bottom: 1px solid var(--line); }

.cta-form-success { max-width: 46ch; }
.cta-form-success p { font-family: var(--display); font-size: 1.4rem; color: var(--ink-soft); }
[hidden] { display: none !important; }

/* =============================================================
   13. Footer
   ============================================================= */
.footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: clamp(3rem, 6vw, 4.5rem) 1.75rem; }
.footer-grid { display: grid; gap: 2.4rem; margin-bottom: 2.5rem; }
.footer-logo { font-family: var(--display); font-size: 1.6rem; margin-bottom: .6rem; }
.footer-tag { color: rgba(242,230,216,.7); max-width: 32ch; }
.footer-contact p { margin-bottom: .55rem; color: rgba(242,230,216,.85); }
.footer-contact a:hover { color: var(--accent-2); }
.footer-nav { display: flex; flex-direction: column; gap: .6rem; }
.footer-nav a { color: rgba(242,230,216,.85); }
.footer-nav a:hover { color: var(--accent-2); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding-top: 1.75rem; border-top: 1px solid rgba(242,230,216,.14);
  font-size: .82rem; color: rgba(242,230,216,.55);
}
.footer-credit { display: inline-flex; align-items: center; gap: .3rem; color: rgba(242,230,216,.7); }
.footer-credit span { display: inline-block; transition: transform .35s var(--ease-crearte); }
.footer-credit:hover span { transform: translate(2px, -2px); }
.footer-credit:hover { color: var(--accent-2); }

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}

/* =============================================================
   14. Reveal system
   ============================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-crearte), transform .9s var(--ease-crearte); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   15. Responsive base
   ============================================================= */
@media (min-width: 540px) {
  .hero-actions { justify-content: flex-start; }
}
@media (min-width: 720px) {
  .manifesto-grid { grid-template-columns: 120px 1fr; }
}

/* =============================================================
   16. Reduced motion — only truly intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; }
  .hero-scroll-line { animation: none; }
  .splash { animation: none; opacity: 0; pointer-events: none; }
}
