/* ==========================================================================
   Base común de las casas de Pablo Gumiel (Nativa, Tierra, Maio).
   Cada casa define sus tokens en house.css; aquí solo hay estructura.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-text);
  font-size: var(--t-md, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 400; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 300; background: var(--accent); color: var(--on-accent); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.wrap {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
:root { --gutter: clamp(16px, 4.2vw, 64px); --ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------------------------------------------------------------- escena */
.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
.no-webgl .scene { display: none; }
main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- carga */
.loader {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--bg);
  transition: opacity 1s var(--ease), visibility 1s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader img { width: 96px; height: 96px; border-radius: 50%; animation: breathe 1.8s ease-in-out infinite; }
.loader__note { font-size: 0.8125rem; color: var(--fg-3); letter-spacing: 0.05em; }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: 16px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  transition: background .5s var(--ease), padding .5s var(--ease);
}
.nav.is-scrolled {
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.nav__brand img { width: 40px; height: 40px; border-radius: 50%; }
.nav__links { display: flex; gap: clamp(16px, 2.2vw, 34px); }
.nav__links a { text-decoration: none; font-size: .9375rem; color: var(--fg-2); position: relative; padding-block: 6px; transition: color .3s; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
.nav__tools { display: flex; align-items: center; gap: 14px; }
.nav__root { font-size: .875rem; color: var(--fg-2); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.nav__root svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: .38; }
.nav__root:hover { color: var(--fg); }

.burger { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
.burger span[aria-hidden] { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease), top .4s var(--ease); }
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 26px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 45; background: var(--menu-bg); overflow-y: auto;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  padding-top: calc(96px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu a { display: block; text-decoration: none; font-family: var(--f-display); font-size: clamp(2.2rem, 10vw, 3.4rem); line-height: 1.15; padding: 6px 0; border-bottom: 1px solid var(--line); }
.menu__foot { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.menu__foot a { font-family: var(--f-text); font-size: 1rem; border: 0; color: var(--fg-2); }

/* ---------------------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--f-text); font-weight: 500; font-size: .9375rem; letter-spacing: .01em;
  border-radius: var(--btn-radius, 0);
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--fg); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 1rem; }

/* ---------------------------------------------------------------- rieles */
.rail {
  display: flex; gap: clamp(12px, 1.6vw, 22px);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  scroll-padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
  cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging .rail__btn { pointer-events: none; }
.rail__item { flex: 0 0 auto; width: clamp(230px, 24vw, 340px); margin: 0; scroll-snap-align: start; display: grid; gap: 10px; align-content: start; }
.rail__btn, .shot { display: block; width: 100%; padding: 0; border: 0; background: var(--bg-2); cursor: pointer; overflow: hidden; max-width: 100%; }
.rail__btn { aspect-ratio: 6 / 5; }
.rail__btn img, .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .8s; }
.rail__btn:hover img, .rail__btn:focus-visible img, .shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.rail__item figcaption { font-size: .9375rem; color: var(--fg-2); }

/* ---------------------------------------------------------------- visor */
.lightbox {
  position: fixed; inset: 0; z-index: 250;
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; gap: 12px;
  background: var(--lb-bg, rgba(10, 10, 10, .96)); color: var(--lb-fg, #eee);
  padding-top: calc(70px + env(safe-area-inset-top, 0px)); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.lightbox__fig { margin: 0; display: grid; justify-items: center; gap: 16px; min-width: 0; }
.lightbox__fig img { max-height: 76vh; width: auto; max-width: 100%; object-fit: contain; }
.lightbox__fig figcaption { font-size: .9375rem; text-align: center; max-width: 60ch; opacity: .8; }
.lightbox__nav { width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.2); background: none; cursor: pointer; display: grid; place-items: center; color: inherit; }
.lightbox__nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lightbox__close { position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); background: none; color: inherit; border: 1px solid rgba(255,255,255,.2); padding: 10px 16px; cursor: pointer; font-size: .9375rem; }
.lightbox__count { position: absolute; top: calc(26px + env(safe-area-inset-top, 0px)); left: max(18px, env(safe-area-inset-left, 0px)); font-size: .9375rem; opacity: .6; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- cursor */
.cursor { display: none; }
@media (pointer: fine) {
  .has-cursor, .has-cursor * { cursor: none !important; }
  .has-cursor input, .has-cursor textarea, .has-cursor select { cursor: auto !important; }
  .has-cursor .cursor { display: block; position: fixed; inset: 0; z-index: 280; pointer-events: none; }
  .cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
  .cursor__ring {
    width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid var(--cursor-ring);
    display: grid; place-items: center;
    transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background .45s, border-color .45s;
  }
  .cursor__text { font-size: 11px; letter-spacing: .06em; color: var(--on-accent); opacity: 0; transition: opacity .3s; white-space: nowrap; }
  .cursor.is-hover .cursor__ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--accent); border-color: var(--accent); }
  .cursor.is-hover .cursor__text { opacity: 1; }
  .cursor.is-hover .cursor__dot { opacity: 0; }
}

/* ---------------------------------------------------------------- estado abierto */
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .9375rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.status.is-open::before { background: var(--open, #6fcf7a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--open, #6fcf7a) 25%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

/* ---------------------------------------------------------------- formulario */
.form { display: grid; gap: 20px; min-width: 0; }
.form__row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.form__row--2 { grid-template-columns: 1.3fr 1fr; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: .8125rem; color: var(--fg-3); letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; background: var(--field-bg); color: var(--fg);
  border: 0; border-bottom: 1px solid var(--fg-3); padding: 12px; font: inherit; font-size: 1rem;
  border-radius: 0; -webkit-appearance: none; appearance: none; transition: border-color .3s, background .3s;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.field select option { background: var(--bg-2); color: var(--fg); }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--danger, #d9603b); }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-3); }
.form__hours { font-size: .9375rem; color: var(--fg-2); }
.form__error { color: var(--danger, #d9603b); font-size: .9375rem; }
.form__error:empty { display: none; }
.form > .btn { justify-self: start; }
.form__done { display: grid; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.form__done-title { font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.05; color: var(--accent-text, var(--accent)); }
.form__msg { margin: 0; white-space: pre-wrap; font: inherit; font-size: .9375rem; color: var(--fg-2); background: var(--field-bg); padding: 16px 18px; border-left: 2px solid var(--accent); overflow-x: auto; }
.form__done-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form__fine { font-size: .8125rem; color: var(--fg-3); max-width: 60ch; }
.form__fine span { color: var(--fg); user-select: all; }

/* ---------------------------------------------------------------- familia (pie) */
.family { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.family a { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; padding: 20px 18px 20px 0; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .3s; }
.family a + a { padding-left: 18px; border-left: 1px solid var(--line); }
.family a:hover { background: var(--hover-bg); }
.family img { width: 44px; height: 44px; border-radius: 50%; }
.family strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.family span { font-size: .8125rem; color: var(--fg-3); }
.foot__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .8125rem; color: var(--fg-3); padding-top: 18px; }
.foot__base a { color: var(--fg-2); text-decoration: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .nav__links { display: none; }
  .burger { display: block; }
}
@media (max-width: 760px) {
  .nav__cta, .nav__root span { display: none; }
  .rail__item { width: 72vw; }
  .form__row, .form__row--2 { grid-template-columns: 1fr; }
  .form > .btn { justify-self: stretch; }
  .family { grid-template-columns: 1fr; }
  .family a + a { padding-left: 0; border-left: 0; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox__nav { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .lightbox__nav--prev { left: max(18px, env(safe-area-inset-left, 0px)); }
  .lightbox__nav--next { right: max(18px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
