@font-face {
  font-family: 'Viner Hand ITC';
  src: url('../assets/VINERITC.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --parchment: #FBF4E4;
  --parchment-deep: #F4E8CD;
  --amphora: #9C6127;
  --amphora-dark: #6E441C;
  --terra: #C96F3B;
  --gold: #D9A63F;
  --ink: #39301F;
  --roman-red: #AE3D28;
  --olive: #77714A;
  --grad-warm: linear-gradient(120deg, #C96F3B, #AE3D28);
  --grad-gold: linear-gradient(90deg, var(--roman-red), var(--gold));
  --shadow-warm: 0 24px 48px -20px rgba(110, 68, 28, .35);
  --shadow-soft: 0 12px 28px -14px rgba(110, 68, 28, .3);
  --display: 'Marcellus', serif;
  --hand: 'Viner Hand ITC', 'Marcellus', cursive;
  --body: 'Karla', system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--parchment);
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block
}

::selection {
  background: rgba(217, 166, 63, .4)
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(217, 166, 63, .7);
  outline-offset: 2px;
  border-radius: 6px
}

/* grano sutil sobre toda la página */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: multiply;
}

/* ---------- HEADER / NAV (cristal cálido) ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 2rem;
  background: rgba(251, 244, 228, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid rgba(156, 97, 39, .18);
  box-shadow: 0 10px 30px -18px rgba(110, 68, 28, .25);
}

.brand {
  font-family: var(--hand);
  font-size: 1.65rem;
  letter-spacing: .06em;
  text-decoration: none;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  background: linear-gradient(120deg, var(--amphora-dark), var(--roman-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: filter .25s;
}

.brand:hover {
  filter: brightness(1.25)
}

.brand img {
  height: 2.8rem;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(110, 68, 28, .35))
}

.brand small {
  display: block;
  font-size: .6rem;
  letter-spacing: .44em;
  text-transform: uppercase;
  font-family: var(--display);
  background: none;
  -webkit-text-fill-color: var(--terra);
  color: var(--terra)
}

/* El menú de enlaces no se muestra en escritorio: el menú es el grid.
   Sigue existiendo para el desplegable en móvil. */
nav#mainnav {
  display: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end
}

nav a {
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: .5rem .85rem;
  border-radius: 999px;
  transition: color .2s, background .2s, box-shadow .2s;
}

nav a:hover {
  color: var(--roman-red);
  background: rgba(217, 166, 63, .16)
}

nav a.active {
  background-image: var(--grad-warm);
  color: #FDF8EC;
  box-shadow: 0 6px 16px -8px rgba(174, 61, 40, .6);
}

/* Botón de menú: indicación clara con icono de rejilla; abre el grid */
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: rgba(255, 252, 244, .55);
  border: 1.5px solid rgba(156, 97, 39, .4);
  color: var(--amphora-dark);
  font-family: var(--body);
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: .5rem 1.1rem .5rem .95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  margin-right: 1.2rem;
}

.menu-btn:hover {
  color: var(--roman-red);
  border-color: var(--gold);
  background: rgba(217, 166, 63, .18);
  box-shadow: 0 8px 20px -12px rgba(174, 61, 40, .5);
}

.menu-btn .menu-ic {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* estado activo: cuando el grid está abierto */
body.grid-view .menu-btn {
  color: #FDF8EC;
  background-image: var(--grad-warm);
  border-color: transparent;
}

/* ---------- SLIDING CANVAS (the Flash signature) ---------- */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 300vw;
  height: 300vh;
  display: grid;
  grid-template-columns: repeat(3, 100vw);
  grid-template-rows: repeat(3, 100vh);
  transform: translate(-100vw, -100vh);
  /* inicio = centro del grid */
  transform-origin: 0 0;
  transition: transform 1.15s cubic-bezier(.22, .9, .28, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  #canvas {
    transition: none
  }
}

section.panel {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 6.4rem 2rem 3.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 97, 39, .45) transparent;
  transition: transform .6s cubic-bezier(.22, .9, .28, 1);
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(217, 166, 63, .16), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(201, 111, 59, .12), transparent 55%),
    var(--parchment);
}

.inner {
  max-width: 940px;
  margin: 0 auto
}

h1,
h2 {
  font-family: var(--hand);
  font-weight: 400;
  color: var(--amphora-dark);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.05;
  background: linear-gradient(120deg, var(--amphora-dark) 10%, var(--roman-red) 55%, var(--terra));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: .35rem;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  margin-bottom: 1.1rem;
  position: relative;
  padding-bottom: .6rem
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 82px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad-gold);
  box-shadow: 0 2px 8px -2px rgba(174, 61, 40, .5);
}

