/* Dash Estate — «Portal»
   Materiales de México: cal, cantera rosa, tezontle, latón y, rara vez, jacaranda. */
:root {
  --cal: #F3EFEC;
  --cal-deep: #EAE3DE;
  --cantera: #D8B9A8;

  /* Superficie oscura: la «puerta», el bloque de contacto y el pie — mismo tono que el bloque de la celosía */
  --surface: var(--tezontle);
  --on-surface: #F3EFEC;
  --on-surface-soft: rgba(243, 239, 236, .66);
  --surface-line: rgba(243, 239, 236, .14);
  --tezontle: #3B2A28;
  --tezontle-soft: #6E5A55;
  --laton: #A8834F;
  --jacaranda: #9A8AA6;

  --serif: "Marcellus", "Trajan Pro", Georgia, serif;
  --sans: "Albert Sans", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 34rem;
  --ease: cubic-bezier(.65, 0, .25, 1);
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cal);
  color: var(--tezontle);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
p { margin: 0; }
figure { margin: 0; }

:focus-visible { outline: 2px solid var(--laton); outline-offset: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--tezontle); color: var(--cal); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Botones y enlaces ---------- */
.button {
  display: inline-block;
  padding: 1em 1.9em;
  border: 1px solid var(--tezontle);
  border-radius: 999px;
  font: 400 .95rem/1 var(--sans);
  text-decoration: none;
  transition: background-color .3s, color .3s;
}
.button:hover { background: var(--tezontle); color: var(--cal); }
.button--dark { background: var(--tezontle); color: var(--cal); }
.button--dark:hover { background: transparent; color: var(--tezontle); }
.contact .button--dark { background: var(--on-surface); color: var(--surface); border-color: var(--on-surface); }
.contact .button--dark:hover { background: transparent; color: var(--on-surface); }

.link {
  display: inline-block;
  font-weight: 400;
  text-decoration: none;
  background: linear-gradient(var(--laton), var(--laton)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size .4s var(--ease);
}
.link:hover { background-size: 30% 1px; }

/* ---------- Cabecera ---------- */
.header {
  position: fixed; inset: 0 0 auto;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: color .4s, background-color .4s;
}
.header.is-solid { background: rgba(243, 239, 236, .92); backdrop-filter: blur(8px); }
.header.is-light { color: var(--cal); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; }
.brand span { font: 400 1.25rem/1 var(--serif); }
.nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav a { font-size: .95rem; font-weight: 400; text-decoration: none; }
.nav a:not(.nav-cta):hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav-cta { border: 1px solid currentColor; border-radius: 999px; padding: .55em 1.2em; }
.menu { display: none; }

/* ---------- Portal (hero) ---------- */
.portal { position: relative; height: 230vh; }
.portal-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.portal-copy {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-42%);
  max-width: min(32rem, 44vw);
  z-index: 2;
}
.portal-copy h1 { font-size: clamp(2.9rem, 6.4vw, 6rem); line-height: 1.02; }
.portal-copy p { margin: 1.6rem 0 2.2rem; max-width: 24rem; color: var(--tezontle-soft); }

/* Donde se dibuja el arco antes de abrirse: de pie sobre el borde inferior, como una puerta */
.portal-slot {
  position: absolute;
  right: calc(var(--gutter) + 4vw);
  bottom: 0;
  width: min(34vw, 500px);
  height: 80%;
}
.portal-image {
  position: absolute; inset: 0;
  z-index: 1;
  background: var(--tezontle);
  will-change: clip-path;
}
.portal-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; will-change: transform; }
.portal-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(30, 20, 18, .55), transparent 45%);
  opacity: var(--shade, 0);
}
.portal-caption {
  position: absolute;
  left: var(--gutter); bottom: clamp(28px, 7vh, 64px);
  z-index: 2;
  max-width: 22ch;
  color: var(--cal);
  font: 400 clamp(1.6rem, 3.2vw, 2.8rem)/1.15 var(--serif);
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- Manifiesto ---------- */
.manifesto { padding: clamp(110px, 18vh, 200px) var(--gutter); text-align: center; }
.manifesto-line { font: 400 clamp(2rem, 4.6vw, 4.1rem)/1.12 var(--serif); }
.manifesto-note { margin: 2rem auto 0; max-width: 30rem; color: var(--tezontle-soft); }

/* ---------- Arcos ---------- */
.arch { overflow: hidden; border-radius: 999px 999px 0 0; background: var(--cal-deep); }
.arch img { width: 100%; height: 100%; object-fit: cover; }

[data-rise] { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease); }
[data-rise] img { transform: scale(1.12); transition: transform 1.8s var(--ease); }
[data-rise].is-in { clip-path: inset(0 0 0 0); }
[data-rise].is-in img { transform: none; }

