/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #17110c;   /* warm-tinted near-black, coffee roast */
  --bg-2:      #1e1610;   /* section alt */
  --bg-3:      #2b1e14;   /* card */
  --cream:     #f2e9d8;   /* text on dark, never pure white */
  --cream-2:   #ddcdb0;
  --cream-3:   #9c8a71;   /* metadata / muted */
  --accent:    #c1793a;   /* caramel / roasted coffee */
  --accent-2:  #8a5a2e;   /* darker caramel */
  --gold:      #d9b46a;   /* sugar / azúcar flor accent */
  --line:      rgba(242,233,216,.12);

  --serif: "Fraunces", ui-serif, Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@property --mesh-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --mesh-x     { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --mesh-y     { syntax: "<percentage>"; inherits: false; initial-value: 50%; }

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 500; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1.25rem; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--cream); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
em { font-style: italic; color: var(--gold); }

.section-kicker {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}
.section-title {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  font-weight: 500;
  margin-bottom: 1rem;
}
.section-sub {
  color: var(--cream-2);
  max-width: 58ch;
  font-size: 1.05rem;
}

/* =============================================================
   5. Components
   ============================================================= */

/* Cursor */
.cursor {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  display: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}
.cursor.is-ready { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; will-change: transform;
}
.cursor-dot { width: 5px; height: 5px; margin: -2.5px; background: var(--cream); border-radius: 50%; }
.cursor-ring {
  width: 32px; height: 32px; margin: -16px; border: 1px solid var(--cream); border-radius: 50%;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out);
}
.cursor.is-interactive .cursor-ring { width: 50px; height: 50px; margin: -25px; border-color: var(--accent); }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: grid; place-items: center;
  pointer-events: auto;
  transition: opacity .9s, clip-path 1.1s;
  animation: splashSafety .01s 4.5s forwards;
}
.splash-inner { display: grid; place-items: center; gap: 1.1rem; color: var(--accent); }
.splash-bean { width: 44px; height: 44px; animation: beanPulse 1.4s ease-in-out infinite; }
.splash-line { width: 120px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.splash-line::after {
  content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent);
  animation: splashLine 1.4s ease-in-out infinite;
}
@keyframes beanPulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes splashLine { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.7rem;
  font-size: .92rem; font-weight: 500; letter-spacing: .01em;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background-color .3s, color .3s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(193,121,58,0.28), 0 10px 22px rgba(0,0,0,0.35);
}
.btn-ghost { border: 1px solid var(--line); color: var(--cream); }
.btn-ghost:hover { background: rgba(242,233,216,.06); transform: translateY(-4px); }
.btn:active { transform: translateY(-1px); transition-duration: .12s; }

/* Card */
.card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft), box-shadow .45s var(--ease-soft);
}
.has-tilt:hover {
  transition-duration: .15s;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.5), 0 0 0 1px rgba(193,121,58,.2);
}