p {
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 64ch;
  text-wrap: pretty;
  hanging-punctuation: first last;
}

.lede {
  font-size: 1.16rem;
  color: var(--amphora-dark);
  line-height: 1.6;
}

/* ---------- Refinamiento tipográfico ----------
   Énfasis como pequeña etiqueta (no negrita pesada) para nombres y vinos */
p strong {
  font-weight: 600;
  color: var(--amphora-dark);
  letter-spacing: .015em;
}

/* Primer párrafo de las secciones narrativas: cuerpo con más presencia */
#carta .split p:first-child,
#puerto .split p:first-child,
#bodegas .split p:first-child,
#nombre .inner > p:first-of-type {
  font-size: 1.06rem;
  line-height: 1.72;
}

/* Letra capital romana — abre cada relato como un manuscrito */
#carta .split p:first-child::first-letter,
#puerto .split p:first-child::first-letter,
#bodegas .split p:first-child::first-letter,
#nombre .inner > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.5em;
  line-height: .72;
  padding: .08em .12em 0 0;
  margin-top: .04em;
  color: var(--terra);
  font-weight: 400;
}

/* Primera línea del relato, en versalitas suaves para dar entrada */
#carta .split p:first-child::first-line,
#puerto .split p:first-child::first-line,
#bodegas .split p:first-child::first-line,
#nombre .inner > p:first-of-type::first-line {
  font-variant: small-caps;
  letter-spacing: .02em;
  color: var(--amphora-dark);
}

/* panel background alternation */
.panel:nth-child(even) {
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(217, 166, 63, .2), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(174, 61, 40, .08), transparent 55%),
    var(--parchment-deep);
}

/* ---------- OVERVIEW (zoom out al grid completo) ---------- */
#canvas.overview section.panel {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(156, 97, 39, .28);
  border-radius: 18px;
  box-shadow: 0 50px 90px -40px rgba(110, 68, 28, .5);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

#canvas.overview section.panel:hover {
  border-color: rgba(217, 166, 63, .75);
  box-shadow: 0 60px 100px -38px rgba(110, 68, 28, .55);
}

#canvas.overview iframe {
  pointer-events: none;
}

/* número de página y flecha, solo en la vista overview */
.panel-num,
.panel-arrow {
  display: none;
}

#canvas.overview .panel-num,
#canvas.overview .panel-arrow {
  display: block;
  position: absolute;
  z-index: 3;
  pointer-events: none;
  color: var(--terra);
  transition: transform .3s, color .3s;
}

#canvas.overview .panel-num {
  top: 3.2rem;
  left: 3rem;
  font-family: var(--hand);
  font-size: 4.6rem;
  line-height: 1;
}

#canvas.overview .panel-arrow {
  right: 3rem;
  bottom: 3rem;
}

#canvas.overview .panel-arrow svg {
  width: 150px;
  height: auto;
}

/* hover del panel → reacciona el número y la flecha */
#canvas.overview section.panel:hover .panel-num {
  transform: scale(1.06);
  color: var(--roman-red);
}

#canvas.overview section.panel:hover .panel-arrow {
  transform: translateX(26px);
  color: var(--roman-red);
}

/* ---------- Compass: navegación a las secciones contiguas del grid ----------
   Sin caja: tinta sobre el mantel. Etiquetas manuscritas y flechas de trazo curvo,
   con un halo color pergamino para mantener la legibilidad sobre el contenido. */
#compass a {
  position: fixed;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--hand);
  font-size: 1.08rem;
  letter-spacing: .04em;
  color: var(--amphora-dark);
  text-decoration: none;
  text-align: center;
  max-width: 260px;
  text-shadow: 0 0 8px var(--parchment), 0 0 16px var(--parchment), 0 0 26px var(--parchment);
  transition: color .2s, transform .3s;
}

#compass a:hover {
  color: var(--roman-red)
}

#compass a[hidden] {
  display: none
}

#compass svg {
  flex: none;
  filter: drop-shadow(0 0 6px var(--parchment))
}

#compass .c-left {
  left: 1.6rem;
  bottom: 1.9rem
}

#compass .c-left:hover {
  transform: translateX(-5px)
}

#compass .c-right {
  right: 1.6rem;
  bottom: 1.9rem
}

#compass .c-right:hover {
  transform: translateX(5px)
}