/* ---------- Espacios ---------- */
.spaces {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 110px);
  padding: 0 var(--gutter) clamp(110px, 16vh, 180px);
  align-items: start;
}
.spaces-text { position: sticky; top: 120px; max-width: 24rem; }
.spaces-text h2, .method h2, .founder h2, .contact h2 { font-size: clamp(2.2rem, 4.2vw, 3.8rem); line-height: 1.06; }
.spaces-text p { margin: 1.4rem 0 1.8rem; color: var(--tezontle-soft); }
.spaces-arches { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); }
.arch--tall { aspect-ratio: 3 / 5; }
.arch--short { aspect-ratio: 3 / 4; }
.spaces-arches .arch:nth-child(2) { margin-top: 22%; }
.spaces-arches .arch:nth-child(3) { margin-top: -6%; }
.spaces-arches .arch:nth-child(4) { margin-top: 0; }

/* ---------- Método ---------- */
.method { padding: clamp(100px, 14vh, 160px) var(--gutter); background: var(--cal-deep); }
.method-lead { margin-top: 1.4rem; max-width: var(--measure); color: var(--tezontle-soft); }
.steps {
  list-style: none; margin: clamp(56px, 9vh, 96px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 64px);
  border-top: 1px solid var(--laton);
}
.steps li { position: relative; padding-top: 2.2rem; max-width: 22rem; }
.steps li::before {
  content: ""; position: absolute; top: -5px; left: 0;
  width: 9px; height: 9px; border-radius: 50%; background: var(--laton);
}
.step-n { display: block; font: 400 1rem/1 var(--serif); color: var(--laton); margin-bottom: 1rem; }
.steps h3 { font-size: 1.6rem; line-height: 1.15; margin-bottom: .7rem; }
.steps p { color: var(--tezontle-soft); }

/* ---------- Fundadora ---------- */
.founder {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 7vw, 120px);
  align-items: center;
  padding: clamp(110px, 16vh, 180px) var(--gutter);
}
.founder-photo { aspect-ratio: 3 / 4.2; max-width: 460px; justify-self: end; width: 100%; }
.founder-photo img { object-position: 50% 20%; }
.founder-text { max-width: var(--measure); }
.founder-text p { margin: 1.6rem 0; }
.founder blockquote {
  margin: 2.2rem 0 2.4rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--jacaranda);
  font: 400 1.45rem/1.35 var(--serif);
}

/* ---------- Lugares ---------- */
.places { padding: 0 var(--gutter) clamp(110px, 16vh, 180px); text-align: center; }
.places h2 { font-size: 1.15rem; font-family: var(--sans); font-weight: 400; color: var(--tezontle-soft); letter-spacing: 0; }
.cities {
  list-style: none; margin: 2.4rem 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .2em 1.1em;
  font: 400 clamp(1.9rem, 4.6vw, 4.2rem)/1.15 var(--serif);
}
.cities li { display: flex; align-items: center; gap: .5em; }
.cities li::before { content: ""; width: .16em; height: .16em; background: var(--laton); transform: rotate(45deg); }
.places p { max-width: 28rem; margin: 0 auto; color: var(--tezontle-soft); }