/* Reveal on scroll */
[data-reveal] {
  opacity: 0; transform: translateY(32px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-split] { opacity: 1; transform: none; } /* defensive: never hidden if JS split fails */
.split-word { display: inline-block; opacity: 0; transform: translateY(24px); }
.is-split-ready .split-word { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }

/* =============================================================
   6. Navigation
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), box-shadow .4s var(--ease-out), padding .3s var(--ease-out);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.35rem;
  transition: padding .3s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(23,17,12,0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-scrolled .nav-inner { padding-block: .85rem; }

.nav-brand { display: inline-flex; align-items: center; gap: .6rem; }
.nav-bean { width: 30px; height: 30px; flex-shrink: 0; }
.nav-wordmark {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 500;
  color: var(--cream); letter-spacing: -.01em;
}
.nav-wordmark em { color: var(--gold); }

.nav-links { display: none; align-items: center; gap: 2.2rem; }
@media (min-width: 720px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; padding: .25rem 0;
  font-size: .92rem; color: var(--cream-2);
  transition: color .3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-burger {
  display: grid; gap: 5px; padding: .5rem;
  width: 42px; height: 42px; place-items: center;
}
@media (min-width: 720px) { .nav-burger { display: none; } }
.nav-burger span { width: 20px; height: 1.5px; background: var(--cream); transition: transform .35s var(--ease-out), opacity .35s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg); color: var(--cream);
  display: grid; place-items: center; gap: 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .65s var(--ease-soft);
}
.nav-mobile[aria-hidden="false"] { clip-path: inset(0); }
.nav-mobile a { font-family: var(--serif); font-size: 2rem; font-style: italic; }

/* =============================================================
   7. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
@keyframes ambientZoom {
  0%, 100% { transform: scale(1.05) translate3d(0, 0, 0); }
  50%      { transform: scale(1.14) translate3d(-1%, -1%, 0); }
}
.hero-bg img.ambient-on { animation: ambientZoom 30s ease-in-out infinite; }
.hero-bg-tint {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(23,17,12,.55) 0%, rgba(23,17,12,.72) 55%, rgba(23,17,12,.94) 100%),
    rgba(23,17,12,.35);
}

.hero-mesh {
  position: absolute; inset: -10%; z-index: -2;
  background:
    radial-gradient(55% 45% at var(--mesh-x) var(--mesh-y), rgba(193,121,58,.4), transparent 60%),
    conic-gradient(from var(--mesh-angle), rgba(217,180,106,.18), rgba(138,90,46,.1), rgba(193,121,58,.22), rgba(217,180,106,.18));
  filter: blur(90px) saturate(120%);
  opacity: .8;
  mix-blend-mode: screen;
  animation: meshShift 24s linear infinite;
}
@keyframes meshShift {
  0%   { --mesh-angle: 0deg;   --mesh-x: 28%; --mesh-y: 35%; }
  50%  { --mesh-angle: 180deg; --mesh-x: 74%; --mesh-y: 60%; }
  100% { --mesh-angle: 360deg; --mesh-x: 28%; --mesh-y: 35%; }
}

.hero-grain {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; opacity: 0.15; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

.hero-inner { padding-block: 8rem 6rem; max-width: 780px; }
.hero-kicker {
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.4rem;
}
.hero-title {
  font-size: clamp(2.6rem, 1.6rem + 5vw, 5.2rem);
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 1.6rem;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem);
  color: var(--cream-2);
  margin-bottom: 1.4rem;
  max-width: 46ch;
}
.hero-story {
  color: var(--cream-3);
  max-width: 58ch;
  font-size: .98rem;
  margin-bottom: 2.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-scroll {
  position: absolute; left: 50%; bottom: 2.2rem; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid var(--line); border-radius: 20px;
  display: none;
}
@media (min-width: 720px) { .hero-scroll { display: block; } }
.hero-scroll span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 4px;
  margin-left: -2px; background: var(--gold); border-radius: 50%;
  animation: scrollDot 1.8s var(--ease-soft) infinite;
}
@keyframes scrollDot {
  0% { top: 8px; opacity: 1; }
  70% { opacity: 1; }
  100% { top: 24px; opacity: 0; }
}

/* =============================================================
   8. Menu section
   ============================================================= */
.menu-section { background: var(--bg-2); padding-block: 6rem 7rem; }
.section-head { max-width: 640px; margin-bottom: 3.5rem; }

.menu-cat { margin-bottom: 4rem; }
.menu-cat:last-child { margin-bottom: 0; }

.menu-cat-head {
  display: flex; align-items: center; gap: 1.4rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.menu-cat-figure {
  width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--line);
}
.menu-cat-figure img { width: 100%; height: 100%; object-fit: cover; }
.menu-cat-title { font-size: 1.5rem; }
.menu-cat-sub { color: var(--cream-3); font-size: .92rem; margin-top: .2rem; }

.menu-list {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 720px) { .menu-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .menu-list { grid-template-columns: repeat(3, 1fr); } }

.menu-item { padding: 1.4rem 1.5rem; }
.menu-item-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: .5rem;
}
.menu-item-head h4 { font-size: 1.05rem; font-weight: 500; color: var(--cream); }
.menu-price { color: var(--accent); font-weight: 600; white-space: nowrap; font-family: var(--sans); font-size: .95rem; }
.menu-item p { color: var(--cream-3); font-size: .9rem; line-height: 1.55; }

/* =============================================================
   9. Location section
   ============================================================= */
.location-section { background: var(--bg); padding-block: 6rem 7rem; position: relative; }
.location-grid {
  display: grid; grid-template-columns: 1fr; gap: 3rem;
  align-items: center;
}
@media (min-width: 960px) { .location-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }

.location-copy .section-title em { color: var(--accent); }
.location-facts {
  display: grid; gap: 1.3rem;
  margin-block: 2.2rem 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.location-facts dt {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream-3); margin-bottom: .3rem;
}
.location-facts dd { color: var(--cream-2); font-size: 1rem; }
.location-facts a:hover { color: var(--accent); }

.location-map {
  overflow: hidden; aspect-ratio: 4 / 5; position: relative;
}
@media (min-width: 720px) { .location-map { aspect-ratio: 16 / 11; } }
.location-map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.85) contrast(1.05); }

/* =============================================================
   10. Footer
   ============================================================= */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: 3rem; }
.footer-inner { display: grid; gap: .7rem; text-align: center; justify-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--serif); font-size: 1.05rem; }
.footer-brand em { color: var(--gold); font-style: italic; }
.footer-brand .nav-bean { width: 22px; height: 22px; }
.footer-meta { color: var(--cream-3); font-size: .88rem; }
.footer-copy { color: var(--cream-3); font-size: .78rem; }
.footer-copy a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.footer-copy a:hover { color: var(--accent); }

/* =============================================================
   11. Credits page
   ============================================================= */
.page-credits { padding-block: 4rem; }
.page-credits .masthead { margin-bottom: 2.5rem; }
.page-credits .masthead a { color: var(--accent); }
.page-credits h1 { font-size: 2rem; margin-bottom: 1.6rem; }
.page-credits p { color: var(--cream-2); margin-bottom: 2rem; max-width: 60ch; }
.page-credits p a { color: var(--accent); text-decoration: underline; }
.credits-list { display: grid; gap: 1rem; max-width: 70ch; }
.credits-list li {
  padding: 1.1rem 1.3rem; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  font-size: .92rem; color: var(--cream-2);
}
.credits-list a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* =============================================================
   12. Responsive tweaks
   ============================================================= */
@media (min-width: 540px) {
  .hero-actions { gap: 1.2rem; }
}
@media (min-width: 1280px) {
  .menu-cat-head { gap: 1.8rem; }
}

/* =============================================================
   13. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg img.ambient-on { animation-duration: 90s; }
  .hero-mesh { animation-duration: 60s; }
  .hero-scroll span { animation: none; opacity: .6; top: 14px; }
}