#compass .c-up {
  left: auto;
  right: 2.2rem;
  top: 5.6rem;
  flex-direction: column;
  gap: .15rem
}

#compass .c-up:hover {
  transform: translateY(-5px)
}

#compass .c-down {
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  flex-direction: column;
  gap: .15rem
}

#compass .c-down:hover {
  transform: translateX(-50%) translateY(5px)
}

/* En Garum Bistrot la carta a dos columnas llega al centro-abajo:
   movemos el navegador inferior a la esquina derecha (sin vecino derecho). */
body[data-section="bistrot"] #compass .c-down {
  left: auto;
  right: 1.9rem;
  bottom: 1.9rem;
  transform: none;
}

body[data-section="bistrot"] #compass .c-down:hover {
  transform: translateY(5px)
}

/* Las diagonales solo se usan en Inicio (el único panel con las cuatro esquinas
   como vecinas): ocultas por defecto en el resto de secciones. */
#compass .c-upleft,
#compass .c-upright,
#compass .c-downright {
  display: none;
}

/* ---- Inicio: brújula a medida ----
   «Garum Bistrot» (derecha) tiene su CTA y «Cómo Llegar» (abajo) se ocultan.
   Se colocan tres diagonales: «Las Bodegas» bajo «Del Puerto al Plato»,
   «La Carta» sobre «El Nombre» y «Conoce la Quinta» en la esquina inferior derecha. */
body[data-section="inicio"] #compass .c-right,
body[data-section="inicio"] #compass .c-down {
  display: none;
}

body[data-section="inicio"] #compass .c-upright {
  display: flex;
  left: auto;
  right: 2.2rem;
  top: 11rem;
  bottom: auto;
}

body[data-section="inicio"] #compass .c-upright:hover {
  transform: translate(4px, -4px)
}

body[data-section="inicio"] #compass .c-upleft {
  display: flex;
  left: 1.6rem;
  right: auto;
  bottom: 5.2rem;
  top: auto;
}

body[data-section="inicio"] #compass .c-upleft:hover {
  transform: translate(-4px, -4px)
}

body[data-section="inicio"] #compass .c-downright {
  display: flex;
  left: auto;
  right: 1.6rem;
  bottom: 1.9rem;
  top: auto;
}

body[data-section="inicio"] #compass .c-downright:hover {
  transform: translate(4px, 4px)
}

body.grid-view #compass {
  display: none
}

/* ---------- HOME ---------- */
#inicio .inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 3.2rem;
  align-items: center;
  min-height: calc(100vh - 10rem)
}

#inicio figure {
  position: relative
}

#inicio figure img {
  border-radius: 20px;
  box-shadow: var(--shadow-warm)
}

#inicio figure::before {
  content: "";
  position: absolute;
  inset: -16px 16px 16px -16px;
  border: 2px solid rgba(201, 111, 59, .5);
  border-radius: 22px;
  z-index: -1;
  transform: rotate(-2deg);
}

#inicio figure::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 120px;
  height: 120px;
  z-index: -1;
  background: radial-gradient(circle, rgba(217, 166, 63, .5), transparent 70%);
  border-radius: 50%;
}

/* Ánforas como imagen principal: ilustración transparente flotando sobre un halo */
#inicio figure.amphora-hero {
  display: flex;
  justify-content: center;
  align-items: center;
}

#inicio figure.amphora-hero img {
  border-radius: 0;
  box-shadow: none;
  width: auto;
  max-height: min(66vh, 580px);
  filter: drop-shadow(0 26px 34px rgba(110, 68, 28, .38));
  animation: amphora-fade 10s ease-in-out infinite;
}

#inicio figure.amphora-hero::before {
  display: none;
}

#inicio figure.amphora-hero::after {
  right: auto;
  bottom: auto;
  left: 50%;
  top: 50%;
  width: min(42vw, 440px);
  height: min(42vw, 440px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(217, 166, 63, .55), rgba(201, 111, 59, .12) 46%, transparent 70%);
}

@keyframes amphora-float {
  0%, 100% { transform: translateY(5px) }
  50%      { transform: translateY(-7px) }
}


@keyframes amphora-fade {
  5%, 95% { opacity: .7 }
  50%      { opacity: 1 }
}

@media (prefers-reduced-motion: reduce) {
  #inicio figure.amphora-hero img { animation: none;}
}

