/* ==========================================================================
   Casa Xabi — Luxury layer (same brand palette: wine · cream · ink · white)
   ========================================================================== */
:root {
  --f-display: "Cormorant Garamond", "Times New Roman", serif;
  --header-h: 92px;
  --ease-lux: cubic-bezier(.76, 0, .24, 1);
}
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.005em; }
.h-xl { font-size: clamp(3rem, 7vw, 6.4rem); }
.h-lg { font-size: clamp(2.5rem, 5.4vw, 4.6rem); line-height: 1.02; }
.h-md { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.h-lg em, .h-xl em, .h-md em { font-weight: 400; }
.menu-item__name { font-size: 1.32rem; font-weight: 600; }
.menu-item__price { font-size: 1.25rem; font-weight: 500; }
.card h3, .dish__body h3 { font-size: 1.8rem; font-weight: 500; }
.post h3 { font-size: 1.7rem; font-weight: 500; }
.lead { font-weight: 300; }
body { font-weight: 300; }
strong, b { font-weight: 600; }
.btn { letter-spacing: .26em; font-size: 11.5px; padding: 18px 34px; }

/* Film grain */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 9990; pointer-events: none; opacity: .05;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

/* ---------- Masthead: transparent over hero, ink glass on scroll ---------- */
.masthead { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: transform .6s var(--ease-lux); }
.masthead .topbar { background: transparent; border-bottom: 1px solid rgba(255, 231, 199, .14); max-height: 40px; overflow: hidden; transition: max-height .5s var(--ease-lux), opacity .4s, background .4s; }
.masthead.is-scrolled .topbar { max-height: 0; opacity: 0; border-color: transparent; }
.masthead.is-hidden { transform: translateY(-100%); }
.site-header { position: relative; background: transparent; border: 0; transition: background .5s, backdrop-filter .5s, box-shadow .5s; }
.masthead.is-scrolled .site-header, body.no-hero .site-header { background: rgba(14, 14, 14, .82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 rgba(255, 231, 199, .1); }
body.no-hero .masthead .topbar { background: var(--wine); }
.brand img { filter: brightness(0) invert(1); height: 58px; }
.masthead.is-scrolled .brand img { height: 46px; }
.nav__list a { color: rgba(255, 255, 255, .88); font-weight: 400; letter-spacing: .22em; font-size: 11.5px; }
.nav__list a:hover, .nav__list a[aria-current="page"] { color: var(--cream); }
.nav__list a::after { background: var(--cream); }
.has-sub > .sub { background: rgba(14, 14, 14, .95); border-top-color: var(--cream); backdrop-filter: blur(12px); }
.sub a { color: rgba(255, 255, 255, .85) !important; }
.nav__cta { --bg: transparent; --fg: var(--cream); --bd: rgba(255, 231, 199, .6); }
.nav__cta:hover { --bg: var(--cream); --fg: var(--wine); --bd: var(--cream); }
.burger { background: transparent; border: 1px solid rgba(255, 231, 199, .5); }
.site-header.is-scrolled { box-shadow: none; }
.drawer { background: var(--ink); }
.drawer a.drawer__link { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 400; }
.drawer.is-open li { animation: drawerIn .7s var(--ease-lux) both; }
.drawer.is-open li:nth-child(2) { animation-delay: .05s; } .drawer.is-open li:nth-child(3) { animation-delay: .1s; }
.drawer.is-open li:nth-child(4) { animation-delay: .15s; } .drawer.is-open li:nth-child(5) { animation-delay: .2s; }
.drawer.is-open li:nth-child(6) { animation-delay: .25s; } .drawer.is-open li:nth-child(7) { animation-delay: .3s; }
.drawer.is-open li:nth-child(8) { animation-delay: .35s; } .drawer.is-open li:nth-child(9) { animation-delay: .4s; }
@keyframes drawerIn { from { opacity: 0; transform: translateY(30px); } }
.rail { background: rgba(14, 14, 14, .7); backdrop-filter: blur(10px); }
.rail a { color: var(--cream); }

/* ---------- Preloader ---------- */
.preloader { position: fixed; inset: 0; z-index: 9999; background: var(--ink); display: grid; place-items: center; color: var(--cream); }
.preloader__inner { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.preloader img { display: block; margin: 0 auto; width: 170px; filter: brightness(0) invert(1); opacity: 0; transform: translateY(14px); animation: plLogo .6s var(--ease-lux) .05s forwards; }
.preloader__line { width: 170px; height: 1px; background: rgba(255, 231, 199, .18); margin: 26px auto 14px; overflow: hidden; }
.preloader__line span { display: block; height: 100%; background: var(--cream); transform: scaleX(0); transform-origin: left; animation: plLine .8s var(--ease-lux) .1s forwards; }
.preloader__txt { font: 400 10.5px/1 var(--f-body); letter-spacing: .5em; text-transform: uppercase; opacity: .7; }
.preloader.is-done { animation: plOut .75s var(--ease-lux) forwards; }
.preloader.is-quick { display: none; }
@keyframes plLogo { to { opacity: 1; transform: none; } }
@keyframes plLine { to { transform: scaleX(1); } }
@keyframes plOut { to { clip-path: inset(0 0 100% 0); } }
.preloader { clip-path: inset(0 0 0 0); }

/* ---------- Page transition curtain ---------- */
.curtain { position: fixed; inset: 0; z-index: 9998; background: var(--wine); transform: scaleY(0); transform-origin: bottom; pointer-events: none; }
.curtain.is-leaving { transform: scaleY(1); transition: transform .38s var(--ease-lux); }
.curtain.is-entering { transform: scaleY(1); transform-origin: top; }
.curtain.is-entering.go { transform: scaleY(0); transition: transform .6s var(--ease-lux); }

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 9997; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cursor { width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1px solid rgba(255, 231, 199, .8); mix-blend-mode: difference; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, opacity .3s; display: grid; place-items: center; }
.cursor span { font: 500 10px/1 var(--f-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .25s; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--cream); mix-blend-mode: difference; }
.has-cursor .cursor, .has-cursor .cursor-dot { opacity: 1; }
.cursor.is-link { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(255, 231, 199, .15); }
.cursor.is-view { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--cream); mix-blend-mode: normal; border-color: var(--cream); }
.cursor.is-view span { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; background: var(--ink); }
.hero__media img { position: absolute; inset: 0; opacity: 0; transform: scale(1.12); animation: none; transition: opacity 1.8s ease, transform 8s linear; }
.hero__media img.is-active { opacity: 1; transform: scale(1); }
.hero::after { background: linear-gradient(90deg, rgba(10, 10, 10, .82) 0%, rgba(10, 10, 10, .45) 55%, rgba(10, 10, 10, .2) 100%), linear-gradient(180deg, rgba(10, 10, 10, .55) 0%, rgba(10, 10, 10, 0) 30%, rgba(10, 10, 10, .9) 100%); }
.hero__title { font-weight: 400; font-size: clamp(3.2rem, 8.6vw, 8.4rem); letter-spacing: .02em; line-height: .92; }
.hero__script { font-size: clamp(2.8rem, 6.4vw, 5.6rem); margin-top: .1em; }
.hero__counter { position: absolute; right: calc(var(--gutter) + 50px); bottom: 48px; display: flex; gap: 14px; align-items: center; font: 400 12px/1 var(--f-body); letter-spacing: .2em; color: rgba(255, 255, 255, .75); }
.hero__counter i { display: block; width: 70px; height: 1px; background: rgba(255, 255, 255, .25); position: relative; overflow: hidden; }
.hero__counter i::after { content: ""; position: absolute; inset: 0; background: var(--cream); transform: scaleX(0); transform-origin: left; }
.hero__counter.run i::after { animation: slideBar 6s linear forwards; }
@keyframes slideBar { to { transform: scaleX(1); } }
.scroll-cue { left: var(--gutter); right: auto; bottom: auto; top: 50%; display: none; }
.page-hero { min-height: clamp(520px, 78vh, 760px); background: var(--ink); }
.page-hero img.page-hero__bg { height: 120%; top: -10%; }
.page-hero h1 { font-weight: 400; font-size: clamp(3.4rem, 8vw, 7.4rem); line-height: .95; }

/* ---------- Text & image reveals (only when JS animation is ready) ---------- */
.anim .split-line { display: block; overflow: hidden; padding-bottom: .06em; }
.anim .split-line > span { display: block; transform: translateY(105%); }
.anim .img-reveal { clip-path: inset(0 0 100% 0); }
.anim .img-reveal img { transform: scale(1.25); }
.anim .reveal { opacity: 0; transform: translateY(40px); transition: none; }

/* ---------- Big outline type ---------- */
.outline-band { overflow: hidden; background: var(--ink); padding: clamp(40px, 6vw, 80px) 0; white-space: nowrap; }
.outline-band__track { display: inline-flex; gap: 6vw; font: 500 clamp(5rem, 15vw, 15rem)/.9 var(--f-display); text-transform: uppercase; letter-spacing: .02em; will-change: transform; }
.outline-band__track span { color: transparent; -webkit-text-stroke: 1px rgba(255, 231, 199, .55); }
.outline-band__track span:nth-child(even) { color: var(--wine); -webkit-text-stroke: 0; font-style: italic; text-transform: none; }

/* ---------- Horizontal journey (pinned) ---------- */
.journey { background: var(--ink); color: rgba(255, 255, 255, .75); overflow: hidden; position: relative; }
.journey__intro { padding: clamp(80px, 10vw, 130px) 0 50px; }
.journey__intro h2 { color: var(--white); }
.journey__track { display: flex; gap: 4vw; padding: 0 var(--gutter) clamp(80px, 10vw, 120px); width: max-content; will-change: transform; }
.journey__panel { width: min(64vw, 820px); flex: none; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: end; }
.journey__panel figure { margin: 0; overflow: hidden; aspect-ratio: 4/5; position: relative; }
.journey__panel figure img { width: 100%; height: 115%; object-fit: cover; position: absolute; top: -7%; }
.journey__num { font: 400 italic 6rem/1 var(--f-display); color: var(--wine); display: block; margin-bottom: 10px; }
.journey__panel h3 { color: var(--white); font-size: clamp(2.2rem, 3.6vw, 3.4rem); font-weight: 400; margin-bottom: 14px; }
.journey__panel p { font-size: 15px; margin-bottom: 20px; }
.journey__panel .link-arrow { color: var(--cream); }
.journey__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 40px; height: 1px; background: rgba(255, 231, 199, .15); }
.journey__progress span { display: block; height: 100%; background: var(--cream); transform: scaleX(0); transform-origin: left; }

/* ---------- Experience pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-light); }
.pillar { padding: 40px 30px 10px 0; border-right: 1px solid var(--line-light); padding-left: 30px; }
.pillar:first-child { padding-left: 0; } .pillar:last-child { border-right: 0; }
.pillar strong { display: block; font: 400 clamp(2.6rem, 4vw, 3.6rem)/1 var(--f-display); color: var(--cream); margin-bottom: 14px; }
.pillar span { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }

/* Dark luxe variants of existing blocks */
.section--black { background: #0d0d0d; color: rgba(255, 255, 255, .72); }
.section--black h2, .section--black h3 { color: var(--white); }
.section--black .eyebrow { color: var(--cream); }
.section--black .menu-item { border-color: var(--line-light); }
.section--black .menu-item__name { color: var(--white); }
.section--black .menu-item__price { color: var(--cream); }
.section--black .menu-item__dots { border-color: rgba(255, 231, 199, .3); }
.section--black .menu-item__desc { color: rgba(255, 255, 255, .55); }
.section--black .btn--outline { --fg: var(--cream); --bd: rgba(255, 231, 199, .5); }
.section--black .btn--outline:hover { --bg: var(--cream); --fg: var(--wine); }
.section--black .h-lg em { color: var(--cream); }
.section--black .link-arrow { color: var(--cream); }
.section--black .post p { color: rgba(255, 255, 255, .55); }
.section--black .post__meta { color: var(--cream); }

.dish { aspect-ratio: 3/4.2; }
.dish__body { padding: 90px 30px 30px; }
.dish__tag { background: transparent; color: var(--cream); border: 1px solid rgba(255, 231, 199, .6); backdrop-filter: blur(6px); }

/* Menu hover preview */
.hover-preview { position: fixed; top: 0; left: 0; width: 260px; height: 330px; z-index: 60; pointer-events: none; overflow: hidden; opacity: 0; transform: scale(.85); transition: opacity .35s, transform .5s var(--ease); box-shadow: var(--shadow); }
.hover-preview img { width: 100%; height: 100%; object-fit: cover; }
.hover-preview.is-on { opacity: 1; transform: scale(1); }
@media (hover: none), (pointer: coarse) { .hover-preview { display: none; } }
.menu-nav { background: rgba(255, 255, 255, .92); }

/* Footer */
.footer-cta h2 { font-weight: 400; font-size: clamp(2.6rem, 6vw, 5.4rem); }
.footer-mega { overflow: hidden; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-mega span { display: block; text-align: center; font: 500 clamp(4rem, 19vw, 20rem)/.8 var(--f-display); letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1px rgba(255, 231, 199, .18); padding: 30px 0 10px; white-space: nowrap; }

@media (max-width: 900px) {
  :root { --header-h: 76px; }
  .journey__track { flex-direction: column; width: auto; gap: 60px; }
  .journey__panel { width: 100%; grid-template-columns: 1fr; }
  .journey__progress { display: none; }
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillar { border-right: 0; padding-left: 0; border-bottom: 1px solid var(--line-light); padding-bottom: 26px; }
  .hero__counter { display: none; }
  .brand img { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .preloader { display: none; }
  .anim .split-line > span, .anim .img-reveal, .anim .img-reveal img, .anim .reveal { transform: none; clip-path: none; opacity: 1; }
}

.hero__inner { padding-top: calc(var(--header-h) + 90px); }
.hero__media img:first-child.is-active { transition-delay: 0s; }
/* First hero slide paints immediately (no wait for JS) */
.hero__media img:first-child { opacity: 1; transform: scale(1); }
.hero__media.cycling img:first-child:not(.is-active) { opacity: 0; }
