/* El Celler del Vi — rediseño según rebranding (#7a0000)
   70% sorra i terracota · 20% carbó i vi negre · 10% oliva i brasa */
:root {
  --carbo: #2b2111;
  --terracota: #7a4a2a;
  --brasa: #c46a3c;
  --vi: #7a0000;
  --vi-negre: #6b1f2a;
  --oliva: #6e7b4d;
  --arena: #d8c3a5;
  --sorra: #e8d9c4;
  --sorra-clara: #f3eadb;
  --script: "Charmonman", cursive;
  --sans: "Antic", "Glacial Indifference", "Helvetica Neue", Arial, sans-serif;
  --w: min(1180px, 100% - 48px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--carbo);
  background: var(--sorra);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: var(--w); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Tipografía */
h1, h2, h3 { font-weight: 400; line-height: 1.12; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); text-transform: uppercase; letter-spacing: .04em; }
h3 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: .12em; }
.script { font-family: var(--script); text-transform: none; letter-spacing: 0; color: var(--vi); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--terracota);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; }
p + p { margin-top: 1em; }
.lead { font-size: 1.2rem; }

/* Marca (PNG alfa usado como máscara: toma el color del texto) */
.mark {
  display: block; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.wordmark { --m: url(assets/wordmark.png); aspect-ratio: 900 / 123; }
.castell { --m: url(assets/castell.png); aspect-ratio: 600 / 314; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  background: var(--brasa); color: #fff; cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { background: var(--vi); transform: translateY(-2px); }
.btn.ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn.ghost:hover { background: var(--carbo); border-color: var(--carbo); color: var(--sorra); }
.dark .btn.ghost:hover { background: var(--sorra); border-color: var(--sorra); color: var(--carbo); }
.link {
  font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 4px; color: var(--vi);
}
.link:hover { color: var(--brasa); }

/* Cabecera */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50; color: var(--sorra);
  transition: background .3s, color .3s, box-shadow .3s;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 84px; }
.top .wordmark { width: 190px; }
.top.solid { background: rgba(232, 217, 196, .94); backdrop-filter: blur(10px); color: var(--carbo); box-shadow: 0 1px 0 rgba(43, 33, 17, .12); }
.top.solid .wordmark { color: var(--vi); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { white-space: nowrap; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-bottom-color: currentColor; }
.nav .btn { padding: 11px 22px; border: 0; color: #fff; }
.nav .lang { opacity: .75; letter-spacing: .14em; }
.burger { display: none; width: 44px; height: 44px; background: none; border: 0; color: inherit; cursor: pointer; }
.burger span { display: block; width: 24px; height: 1.5px; margin: 6px auto; background: currentColor; transition: transform .25s, opacity .25s; }

/* Secciones oscuras con el degradado granulado del manual */
.dark {
  position: relative; isolation: isolate; color: var(--sorra);
  background:
    radial-gradient(60% 70% at 85% 100%, rgba(110, 123, 77, .55), transparent 70%),
    radial-gradient(50% 60% at 10% 55%, rgba(110, 123, 77, .28), transparent 70%),
    radial-gradient(70% 80% at 100% 0%, rgba(122, 0, 0, .38), transparent 70%),
    linear-gradient(135deg, #4a3414, var(--carbo));
}
.dark::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grain); opacity: .35; mix-blend-mode: overlay; pointer-events: none; }
.dark .eyebrow { color: var(--arena); }
.dark .script { color: var(--sorra); }

/* Formas de foto: arco y cuarto de círculo */
.arch, .quarter, .quarter-r { overflow: hidden; background: var(--terracota); }
.arch { border-radius: 999px 999px 0 0; }
.quarter { border-radius: 100% 0 0 0; }
.quarter-r { border-radius: 0 100% 0 0; }
.arch img, .quarter img, .quarter-r img, .tile img { width: 100%; height: 100%; object-fit: cover; }

/* Hero */
.hero { min-height: 100svh; display: flex; align-items: center; padding: 130px 0 70px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.hero h1 { font-family: var(--script); font-size: clamp(3.2rem, 7.6vw, 6.6rem); line-height: 1.05; margin: 22px 0 26px; }
.hero h1 em { font-style: normal; color: var(--brasa); }
.hero p { max-width: 46ch; color: rgba(243, 234, 219, .86); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 34px; }
.hero-art { position: relative; justify-self: end; width: min(100%, 460px); }
.hero-art .arch { aspect-ratio: 3 / 4.1; }
.hero-art .quarter { position: absolute; left: -22%; bottom: -6%; width: 46%; aspect-ratio: 1; border: 6px solid var(--carbo); }
.seal {
  position: absolute; right: -8%; top: 8%; width: 138px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  background: var(--vi); color: var(--sorra); text-align: center; transform: rotate(8deg);
}
.seal .castell { width: 74px; }
.seal small { font-family: var(--script); font-size: .78rem; line-height: 1.1; }

.page-hero { padding: 170px 0 90px; text-align: center; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); text-transform: uppercase; letter-spacing: .05em; margin-top: 18px; }
.page-hero .script { display: block; font-size: .62em; margin-top: 6px; color: var(--brasa); }
.page-hero p { max-width: 62ch; margin: 22px auto 0; color: rgba(243, 234, 219, .86); }

/* Cinta de eslóganes */
.tape { background: var(--vi); color: var(--sorra); overflow: hidden; padding: 16px 0; }
.tape div { display: flex; width: max-content; animation: tape 36s linear infinite; }
.tape span { font-size: .85rem; letter-spacing: .32em; text-transform: uppercase; white-space: nowrap; padding-right: 3.2em; }
.tape span::after { content: "·"; padding-left: 3.2em; color: var(--brasa); }
@keyframes tape { to { transform: translateX(-50%); } }

/* Bloques */
section { padding: clamp(70px, 10vw, 130px) 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.split.rev > :first-child { order: 2; }
.split h2 { margin: 18px 0 24px; }
.split .link, .split .btn { margin-top: 30px; display: inline-flex; }
.figure { position: relative; }
.figure .quarter, .figure .quarter-r { aspect-ratio: 1; }
.figure .arch { aspect-ratio: 4 / 5; }
.figure .castell { position: absolute; width: 150px; color: var(--vi); right: -10px; bottom: -44px; }

.terra { background: var(--terracota); color: var(--sorra-clara); }
.terra .eyebrow { color: var(--arena); }
.terra .script { color: var(--arena); }
.arena { background: var(--arena); }
.head { max-width: 760px; margin-bottom: 56px; }
.head h2 { margin: 18px 0 20px; }
.head.center { margin-inline: auto; text-align: center; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.trio .arch { aspect-ratio: 3 / 4; }
.trio figure:nth-child(2) { margin-top: 56px; }
.trio figcaption { margin-top: 16px; font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; opacity: .85; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.pillars article { text-align: center; }
.pillars .arch { aspect-ratio: 3 / 4.2; margin-bottom: 26px; }
.pillars h3 { color: var(--vi); margin-bottom: 10px; }
.pillars article:nth-child(2) { margin-top: 60px; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(43, 33, 17, .25); margin-top: 60px; }
.values div { padding: 30px 28px 0 0; }
.values div + div { padding-left: 28px; border-left: 1px solid rgba(43, 33, 17, .25); }
.values b { display: block; font-family: var(--script); font-weight: 400; font-size: 1.7rem; color: var(--vi); margin-bottom: 6px; }

/* Reserva */
.cta { text-align: center; }
.cta .castell { width: 120px; margin: 0 auto 26px; color: var(--arena); }
.cta h2 { font-family: var(--script); text-transform: none; letter-spacing: 0; font-size: clamp(2.6rem, 6vw, 4.6rem); }
.cta p { max-width: 54ch; margin: 20px auto 0; color: rgba(243, 234, 219, .86); }
.cta .actions { justify-content: center; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 70px; padding-top: 44px; border-top: 1px solid rgba(232, 217, 196, .25); text-align: left; }
.facts dt, .cards dt { font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: var(--brasa); margin-bottom: 8px; }
.facts dd, .cards dd { margin: 0; }
.facts a, .cards a { text-decoration: none; border-bottom: 1px solid rgba(196, 106, 60, .6); }

/* Galería */
.grid { columns: 3; column-gap: 18px; }
.tile { display: block; width: 100%; margin: 0 0 18px; padding: 0; border: 0; background: var(--terracota); cursor: zoom-in; overflow: hidden; break-inside: avoid; }
.tile:nth-child(5n + 1) { border-radius: 999px 999px 0 0; aspect-ratio: 3 / 4; }
.tile:nth-child(7n + 4) { border-radius: 0 100% 0 0; aspect-ratio: 1; }
.tile img { transition: transform .6s; aspect-ratio: inherit; }
.tile:hover img { transform: scale(1.05); }
.lightbox { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(43, 33, 17, .94); padding: 24px; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 88vh; max-width: min(1200px, 100%); }
.lightbox button { position: absolute; background: none; border: 1px solid rgba(232, 217, 196, .5); color: var(--sorra); width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.lightbox button:hover { background: var(--brasa); border-color: var(--brasa); }
.lightbox .x { top: 22px; right: 22px; }
.lightbox .prev { left: 22px; top: 50%; }
.lightbox .next { right: 22px; top: 50%; }

/* Contacto */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 80px; }
.cards div { background: var(--sorra-clara); border: 1px solid rgba(43, 33, 17, .12); border-top: 3px solid var(--vi); padding: 30px 28px; }
.cards small { display: block; margin-top: 6px; color: var(--terracota); }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
form .full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--terracota); }
input, textarea {
  font: inherit; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--carbo);
  padding: 14px 16px; background: var(--sorra-clara); border: 1px solid rgba(43, 33, 17, .25); border-radius: 0;
}
input:focus, textarea:focus { outline: 2px solid var(--brasa); outline-offset: 1px; }
textarea { min-height: 150px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; letter-spacing: .04em; text-transform: none; font-size: .95rem; color: var(--carbo); }
.check input { width: 18px; height: 18px; accent-color: var(--vi); }
details { margin-top: 26px; font-size: .9rem; color: rgba(43, 33, 17, .8); }
summary { cursor: pointer; font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--terracota); }
details p { margin-top: 10px; }
.map { border: 0; width: 100%; height: 100%; min-height: 420px; filter: sepia(.35) saturate(.85); }
.map-box { border-radius: 999px 999px 0 0; overflow: hidden; background: var(--arena); aspect-ratio: 4 / 5; }

/* Pie */
footer { background: var(--carbo); color: rgba(232, 217, 196, .82); padding: 80px 0 34px; font-size: .95rem; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
footer .wordmark { width: 220px; color: var(--sorra); }
footer .tag { font-family: var(--script); color: var(--brasa); margin: 10px 0 18px; font-size: 1.15rem; }
footer h4 { font-weight: 400; font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: var(--brasa); margin-bottom: 16px; }
footer ul { list-style: none; padding: 0; display: grid; gap: 8px; }
footer a { text-decoration: none; }
footer a:hover { color: #fff; }
footer .base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 26px; border-top: 1px solid rgba(232, 217, 196, .18); font-size: .82rem; }
footer .base img { height: 46px; border-radius: 2px; }

/* Aparición */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s, transform .8s; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .tape div { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 1020px) {
  body { font-size: 17px; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 26px;
    background: var(--carbo); color: var(--sorra); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav a { font-size: 1rem; }
  .menu-open .nav { opacity: 1; visibility: visible; }
  .menu-open .top { color: var(--sorra); background: none; box-shadow: none; backdrop-filter: none; }
  .menu-open .top .wordmark { color: var(--sorra); }
  .menu-open .burger span:first-child { transform: translateY(7.5px) rotate(45deg); }
  .menu-open .burger span:nth-child(2) { opacity: 0; }
  .menu-open .burger span:last-child { transform: translateY(-7.5px) rotate(-45deg); }
  .burger, .top .logo { position: relative; z-index: 2; }
  .top .wrap { height: 70px; }
  .top .wordmark { width: 160px; }
  .hero .wrap, .split, .cards, .facts, .values { grid-template-columns: 1fr; }
  .hero-art { justify-self: center; width: min(78%, 380px); margin-top: 20px; }
  .seal { right: -12%; width: 112px; }
  .seal .castell { width: 58px; }
  .split.rev > :first-child { order: 0; }
  .trio, .pillars { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .trio figure:nth-child(2), .pillars article:nth-child(2) { margin-top: 0; }
  .values div, .values div + div { padding: 24px 0 0; border-left: 0; }
  .grid { columns: 2; column-gap: 12px; }
  .tile { margin-bottom: 12px; }
  form { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .figure .castell { width: 110px; right: 0; bottom: -34px; }
}
@media (max-width: 520px) {
  footer .cols { grid-template-columns: 1fr; }
  .lightbox .prev, .lightbox .next { top: auto; bottom: 22px; }
}