.kicker {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .45em;
  text-transform: uppercase;
  color: var(--roman-red);
  background: rgba(217, 166, 63, .18);
  border: 1px solid rgba(217, 166, 63, .4);
  padding: .45rem .9rem .45rem 1.1rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.home-cta {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #FDF8EC;
  background-image: var(--grad-warm);
  padding: .95rem 1.9rem;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 14px 28px -12px rgba(174, 61, 40, .55);
  transition: transform .25s, box-shadow .25s, filter .25s;
}

.home-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px -12px rgba(174, 61, 40, .6);
  filter: brightness(1.06)
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.home-actions .home-cta {
  margin-top: 0;
}

/* CTA secundario: contorno cálido que se rellena al pasar el ratón */
.home-cta.ghost {
  background: rgba(255, 252, 244, .5);
  background-image: none;
  color: var(--amphora-dark);
  border: 1.5px solid var(--amphora);
  box-shadow: none;
}

.home-cta.ghost:hover {
  background-image: var(--grad-warm);
  border-color: transparent;
  color: #FDF8EC;
}

/* ---------- content layouts ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.8rem;
  align-items: start
}

.split img {
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform .35s, box-shadow .35s;
}

.split img:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-warm)
}

#bodegas .bodegas-visual {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

#bodegas .bodegas-visual::before,
#bodegas .bodegas-visual::after {
  display: none;
}

#bodegas .bodegas-visual img {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  transition: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.8rem
}

.gallery img {
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  filter: sepia(.08);
  transition: transform .35s, filter .35s, box-shadow .35s
}

.gallery img:hover {
  transform: scale(1.04) rotate(.6deg);
  filter: sepia(0);
  box-shadow: var(--shadow-warm)
}

/* ---------- Del Puerto al Plato: barco flotando y gaviotas ---------- */
#puerto .sea-scene {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  bottom: -12%;
  right: -7%;
}

#puerto .boat {
  width: 100%;
  position: relative;
  z-index: 1;
  /* funde el fondo de la imagen con el pergamino, como una acuarela */
  -webkit-mask-image: radial-gradient(ellipse 63% 59% at 50% 52%, #000 62%, transparent 82%);
  mask-image: radial-gradient(ellipse 63% 59% at 50% 52%, #000 62%, transparent 82%);
  animation: boat-float 7.5s ease-in-out infinite;
  border-radius: 0;
  box-shadow: none;
}

/* mar conceptual: tres líneas de ola que derivan en bucle */
#puerto .sea {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 5%;
  height: 112px;
  pointer-events: none;
  z-index: 4;
  /* los extremos del mar se desvanecen como una acuarela */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  animation: sea-bob 6s ease-in-out infinite;
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  will-change: transform, background-position;
}

.wave.w1 {
  top: 0;
  height: 24px;
  opacity: .28;
  background-size: 210px 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='210' height='24' viewBox='0 0 210 24'%3E%3Cpath d='M0 14Q14 7 28 13T56 13Q70 5 84 12T112 14Q126 8 140 13T168 13Q182 6 195 12T210 14' fill='none' stroke='%236FA3A0' stroke-width='0.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: wave-drift1 16s linear infinite, wave-swell1 5.8s ease-in-out infinite;
}

.wave.w2 {
  top: 28px;
  height: 24px;
  opacity: .48;
  background-size: 220px 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='24' viewBox='0 0 220 24'%3E%3Cpath d='M0 13Q17 5 34 12T68 14Q86 6 104 13T148 12Q166 4 184 12T216 14Q220 12 220 13' fill='none' stroke='%234E8E8B' stroke-width='0.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: wave-drift2 12.5s linear infinite, wave-swell2 6.2s ease-in-out infinite;
}

.wave.w3 {
  top: 59px;
  height: 72px;
  opacity: 1;
  background-size: 220px 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='46' viewBox='0 0 220 46'%3E%3Cpath d='M0 18Q18 8 36 16T76 18Q96 10 118 16T164 20Q182 10 202 16T220 18L220 46L0 46Z' fill='%23F1E6CB'/%3E%3Cpath d='M0 18Q18 8 36 16T76 18Q96 10 118 16T164 20Q182 10 202 16T220 18' fill='none' stroke='%234E8E8B' stroke-width='0.6'/%3E%3Cpath d='M12 12Q22 7 32 10M92 10Q102 6 112 9M172 11Q182 7 192 10' fill='none' stroke='%234E8E8B' stroke-width='0.4' stroke-linecap='round'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(#000 58%, transparent 100%);
  mask-image: linear-gradient(#000 58%, transparent 100%);
  animation: wave-drift3 18s linear infinite, wave-swell3 5.2s ease-in-out infinite;
}

@keyframes wave-drift1 {
  0% { background-position-x: 0; }
  100% { background-position-x: 210px; }
}

@keyframes wave-drift2 {
  0% { background-position-x: 0; }
  100% { background-position-x: -220px; }
}

@keyframes wave-drift3 {
  0% { background-position-x: 0; }
  100% { background-position-x: 120px; }
}

@keyframes wave-swell1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes wave-swell2 {
  0%, 100% { transform: translateY(1px); }
  50% { transform: translateY(-2px); }
}

@keyframes wave-swell3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
  75% { transform: translateY(-2px); }
}

@keyframes sea-bob {

  0%,
  100% {
    transform: translateY(2px)
  }

  50% {
    transform: translateY(-4px)
  }
}

#puerto .boat:hover {
  transform: none;
  box-shadow: none
}

