/* ===========================================================
   Doña Eva — peluquería y cuidado canino, Murcia
   Concepto: El Umbral de Doña Eva — el nombre manuscrito
   se convierte en la puerta del negocio.
   =========================================================== */

:root {
  --color-bg: #F8F2E6;
  --color-bg-soft: #F1E8D6;
  --color-ink: #3B2A1E;
  --color-ink-soft: #5A4736;
  --color-wood: #4A3222;
  --color-wood-dark: #2E1F16;
  --color-accent: #6E7A4C;
  --color-accent-dark: #545E3A;
  --color-accent-light: #98A46C;
  --color-glow: #F3D9A6;

  --font-display: 'Caveat', cursive;
  --font-body: 'Karla', sans-serif;

  --motion-fast: .2s;
  --motion-base: .5s;
  --motion-slow: .9s;
  --ease-brand: cubic-bezier(.65,.05,.36,1);

  --edge: 20px;
}

@media (min-width: 640px) {
  :root { --edge: 32px; }
}

/* ---------- Reset base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 12px 18px;
  z-index: 200;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--edge);
  background: linear-gradient(to bottom, rgba(248,242,230,.92), rgba(248,242,230,0));
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-wood-dark);
  text-decoration: none;
}
.header-cta {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--color-ink);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.header-cta:hover { color: var(--color-accent-dark); }

/* ---------- Scenes (base layout) ---------- */
.scene {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px var(--edge) 64px;
  overflow: hidden;
  text-align: center;
}
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 10px;
}

/* ===========================================================
   SCENE 01 — UMBRAL
   =========================================================== */
.scene-umbral {
  background: radial-gradient(ellipse at 50% 20%, var(--color-bg-soft), var(--color-bg) 70%);
  padding-top: 110px;
}
.umbral-stage {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 400 / 460;
  margin-inline: auto;
}
.door-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.door-frame__outline {
  fill: none;
  stroke: var(--color-wood);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.door-frame__sill {
  fill: none;
  stroke: var(--color-wood);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.wordmark {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  color: var(--color-wood-dark);
}
.letters {
  display: flex;
  justify-content: center;
  font-size: clamp(2.4rem, 12vw, 3.6rem);
}
.letter {
  display: inline-block;
  transform-origin: 50% 100%;
}
.letter-space { width: .32em; }

/* Estado final (arco de dintel) — es también el estado sin JS / reduced-motion */
.l0 { transform: translateY(18px) rotate(-19deg); }
.l1 { transform: translateY(13px) rotate(-14deg); }
.l2 { transform: translateY(8px)  rotate(-8deg); }
.l3 { transform: translateY(3px)  rotate(-3deg); }
.l5 { transform: translateY(3px)  rotate(3deg); }
.l6 { transform: translateY(8px)  rotate(8deg); }
.l7 { transform: translateY(13px) rotate(14deg); }

.scene-context {
  margin-top: 28px;
  font-size: 1.05rem;
  color: var(--color-ink-soft);
  max-width: 26ch;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-accent-dark);
  animation: cue-bounce 1.8s ease-in-out infinite;
}
@keyframes cue-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ===========================================================
   SCENE 02 — EL OFICIO
   =========================================================== */
.scene-oficio {
  background: var(--color-bg);
  gap: 40px;
}
.oficio-visual {
  position: relative;
  width: min(280px, 70vw);
  height: 200px;
  border-radius: 4px;
  background: var(--color-bg-soft);
  overflow: hidden;
}
.stroke {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 26px;
  border-radius: 40px;
  background: linear-gradient(90deg, transparent, var(--color-accent-light), var(--color-accent), transparent);
  opacity: .55;
}
.stroke-a { top: 30%; transform: rotate(-6deg); }
.stroke-b { top: 52%; transform: rotate(4deg); }
.stroke-c { top: 72%; transform: rotate(-3deg); }

.oficio-copy h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.8rem);
  color: var(--color-wood-dark);
  line-height: 1.1;
}
.oficio-text {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--color-ink-soft);
  max-width: 32ch;
  margin-inline: auto;
}

/* ===========================================================
   SCENE 03 — CERCA DE TI
   =========================================================== */
.scene-proximidad {
  background: linear-gradient(to top, var(--color-bg-soft), var(--color-bg) 60%);
  justify-content: flex-start;
  padding-top: 150px;
}
.street-layers {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 200px;
  perspective: 900px;
}
.street-layers::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--color-ink-soft);
  opacity: .25;
}
.layer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  fill: var(--color-ink-soft);
}
.layer-back { opacity: .16; height: 62%; }
.layer-mid { opacity: .26; height: 78%; }
.layer-umbral {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70px;
  transform: translateX(-50%);
  opacity: .95;
}
.mini-door {
  stroke: var(--color-accent-dark);
  stroke-width: 16;
}
.proximidad-copy {
  position: relative;
  z-index: 2;
}
.place-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 14vw, 4.2rem);
  color: var(--color-wood-dark);
  line-height: 1;
}
.proximidad-copy h2 {
  margin-top: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  color: var(--color-ink);
  max-width: 22ch;
  margin-inline: auto;
}