/* ---------- Contacto ---------- */
.contact { background: var(--surface); color: var(--on-surface); padding: clamp(100px, 15vh, 170px) var(--gutter); border-radius: 50vw 50vw 0 0 / 14vw 14vw 0 0; }
.contact-inner { max-width: 44rem; margin: 0 auto; text-align: center; }
.contact h2 { font-size: clamp(2.8rem, 6vw, 5.4rem); }
.contact p { margin: 1.4rem auto 2.4rem; max-width: 24rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: center; align-items: center; }
.phone { font-weight: 400; text-decoration: none; }
.phone:hover { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Pie ---------- */
.footer {
  background: var(--surface); color: var(--on-surface);
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 24px 48px;
  padding: 40px var(--gutter) 36px;
  border-top: 1px solid var(--surface-line);
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 52px; }
.footer-brand span { font: 400 1.35rem/1.1 var(--serif); }
.footer-brand small { display: block; margin-top: 4px; font: 300 .8rem/1 var(--sans); color: var(--on-surface-soft); }
.footer nav { display: flex; gap: 28px; justify-content: center; }
.footer a { text-decoration: none; font-size: .95rem; }
.footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.footer small { font-size: .85rem; color: var(--on-surface-soft); }

/* ---------- Puerta (transición entre páginas) ---------- */
.door {
  position: fixed; left: 50%; bottom: 0;
  width: 160vmax; height: 200vh;
  margin-left: -80vmax;
  z-index: 90;
  background: var(--surface);
  border-radius: 80vmax 80vmax 0 0;
  transform: translateY(105%);
  transition: transform 1s var(--ease);
  pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center;
}
.door img { width: 84px; margin-bottom: calc(50vh - 42px); opacity: 0; transition: opacity .4s; }
.is-entering .door { transform: translateY(0); transition: none; animation: door-fallback .9s var(--ease) 2.5s forwards; }
/* Si el script no llega a abrir la puerta (caché antigua, error), se abre sola */
@keyframes door-fallback { to { transform: translateY(105%); } }
@keyframes copy-fallback { to { opacity: 1; transform: none; } }
.is-entering .door img, .is-leaving .door img { opacity: 1; }
.is-leaving .door { transform: translateY(0); }

/* Al cargar: la página aparece cuando la puerta baja */
.portal-copy > * { transition: opacity .9s, transform 1.1s var(--ease); }
.is-entering .portal-copy > * { opacity: 0; transform: translateY(24px); animation: copy-fallback .9s var(--ease) 2.7s forwards; }
.portal-copy > :nth-child(2) { transition-delay: .1s; }
.portal-copy > :nth-child(3) { transition-delay: .2s; }

/* ---------- Páginas en preparación ---------- */
.stub { min-height: 100vh; min-height: 100svh; display: grid; place-content: center; text-align: center; padding: 120px var(--gutter); }
.stub h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.05; }
.stub p { margin: 1.4rem 0 2.2rem; color: var(--tezontle-soft); }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .menu {
    display: grid; gap: 7px; width: 44px; height: 44px; place-content: center;
    background: none; border: 0; color: inherit; cursor: pointer; z-index: 2;
  }
  .menu span { display: block; width: 24px; height: 1px; background: currentColor; transition: transform .35s var(--ease); }
  .menu[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 0;
    flex-direction: column; justify-content: center; gap: 28px;
    background: var(--cal); color: var(--tezontle);
    clip-path: inset(100% 0 0 0 round 50vw 50vw 0 0);
    transition: clip-path .7s var(--ease);
    visibility: hidden;
  }
  .nav a { font: 400 2rem/1 var(--serif); }
  .nav .nav-cta { font: 400 1rem/1 var(--sans); padding: .9em 1.8em; }
  .nav.is-open { clip-path: inset(0 0 0 0 round 0); visibility: visible; }
  .header:has(.nav.is-open) { color: var(--tezontle); }

  .portal { height: 210vh; }
  /* Móvil: el texto va arriba en flujo y el arco ocupa exactamente el espacio que queda */
  .portal-stage { display: flex; flex-direction: column; }
  .portal-copy { position: relative; left: auto; top: auto; transform: none; max-width: none; padding: 92px var(--gutter) 0; }
  .is-entering .portal-copy > * { transform: translateY(24px); }
  .portal-copy p { margin: 1rem 0 1.4rem; }
  .portal-slot { position: relative; right: auto; bottom: auto; flex: 1 1 auto; min-height: 0; align-self: center; width: min(80vw, 520px); height: auto; margin-top: clamp(20px, 4vh, 40px); }
  .cities { flex-direction: column; align-items: center; gap: .15em; font-size: clamp(2rem, 9vw, 2.6rem); }
  .cities li::before { display: none; }

  .spaces, .founder { grid-template-columns: 1fr; }
  .spaces-text { position: static; }
  .founder-photo { justify-self: start; max-width: 340px; }
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--laton); gap: 40px; padding-left: 28px; }
  .steps li { padding-top: 0; }
  .steps li::before { top: 6px; left: -33px; }
  .contact { border-radius: 50vw 50vw 0 0 / 22vw 22vw 0 0; }
  .footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer nav { flex-wrap: wrap; }
}
@media (max-width: 860px) and (max-height: 640px) {
  .portal-copy h1 { font-size: 2.5rem; }
  .portal-copy p { display: none; }
  .portal-copy .button { margin-top: 1.4rem; }
}

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .portal { height: auto; }
  .portal-stage { position: relative; height: 100vh; height: 100svh; }
  [data-rise], [data-rise] img { clip-path: none; transform: none; transition: none; }
  .door { display: none; }
  .is-entering .portal-copy > * { opacity: 1; transform: none; }
  * { scroll-behavior: auto !important; }
}