@keyframes boat-float {

  0%,
  100% {
    transform: translateY(3px) rotate(-0.8deg)
  }

  50% {
    transform: translateY(-4px) rotate(1.1deg)
  }
}

.gull {
  position: absolute;
  left: -15%;
  color: rgba(94, 63, 35, .6);
  pointer-events: none;
  opacity: 0;
}

.gull svg {
  display: block;
  animation: gull-flap .55s ease-in-out infinite alternate;
  transform-origin: 50% 40%
}

.gull.g1 {
  top: 12%;
  animation: gull-fly 23s linear infinite;
  animation-delay: 2s
}

.gull.g2 {
  top: 26%;
  animation: gull-fly-away 34s linear infinite;
  animation-delay: 13s
}

.gull.g3 {
  top: 7%;
  animation: gull-fly-rtl 29s linear infinite;
  animation-delay: 21s
}

.gull.g3 svg {
  transform: scaleX(-1)
}

/* cruza ondulando arriba y abajo */
@keyframes gull-fly {
  0% {
    left: -15%;
    opacity: 0;
    transform: translateY(0) scale(1)
  }

  4% {
    opacity: .85
  }

  8% {
    transform: translateY(-10px) scale(1)
  }

  12% {
    transform: translateY(3px) scale(1)
  }

  16% {
    transform: translateY(-13px) scale(1)
  }

  20% {
    transform: translateY(-1px) scale(1)
  }

  24% {
    opacity: .85;
    transform: translateY(-9px) scale(1)
  }

  28% {
    left: 110%;
    opacity: 0;
    transform: translateY(-15px) scale(1)
  }

  100% {
    left: 110%;
    opacity: 0
  }
}

/* a mitad de camino se aleja hacia el horizonte (zoom out) */
@keyframes gull-fly-away {
  0% {
    left: -15%;
    opacity: 0;
    transform: translateY(0) scale(1)
  }

  4% {
    opacity: .8
  }

  8% {
    transform: translateY(-9px) scale(1)
  }

  12% {
    transform: translateY(2px) scale(.95)
  }

  16% {
    opacity: .8;
    transform: translateY(-15px) scale(.7)
  }

  20% {
    opacity: .3;
    transform: translateY(-27px) scale(.4)
  }

  23% {
    left: 54%;
    opacity: 0;
    transform: translateY(-36px) scale(.22)
  }

  100% {
    left: 54%;
    opacity: 0
  }
}

/* vuelve en sentido contrario, ondula y se pierde a lo lejos */
@keyframes gull-fly-rtl {
  0% {
    left: 110%;
    opacity: 0;
    transform: translateY(0) scale(1)
  }

  4% {
    opacity: .75
  }

  9% {
    transform: translateY(-9px) scale(1)
  }

  14% {
    transform: translateY(3px) scale(1)
  }

  19% {
    transform: translateY(-12px) scale(.85)
  }

  24% {
    opacity: .45;
    transform: translateY(-19px) scale(.6)
  }

  28% {
    left: -15%;
    opacity: 0;
    transform: translateY(-26px) scale(.45)
  }

  100% {
    left: -15%;
    opacity: 0
  }
}

@keyframes gull-flap {
  from {
    transform: scaleY(1)
  }

  to {
    transform: scaleY(.5)
  }
}

.gull.g3 svg {
  animation-name: gull-flap-flip
}

@keyframes gull-flap-flip {
  from {
    transform: scaleX(-1) scaleY(1)
  }

  to {
    transform: scaleX(-1) scaleY(.5)
  }
}

@media (prefers-reduced-motion: reduce) {

  #puerto .boat,
  #puerto .sea,
  .wave {
    animation: none
  }

  .gull,
  .gull svg {
    animation: none !important
  }

  .gull {
    opacity: 0
  }
}

