/* LOBO · Donostia
   Concepto: negro puro, tipografía blanca y un único gesto, la garra.
   Los efectos de scroll viven en js/main.js; aquí solo el estado inicial. */

:root {
  --bg: #000000;
  --ink: #ffffff;
  --ink-soft: #c9ced3;
  --muted: #a3a9b0;
  --dim: #5a6168;
  --line: #22262b;
  --panel: #0d0f11;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(20px, 6.67vw, 96px);
  --section-y: clamp(96px, 11.1vw, 160px);
  --nav-h: 96px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/1.6 var(--sans);
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }

a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.skip {
  position: fixed; left: 16px; top: -64px; z-index: 100;
  padding: 12px 20px; background: var(--ink); color: var(--bg);
  font: 400 13px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
}
.skip:focus { top: 16px; }

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Piezas reutilizables ---------- */

.eyebrow {
  font: 400 13px/1.2 var(--sans);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.h2 {
  margin: 0;
  font: 400 clamp(40px, 4.45vw, 64px)/1.05 var(--serif);
  text-wrap: balance;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 40px;
  border: 1px solid var(--ink);
  font: 400 13px/1 var(--sans);
  letter-spacing: 0.24em; text-transform: uppercase;
  transition: background 0.4s ease, color 0.4s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--sm { min-height: 48px; padding: 0 32px; }

.link-u {
  align-self: flex-start;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
  font: 400 12px/1.2 var(--sans);
  letter-spacing: 0.24em; text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.link-u:hover { opacity: 0.6; }

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

/* ---------- Progreso de scroll ---------- */

#progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Navegación ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand { display: flex; }
.brand img { width: 112px; height: auto; }
.nav-links { display: flex; align-items: center; gap: 56px; }
.nav-links a {
  font: 400 13px/1 var(--sans);
  letter-spacing: 0.24em; text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.nav-links a:hover { opacity: 0.6; }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  min-height: max(100svh, 760px);
  padding: calc(var(--nav-h) + 48px) 0 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.hero-grid {
  position: relative; z-index: 1;
  flex: 1; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center;
  gap: clamp(32px, 5vw, 96px);
}
.hero-left { display: flex; flex-direction: column; gap: 32px; }
.hero h1 {
  margin: 0;
  font: 400 clamp(40px, 5vw, 78px)/1.04 var(--serif);
  text-wrap: balance;
  text-shadow: 0 0 28px #000, 0 0 8px #000;
}
/* Garra 2D: gris, grande y por detrás del contenido. La copia blanca se ilumina bajo el cursor (js/claw.js) */
.hero-mark {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.claw-art { position: relative; height: clamp(520px, 128svh, 1240px); aspect-ratio: 1581 / 3000; flex: none; }
.claw { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.claw--dim { filter: brightness(0.15); }
.claw--lit {
  -webkit-mask-image: radial-gradient(circle 1px at -999px -999px, #000, transparent);
  mask-image: radial-gradient(circle 1px at -999px -999px, #000, transparent);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  opacity: 0.4;   /* la luz es suave: no tapa las letras blancas */
}
.hero-right { display: flex; flex-direction: column; align-items: flex-start; gap: 32px; justify-self: end; width: min(100%, 360px); text-shadow: 0 0 18px #000; }
.hero-today { display: flex; flex-direction: column; gap: 12px; }
.hero-open { font: 400 clamp(26px, 2.4vw, 34px)/1.15 var(--serif); }
.hero-addr { font-size: 16px; line-height: 1.7; color: var(--ink-soft); }

.scroll-cue {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  font: 400 12px/1 var(--sans); letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue i { display: block; width: 1px; height: 64px; background: var(--ink); transform: scaleY(0); transform-origin: top; }

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue i { animation: cue 2.4s ease-in-out infinite; }
}
@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  50.01% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue i { transform: scaleY(1); }
  #progress { display: none; }
}

/* ---------- Frase de presentación ---------- */

.statement { padding: var(--section-y) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.statement p {
  max-width: 1000px; margin: 0 auto; text-align: center;
  font: italic 400 clamp(32px, 4.2vw, 60px)/1.18 var(--serif);
  text-wrap: balance;
}
.word { color: var(--ink); }

/* ---------- El lobo (js/wolf.js) ---------- */

.wolf { position: relative; background: #000; }
.wolf-fallback { display: block; width: 100%; height: auto; }
.wolf-canvas { display: none; }
.wolf.is-live { height: 340vh; margin-bottom: -34vh; }   /* la carta sube sobre el final: sin hueco tras el logo */
.wolf.is-live + .section { position: relative; z-index: 1; background: #000; padding-top: clamp(48px, 6vw, 88px); }
.wolf.is-live .wolf-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.wolf.is-live .wolf-canvas { display: block; width: 100%; height: 100%; }
.wolf.is-live .wolf-fallback { display: none; }
.wolf-logo { display: none; }
.wolf.is-live .wolf-logo {
  display: block; position: absolute; left: 50%; top: 46%;
  width: clamp(140px, 18vw, 260px); height: auto; opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%);
}

/* ---------- Secciones ---------- */

.section { padding: var(--section-y) 0; border-top: 1px solid var(--line); }
#carta { border-top: 0; }
.section-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(48px, 5.6vw, 80px); }

/* Carta: carrusel con bucle (js/carousel.js) */
.carta-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  margin-bottom: clamp(40px, 4.5vw, 64px);
}
.carta-head .section-head { margin: 0; }
.carousel-ctrl { display: flex; align-items: center; gap: 12px; }
.ctrl-count { margin-right: 20px; font: 400 22px/1 var(--serif); color: var(--dim); letter-spacing: 0.04em; }
.ctrl-count b { font-weight: 400; color: var(--ink); }
.ctrl-btn {
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; transition: background 0.4s ease, color 0.4s ease;
}
.ctrl-btn:hover { background: var(--ink); color: var(--bg); }
.ctrl-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.ctrl-btn--prev svg { transform: scaleX(-1); }

.carousel {
  --per: 3.25; --gap: 32px;
  /* alineado con el contenido a la izquierda; a la derecha las tarjetas llegan al borde de la pantalla */
  padding-left: max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter)));
}
.carousel-viewport {
  overflow: hidden; overflow: clip;
  padding: 20px 0; margin: -20px 0; /* margen para la inclinación de las tarjetas */
  touch-action: pan-y; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.carousel[data-dragging] .carousel-viewport { cursor: grabbing; }
.carousel-track { display: flex; gap: var(--gap); will-change: transform; }
.card {
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  min-width: 0;
  display: flex; flex-direction: column; gap: 24px;
}
.card-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg); border: 1px solid var(--line);
  /* el marco se inclina hacia el cursor y la foto se desplaza y hace zoom (js/fx.js) */
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.card-media.is-tilting { transition: transform 0.14s linear; }
.card-zoom {
  position: absolute; inset: 0; display: block;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(var(--zs, 1.1)); /* 1.1 = margen para el desplazamiento de la foto */
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card-media.is-tilting .card-zoom { transition: transform 0.18s linear; }
.card-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; -webkit-user-drag: none;
}
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle 260px at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.2), transparent 65%);
  transition: opacity 0.5s ease;
}
.card:hover .card-media::after { opacity: 1; }
.card-n {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  padding: 8px 10px 7px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 400 12px/1 var(--sans); letter-spacing: 0.24em; color: var(--ink);
}
.card-body { display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font: 400 clamp(30px, 2.8vw, 40px)/1.08 var(--serif); overflow-wrap: anywhere; }
.card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.card-more {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.card-more .link-u { align-self: auto; }
.card-arrow {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
.card-more:hover .card-arrow, .card-more:focus-visible .card-arrow { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.carousel-dots { display: flex; gap: 10px; margin-top: clamp(32px, 3.6vw, 48px); }
.carousel-dots button {
  width: 40px; height: 14px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative;
}
.carousel-dots button::after {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--line);
  transition: background 0.4s ease;
}
.carousel-dots button.is-active::after { background: var(--ink); }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.gal-item { margin: 0; }
.mask {
  overflow: hidden; aspect-ratio: 1 / 1;
  background: var(--panel); border: 1px solid var(--line);
}
.mask { position: relative; will-change: transform; }
.mask img { width: 100%; height: 100%; object-fit: cover; }
/* Galería: las fotos están algo apagadas (87 %) y se encienden al 100 % al pasar el cursor */
.mask img { opacity: 0.87; transition: opacity 0.5s ease; }
.gal-item:hover .mask img { opacity: 1; }

/* Visítanos */
.visit {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(48px, 6.67vw, 96px); align-items: stretch;
}
.visit-info { display: flex; flex-direction: column; justify-content: space-between; gap: 64px; }
.info-list { margin: 0; padding: 0; }
.info-row { display: flex; flex-direction: column; gap: 12px; padding: 32px 0; border-top: 1px solid var(--line); }
.info-row:last-child { border-bottom: 1px solid var(--line); }
.info-row dt { font: 400 12px/1.2 var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.info-row dd { margin: 0; font: 400 clamp(24px, 2.2vw, 32px)/1.2 var(--serif); overflow-wrap: anywhere; }

/* Mapa: en gris; al pasar el ratón (o tocarlo) pasa a color */
.map {
  position: relative; overflow: hidden;
  min-height: clamp(320px, 36vw, 520px);
  border: 1px solid var(--line); background: var(--panel);
}
.map-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(24px, 3vw, 40px);
}
.map-mark {
  position: absolute; right: 8%; top: 50%; height: 80%; width: auto; max-width: none;
  transform: translateY(-50%); opacity: 0.07;
}
.map-title { position: relative; font: 400 clamp(24px, 2.2vw, 32px)/1.2 var(--serif); }
.map-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
  filter: grayscale(1) brightness(0.82) contrast(1.08);
  transition: filter 0.7s ease, opacity 0.6s ease;
}
.js .map-frame { opacity: 0; }
.js .map.is-ready .map-frame { opacity: 1; }
.map:hover .map-frame, .map:focus-within .map-frame { filter: none; }
.map-open {
  position: absolute; left: clamp(12px, 1.6vw, 20px); bottom: clamp(12px, 1.6vw, 20px);
  padding: 10px 14px; background: rgba(0, 0, 0, 0.82);
  font: 400 12px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
}

/* Pie */
.footer { padding: clamp(72px, 8.3vw, 120px) 0 48px; border-top: 1px solid var(--line); }
.footer-top { display: flex; justify-content: space-between; gap: 64px; flex-wrap: wrap; margin-bottom: clamp(56px, 6.67vw, 96px); }
.footer-brand { flex: 1 1 280px; display: flex; flex-direction: column; gap: 32px; }
.footer-brand img { width: 176px; height: auto; }
.footer-brand p { margin: 0; max-width: 320px; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.footer-col { flex: 0 1 220px; display: flex; flex-direction: column; gap: 20px; font-size: 15px; }
.footer-col address { line-height: 1.7; }
.footer-open { color: var(--ink-soft); }
.footer-col a { transition: opacity 0.3s ease; }
.footer-col a:hover { opacity: 0.6; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-top: 32px; border-top: 1px solid var(--line);
  font: 400 12px/1.4 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Estados iniciales de los efectos (solo con JS activo) ---------- */

.js .nav,
.js .hero-left > .eyebrow,
.js .hero-right > *,
.js .scroll-cue,
.js [data-reveal],
.js [data-stagger] > * { opacity: 0; }
.js .claw-art { clip-path: inset(0% 0% 100% 0%); }
.js .mask { clip-path: inset(100% 0% 0% 0%); }
.js .word { color: var(--dim); }

/* ---------- Tablet y móvil ---------- */

@media (max-width: 1099.98px) {
  .carousel { --per: 2.5; --gap: 24px; }
}

@media (max-width: 899.98px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; justify-items: start; }
  .hero-right { justify-self: start; }
  .claw-art { height: clamp(460px, 100svh, 900px); }
  .scroll-cue { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .visit { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599.98px) {
  /* móvil: dos columnas */
  .carousel { --per: 2; --gap: 12px; padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
  .carousel-viewport { padding-top: 12px; padding-bottom: 12px; margin-top: -12px; margin-bottom: -12px; }
  .carta-head { align-items: flex-end; gap: 20px; }
  .ctrl-count { display: none; }
  .ctrl-btn { width: 48px; height: 48px; }
  .card { gap: 16px; }
  .card-n { top: 10px; left: 10px; padding: 6px 8px 5px; font-size: 11px; }
  .card h3 { font-size: 26px; }
  .card p { font-size: 13px; }
  .card-more { padding-top: 14px; gap: 8px; }
  .card-more .link-u { font-size: 11px; letter-spacing: 0.2em; padding-bottom: 4px; }
  .card-arrow { width: 34px; height: 34px; }
  .card-arrow svg { width: 15px; height: 15px; }
  .btn { padding: 0 28px; }
}

/* ---------- Loader de entrada (js/loader.js) ---------- */

.loader { display: none; }
.js .loader {
  display: block; position: fixed; inset: 0; z-index: 100;
  pointer-events: all; opacity: 1; transition: opacity 0.5s ease;
}
.loader.is-out { opacity: 0; pointer-events: none; }
.loader-cv { position: absolute; inset: 0; display: block; }
.loader-count {
  position: absolute; left: 0; right: 0; bottom: max(40px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font: 400 12px/1 var(--sans); letter-spacing: 0.32em; color: var(--ink);
  mix-blend-mode: difference;
}
.loader-num { font-variant-numeric: tabular-nums; min-width: 4ch; text-align: center; padding-left: 0.32em; }
.loader-bar { display: block; width: 96px; height: 1px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.loader-bar b { display: block; width: 100%; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
html.is-loading, html.is-loading body { overflow: hidden; }