/* ===========================================================
   SCENE 04 — LA PUERTA ABIERTA
   =========================================================== */
.scene-cierre {
  background: var(--color-wood-dark);
  color: var(--color-bg);
}
.puerta-abierta {
  position: relative;
  width: min(300px, 74vw);
  height: 220px;
  margin-bottom: 32px;
}
.puerta-glow {
  position: absolute;
  inset: 8% 14%;
  background: radial-gradient(ellipse at 50% 40%, var(--color-glow), transparent 72%);
  opacity: .9;
}
.puerta-3d {
  position: absolute;
  inset: 0;
  display: flex;
  perspective: 700px;
}
.hoja {
  flex: 1;
  background: var(--color-wood);
  border: 2px solid var(--color-wood-dark);
  clip-path: polygon(0 14%, 50% 0, 100% 14%, 100% 100%, 0 100%);
}
.hoja-izq {
  transform-origin: left center;
  transform: rotateY(-58deg);
}
.hoja-der {
  transform-origin: right center;
  transform: rotateY(58deg);
}

.cierre-copy .eyebrow { color: var(--color-glow); }
.cierre-copy h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.8rem);
  color: var(--color-bg);
  margin-bottom: 24px;
}
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 30px;
  background: var(--color-accent-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  border-radius: 6px;
  transition: background var(--motion-fast) ease;
}
.cta-button:hover { background: var(--color-accent); }
.cta-note {
  margin-top: 12px;
  font-size: .85rem;
  color: rgba(248,242,230,.7);
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  background: var(--color-wood-dark);
  color: rgba(248,242,230,.62);
  padding: 20px var(--edge) 28px;
  font-size: .78rem;
  line-height: 1.5;
}
.site-footer p { max-width: 62ch; margin-inline: auto; text-align: center; }

/* ===========================================================
   Desktop refinements (>=1024px)
   =========================================================== */
@media (min-width: 1024px) {
  .scene { padding-inline: 64px; }

  .umbral-stage { width: min(420px, 34vw); }
  .letters { font-size: clamp(3.4rem, 6vw, 5rem); }

  .scene-oficio {
    flex-direction: row;
    justify-content: center;
    gap: 90px;
    text-align: left;
  }
  .oficio-visual { width: 360px; height: 280px; }
  .oficio-copy { max-width: 480px; }
  .oficio-text { margin-inline: 0; }

  .scene-proximidad { align-items: center; }

  .puerta-abierta { width: 380px; height: 280px; }
}

/* ===========================================================
   Motion states driven by JS (GSAP). Sin JS, o con
   prefers-reduced-motion, estas clases nunca se añaden y el
   CSS anterior (ya en su estado final legible) se mantiene.
   =========================================================== */
.js-ready .letter { will-change: transform; }
.js-ready .door-frame__outline,
.js-ready .door-frame__sill { will-change: stroke-dashoffset; }

.js-ready .scene-oficio .oficio-visual {
  clip-path: inset(0 100% 0 0);
  opacity: .5;
  transition: clip-path .9s var(--ease-brand), opacity .9s ease;
}
.js-ready .scene-oficio.in-view .oficio-visual {
  clip-path: inset(0 0 0 0);
  opacity: 1;
}
.js-ready .scene-oficio .oficio-copy {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease .15s, transform .6s ease .15s;
}
.js-ready .scene-oficio.in-view .oficio-copy {
  opacity: 1;
  transform: none;
}

.js-ready .scene-cierre .hoja-izq { transform: rotateY(0deg); transition: transform 1s var(--ease-brand); }
.js-ready .scene-cierre .hoja-der { transform: rotateY(0deg); transition: transform 1s var(--ease-brand); }
.js-ready .scene-cierre .puerta-glow { opacity: 0; transition: opacity 1s ease .2s; }
.js-ready .scene-cierre.in-view .hoja-izq { transform: rotateY(-58deg); }
.js-ready .scene-cierre.in-view .hoja-der { transform: rotateY(58deg); }
.js-ready .scene-cierre.in-view .puerta-glow { opacity: .9; }

/* ===========================================================
   Accesibilidad — prefers-reduced-motion
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
  * { scroll-behavior: auto !important; }
}