/* El Nombre — amphora watermark */
#nombre {
  position: relative
}

#nombre .amphora-mark {
  position: absolute;
  right: 10%;
  bottom: 15%;
  width: min(38vw, 560px);
  opacity: .84;
  pointer-events: none
}

blockquote {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--roman-red);
  background: rgba(217, 166, 63, .12);
  border-left: 4px solid var(--terra);
  border-radius: 0 14px 14px 0;
  padding: 1rem 1.4rem;
  margin: 1.7rem 0;
}

/* ---------- Garum Bistrot: carta a dos columnas ---------- */
#bistrot {
  position: relative;
  overflow: hidden;
}

#bistrot::before {
  content: "";
  position: absolute;
  right: min(12rem, 10vw);
  top: min(8rem, 6vw);
  width: min(40vw, 460px);
  height: min(34vh, 420px);
  /* la imagen la fija main.js (aleatoria por pestaña) vía --bistrot-img */
  background-image: var(--bistrot-img, url('../assets/bistrot-pintxos-1.png'));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: contain;
  opacity: .3;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

#bistrot.bistrot-animate::before {
  animation: bistrot-in 2.5s ease-in-out both;
}

@keyframes bistrot-in {
  0% {
    transform: translateY(12px) scale(.96);
    opacity: 0
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: .4
  }
}

.bistrot-intro {
  font-size: 1.08rem;
  color: var(--amphora-dark);
  line-height: 1.7;
  max-width: 60ch;
  position: relative;
  z-index: 1;
}

/* Subtítulo de sección y foto: solo en móvil (scroll continuo, sin pestañas) */
.bistrot-sub {
  display: none;
  position: relative;
  z-index: 1;
  font-family: var(--body);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--roman-red);
  margin: 1.9rem 0 .1rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--roman-red);
}

.bistrot-photo {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 1.5rem auto 0;
  border-radius: 14px;
}

/* pestañas minimalistas con subrayado */
.bistrot-tabs {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0.6rem 0 0.8rem;
}

.bistrot-tabs button {
  font-family: var(--body);
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--olive);
  padding: .35rem 0;
  cursor: pointer;
  position: relative;
  transition: color .25s;
}

.bistrot-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.4rem;
  height: 3px;
  border-radius: 3px;
  background: var(--grad-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}

.bistrot-tabs button:hover {
  color: var(--roman-red);
}

.bistrot-tabs button.active {
  color: var(--roman-red);
}

.bistrot-tabs button.active::after {
  transform: scaleX(1);
}

.tab-sep {
  width: 1px;
  height: 1.1rem;
  background: rgba(156, 97, 39, .35);
}

/* lista de platos con icono por ingrediente, a dos columnas */
.menu-list {
  list-style: none;
  display: none;
  margin-top: 0.5rem;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.2rem;
  padding-bottom: 3rem;
}

/* la carta visible se desliza (scroll propio) cuando no cabe en el viewport */
.menu-list.visible {
  display: grid;
  align-content: start;
  max-height: calc(100vh - 23rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .5rem;
  padding-bottom: 3rem;
  scrollbar-width:auto;
  scrollbar-color: rgba(156, 97, 39, .45) transparent;
  /* funde el texto inferior para insinuar que hay más carta al hacer scroll */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 5rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 5rem), transparent);
}

.menu-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  break-inside: avoid;
  padding: .72rem .2rem;
  border-bottom: 1px solid rgba(156, 97, 39, .16);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color .2s, padding-left .25s;
}

/* separador de sección (p. ej. "Para vegetarianos") a todo el ancho */
.menu-list .menu-sep {
  grid-column: 1 / -1;
  display: block;
  padding: 1.2rem .2rem .3rem;
  margin-top: .5rem;
  border: none;
  border-bottom: 2px solid var(--roman-red);
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--roman-red);
  pointer-events: none;
}

.menu-list li:hover {
  color: var(--roman-red);
  padding-left: .6rem;
}

.dish-ic {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--terra);
  display: grid;
  place-items: center;
  transition: color .2s;
}

.dish-ic svg {
  width: 27px;
  height: 27px;
}

.menu-list li:hover .dish-ic {
  color: var(--roman-red);
}


.amphora-logo img{
    display:none;
  }

/* Bistrot: carta a una columna en pantallas estrechas */
@media (max-width: 760px) {
  .menu-list {
    grid-template-columns: 1fr;
  }
  .menu-list.visible {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  #nombre .amphora-mark {
    position: relative;
    margin: auto;
    right: auto;
  }
  .amphora-hero{
    display: none !important; 
  }
  .amphora-logo img{
    display:block;
    float: left;
    width: 56px;
    margin-right: 15px;
    box-shadow: none !important;
  }
  #puerto .sea,
  #puerto .sea .wave{
    animation: none !important;
  }

  .w3{
    top: 66px !important;
  }
  .gull {
    animation: none !important;
  }
  #puerto .sea-scene {
    bottom: 2%;
    right: -5%;
    min-height: auto;
  }

  .home-actions {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Cómo llegar ---------- */
.map-wrap {
  margin-top: 1.5rem;
  border: 1px solid rgba(156, 97, 39, .3);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft)
}

.map-wrap iframe {
  width: 100%;
  height: 380px;
  border: 0;
  display: block
}

.address {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0.5rem 0
}

.btn-outline {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amphora-dark);
  border: 1.5px solid var(--amphora);
  padding: .75rem 1.5rem;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 252, 244, .5);
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
  margin-top: .7rem;
}

.btn-outline:hover {
  background-image: var(--grad-warm);
  border-color: transparent;
  color: #FDF8EC;
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -12px rgba(174, 61, 40, .55);
}

/* ---------- Teléfono destacado (clic para llamar) ---------- */
.phone-cta {
  display: inline-flex;
  align-items: center;
  gap: .95rem;
  text-decoration: none;
  margin: .3rem 0 1.5rem;
  padding: .65rem 1.5rem .65rem .65rem;
  border-radius: 999px;
  background: rgba(217, 166, 63, .14);
  border: 1.5px solid rgba(156, 97, 39, .35);
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}

.phone-cta:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(217, 166, 63, .22);
  box-shadow: 0 16px 30px -14px rgba(174, 61, 40, .4);
}

.phone-ic {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-image: var(--grad-warm);
  color: #FDF8EC;
  box-shadow: 0 8px 18px -8px rgba(174, 61, 40, .55);
}

.phone-ic svg {
  width: 23px;
  height: 23px;
}

.phone-txt {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.phone-label {
  font-size: .62rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--roman-red);
  margin-bottom: .3rem;
}

.phone-num {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  letter-spacing: .04em;
  color: var(--amphora-dark);
  transition: color .25s;
}

.phone-cta:hover .phone-num {
  color: var(--roman-red);
}

/* ---------- Contactar: dos columnas arriba (texto+email | teléfono) y formulario centrado ---------- */
.contact-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin: 0 0 1.0rem;
  padding-bottom: 0.5rem;
}

.contact-text p {
  margin-bottom: 1rem;
}

.contact-phone {
  display: flex;
  justify-content: center;
}

.contact-phone .phone-cta {
  margin: 0;
}

.mail-line {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--amphora-dark);
  font-size: .96rem;
  word-break: break-word;
  transition: color .2s;
}

.mail-line:hover {
  color: var(--roman-red);
}

.mail-line svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--terra);
}

/* Nombre y Teléfono en la misma línea */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- Contact form ---------- */
form {
  max-width: 560px;
  margin-top: 1.5rem
}

#contact-form {
  max-width: 560px;
  margin: 0 auto;
}

#contact-form .field {
  margin-bottom: .75rem;
}

#contact-form label {
  font-size: .68rem;
  margin-bottom: .28rem;
}

#contact-form input,
#contact-form textarea {
  padding: .62rem .85rem;
  border-radius: 10px;
}

#contact-form textarea {
  min-height: 92px;
}

#contact-form .form-actions {
  margin-top: .9rem;
}

#contact-form .req-note {
  margin-top: .35rem;
}

.field {
  margin-bottom: 1.05rem
}

label {
  display: block;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .4rem;
  color: var(--amphora-dark)
}

input,
textarea {
  width: 100%;
  padding: .85rem 1.05rem;
  font-family: var(--body);
  font-size: .95rem;
  background: rgba(255, 255, 255, .72);
  border: 1.5px solid rgba(156, 97, 39, .35);
  border-radius: 12px;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input:hover,
textarea:hover {
  border-color: rgba(156, 97, 39, .55)
}

input:focus,
textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--terra);
  box-shadow: 0 0 0 4px rgba(217, 166, 63, .28);
}

textarea {
  min-height: 130px;
  resize: vertical
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.3rem
}

button[type=submit],
.btn-clear {
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .85rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .25s, box-shadow .25s, filter .25s, background .25s, color .25s;
}

button[type=submit] {
  background-image: var(--grad-warm);
  color: #FDF8EC;
  box-shadow: 0 12px 24px -10px rgba(174, 61, 40, .55);
}

button[type=submit]:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 32px -12px rgba(174, 61, 40, .6)
}

.btn-clear {
  background: none;
  color: var(--amphora-dark);
  border-color: var(--amphora)
}

.btn-clear:hover {
  background: rgba(217, 166, 63, .16)
}

#form-status {
  margin-top: 1rem;
  font-size: .9rem;
  min-height: 1.4em
}

#form-status.ok {
  color: var(--olive)
}

#form-status.err {
  color: var(--roman-red)
}

.req-note {
  font-size: .78rem;
  color: var(--olive);
  margin-top: .6rem
}

/* ---------- Confirmación de envío (sustituye al formulario) ---------- */
#contact-form[hidden],
#contact-sent[hidden] {
  display: none !important;
}

.contact-sent {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 1.4rem 0 .6rem;
  outline: none;
}

.contact-sent .sent-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #FDF8EC;
  background-image: var(--grad-warm);
  box-shadow: 0 14px 28px -10px rgba(174, 61, 40, .5);
}

.contact-sent .sent-check svg {
  width: 30px;
  height: 30px;
}

.contact-sent .sent-msg {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--amphora-dark);
  margin: 1rem 0 .2rem;
  max-width: none;
}

.contact-sent .sent-note {
  color: var(--olive);
  margin: 0 0 1.1rem;
  max-width: none;
}

.contact-sent #send-another {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Conoce la Quinta ---------- */
.quinta-preview {
  margin-top: 1.5rem;
  border: 1px solid rgba(156, 97, 39, .3);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.quinta-preview iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block
}

/* ---------- MOBILE: vertical fallback ---------- */
@media (max-width: 880px) {
  body {
    overflow: auto
  }

  #viewport {
    position: static;
    overflow: visible
  }

  #canvas {
    position: static;
    width: auto;
    height: auto;
    display: block;
    transform: none !important;
    transition: none
  }

  section.panel {
    width: auto;
    height: auto;
    min-height: 60vh;
    overflow: visible;
    padding: 5.8rem 1.3rem 2.6rem
  }

  /* Bistrot en móvil: sin pestañas; pintxos y raciones seguidos en scroll continuo,
     con una foto aleatoria al final de cada sección (main.js) en vez del fondo flotante. */
  .bistrot-tabs {
    display: none;
  }
  #bistrot::before {
    display: none;
  }
  #bistrot .menu-list {
    display: grid;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .bistrot-sub {
    display: block;
  }
  .bistrot-photo {
    display: block;
  }

  #inicio .inner,
  .split,
  .contact-top {
    grid-template-columns: 1fr;
    gap: 1.6rem
  }

  header {
    padding: .7rem 1rem;
    flex-wrap: wrap
  }

  nav#mainnav {
    display: none;
    width: 100%
  }

  nav#mainnav.open {
    display: block
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding-top: .6rem
  }

  nav a {
    display: block;
    padding: .75rem .6rem;
    border-radius: 10px;
    border-bottom: 1px solid rgba(156, 97, 39, .15)
  }

  /* En móvil (<=880px, como isMobile()) la escena del mar se muestra estática. */
  #puerto .sea,
  #puerto .sea .wave,
  .gull {
    animation: none !important;
  }

  #compass {
    display: none
  }

}

/* ---------- Aviso "sin cookies" en el pie (se oculta solo con main.js) ---------- */
.cookie-note {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(92vw, 640px);
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .68rem 1rem .68rem 1.15rem;
  background: rgba(251, 244, 228, .93);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(156, 97, 39, .3);
  border-left: 4px solid var(--roman-red);
  border-radius: 12px;
  box-shadow: 0 14px 34px -16px rgba(110, 68, 28, .5);
  font-family: var(--body);
  font-size: .82rem;
  line-height: 1.5;
  color: var(--ink);
  transition: opacity .55s ease, transform .55s ease;
}

.cookie-note.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  pointer-events: none;
}

.cookie-note-close {
  flex: none;
  background: none;
  border: none;
  color: var(--amphora-dark);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .15rem;
  transition: color .2s;
}

.cookie-note-close:hover {
  color: var(--roman-red);
}

@media (max-width: 760px) {
  .cookie-note {
    left: .8rem;
    right: .8rem;
    transform: none;
    max-width: none;
    font-size: .78rem;
  }
  .cookie-note.hide {
    transform: translateY(14px);
  }
}