/* ==========================================================================
   BRASA DEL MAR — Brasería · Orihuela Costa
   Warm editorial / cinematic-rustic. Dependency-free.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand colour — fire & coast */
  --carbon:      #15100d;   /* darkest, hero base            */
  --carbon-2:    #211210;   /* footer / dark surfaces (warm) */
  --ink:         #29150f;   /* primary text on light (espresso) */
  --ink-soft:    #5a392c;   /* secondary text on light       */
  --muted:       #6e4f40;   /* tertiary text on light        */
  --cream:       #e9d6bb;   /* light section bg (warm, deeper) */
  --cream-2:     #ddc7a6;   /* deeper cream / cards           */
  --paper:       #f0e2cb;   /* lightest warm surface          */
  --brand:       #8a1c12;   /* primary accent — dark red      */
  --brand-2:     #a8291b;   /* brighter dark red (hover)      */
  --ember:       #c2410c;   /* fire accent (warm, used on dark) */
  --ember-2:     #e07a2d;   /* brighter ember / glow          */
  --amber:       #e3a23a;   /* gold highlight (on dark)       */
  --wine:        #5c1a12;   /* deep oxblood                   */
  --olive:       #43502f;   /* holm-oak green                 */

  /* Lines & overlays */
  --line:        rgba(27, 20, 16, .14);
  --line-strong: rgba(27, 20, 16, .26);
  --line-dark:   rgba(244, 235, 221, .16);
  --muted-dark:  rgba(244, 235, 221, .66);

  /* Typography */
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:    "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing / layout */
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4.5rem, 10vw, 9rem);

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .28s;
  --t-med: .55s;

  /* Effects */
  --radius: 3px;
  --shadow-sm: 0 2px 10px rgba(27, 20, 16, .08);
  --shadow-md: 0 18px 50px -22px rgba(27, 20, 16, .45);
  --grain: 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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; padding: 0; }
::selection { background: var(--brand); color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}
.display {
  font-size: clamp(2.7rem, 1.6rem + 5vw, 5.3rem);
  line-height: 1.02;
}
.h2 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.25rem); }
.h3 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem); line-height: 1.2; }
.lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); line-height: 1.6; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .7;
}
.eyebrow--center::after {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .7;
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Skip link */
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: var(--radius); z-index: 200;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .65em;
  font-family: var(--font-body); font-weight: 600;
  font-size: .95rem; letter-spacing: .01em;
  padding: .95rem 1.65rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  position: relative;
  transition: transform var(--t-fast) var(--ease-out),
              background-color var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast);
  will-change: transform;
}
.btn .icon { width: 1.05em; height: 1.05em; transition: transform var(--t-fast) var(--ease-out); }
.btn:hover .icon { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 10px 24px -12px rgba(138, 28, 18, .9); }
.btn--primary:hover { background: var(--brand-2); transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(138, 28, 18, .95); }

.btn--ghost { background: transparent; color: var(--paper); border-color: rgba(244, 235, 221, .38); }
.btn--ghost:hover { border-color: var(--ember-2); color: #fff; background: rgba(224, 122, 45, .12); transform: translateY(-2px); }

.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--ember); transform: translateY(-2px); }

/* text link with animated underline */
.link-underline { position: relative; font-weight: 600; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform var(--t-med) var(--ease-out);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1rem, 2vw, 1.6rem) var(--gutter);
  color: var(--paper);
  transition: background-color var(--t-med), padding var(--t-med),
              color var(--t-med), box-shadow var(--t-med);
}
.nav.scrolled {
  background: var(--paper);
  color: var(--ink);
  padding-block: .85rem;
  box-shadow: 0 1px 0 var(--line), var(--shadow-sm);
}

.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1; }
.brand__mark { width: 1.6rem; height: 1.6rem; color: var(--ember-2); flex: none; }
.brand strong { font-weight: 500; }
.brand small { display: block; font-family: var(--font-body); font-size: .58rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; opacity: .7; margin-top: .15rem; }

.nav__links { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); }
.nav__links a { font-size: .9rem; font-weight: 500; letter-spacing: .02em; position: relative; padding-block: .3rem; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--brand-2); transform: scaleX(0); transform-origin: center;
  transition: transform var(--t-fast) var(--ease-out);
}
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); }

.nav__right { display: flex; align-items: center; gap: 1.1rem; }

/* language toggle */
.lang {
  display: inline-flex; align-items: center;
  border: 1px solid currentColor; border-radius: 100px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  overflow: hidden; opacity: .9;
}
.lang button { padding: .35rem .7rem; transition: background-color var(--t-fast), color var(--t-fast); }
.lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.nav.scrolled .lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }

.nav__cta { padding: .7rem 1.25rem; font-size: .85rem; }

/* burger */
.burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; }
.burger .icon { width: 1.6rem; height: 1.6rem; }

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 110;
  background: var(--carbon);
  color: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gutter);
  transform: translateY(-100%);
  transition: transform var(--t-med) var(--ease-in-out);
  visibility: hidden;
}
.drawer.open { transform: translateY(0); visibility: visible; }
.drawer__close { position: absolute; top: 1.3rem; right: var(--gutter); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--paper); }
.drawer__close .icon { width: 1.7rem; height: 1.7rem; }
.drawer__links { display: flex; flex-direction: column; gap: .4rem; }
.drawer__links a { font-family: var(--font-display); font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.3; color: var(--paper); }
.drawer__links a:hover { color: var(--ember-2); }
.drawer__foot { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.drawer__foot .btn { align-self: flex-start; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; color: var(--paper); overflow: hidden; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media {
  position: absolute; inset: -2%;
  background-color: var(--carbon);
  background-image:
    linear-gradient(105deg, rgba(13,9,7,.9) 0%, rgba(13,9,7,.58) 36%, rgba(13,9,7,.2) 66%, rgba(13,9,7,.5) 100%),
    linear-gradient(to bottom, rgba(13,9,7,.5) 0%, rgba(13,9,7,0) 28%, rgba(13,9,7,.8) 100%),
    url("https://images.unsplash.com/photo-1558030006-450675393462?auto=format&fit=crop&w=2000&q=72"),
    radial-gradient(125% 95% at 50% 118%, rgba(220,220,220,.28), rgba(180,180,180,.08) 34%, rgba(13,9,7,0) 66%);
  background-position: center, center, center 38%, center;
  background-size: cover, cover, cover, cover;
  background-repeat: no-repeat;
  animation: kenburns 26s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }

.hero__grain { position: absolute; inset: 0; z-index: -1; background-image: var(--grain); background-size: 180px; opacity: .07; mix-blend-mode: overlay; pointer-events: none; }
.hero__embers { display: none; }

.hero__inner { padding-bottom: clamp(4.5rem, 10vh, 8rem); padding-top: 8rem; will-change: transform, opacity; }
.hero .eyebrow { color: var(--amber); margin-bottom: 1.6rem; }
.hero h1 { max-width: 16ch; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.hero h1 em { font-style: italic; color: var(--ember-2); }
.hero__sub { max-width: 46ch; margin-top: 1.6rem; color: rgba(244,235,221,.86); font-size: clamp(1.05rem, 1rem + 0.45vw, 1.3rem); line-height: 1.6; }
.hero__cta { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__meta { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; font-size: .85rem; color: var(--muted-dark); }
.hero__meta span { display: inline-flex; align-items: center; gap: .5rem; }
.hero__meta .icon { width: 1.05rem; height: 1.05rem; color: var(--ember-2); }

.scroll-cue { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .55rem; font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted-dark); }
.scroll-cue .icon { width: 1.2rem; height: 1.2rem; animation: nudge 1.8s var(--ease-in-out) infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(5px); opacity: 1; } }

/* ==========================================================================
   INTRO / PHILOSOPHY
   ========================================================================== */
.intro { background: linear-gradient(to bottom, #d6bf9a 0%, var(--cream) 18%); position: relative; }
.intro__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.intro__title { margin-top: 1.4rem; max-width: 16ch; }
.intro__title em { font-style: italic; color: var(--brand); }
.intro__body p + p { margin-top: 1.1rem; }
.intro__body p { color: var(--ink-soft); }
.intro__signature { margin-top: 1.8rem; font-family: var(--font-display); font-style: italic; font-size: 1.4rem; color: var(--wine); }
.intro__signature small { display: block; font-family: var(--font-body); font-style: normal; font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: .35rem; }

.pillars { margin-top: clamp(3rem, 6vw, 5rem); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--line); padding-top: clamp(2.2rem, 4vw, 3rem); }
.pillar__icon { width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(138,28,18,.09); color: var(--brand); margin-bottom: 1rem; }
.pillar__icon .icon { width: 1.35rem; height: 1.35rem; }
.pillar h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.pillar p { font-size: .95rem; color: var(--muted); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { background: var(--carbon-2); color: var(--paper); position: relative; padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem; }
.footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--ember) 25%, var(--amber) 50%, var(--ember) 75%, transparent); opacity: .8; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: clamp(2rem, 4vw, 3.5rem); padding-bottom: 3rem; border-bottom: 1px solid var(--line-dark); }
.footer .brand { color: var(--paper); font-size: 1.7rem; }
.footer__tag { margin-top: 1.1rem; max-width: 30ch; color: var(--muted-dark); font-size: .95rem; }
.footer h4 { font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); margin-bottom: 1.1rem; }
.footer ul { display: flex; flex-direction: column; gap: .7rem; }
.footer__top li { color: var(--muted-dark); font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; }
.footer__top li .icon { width: 1.1rem; height: 1.1rem; color: var(--ember-2); margin-top: .2rem; }
.footer__top a:hover { color: var(--paper); }
.socials { display: flex; gap: .7rem; margin-top: .3rem; }
.socials a { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-dark); border-radius: 50%; transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.socials a:hover { background: var(--brand); border-color: var(--brand); transform: translateY(-3px); }
.socials .icon { width: 1.15rem; height: 1.15rem; }
.footer__bottom { padding-top: 1.8rem; display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted-dark); }
.footer__bottom nav { display: flex; gap: 1.3rem; }

/* ==========================================================================
   FLOATING WHATSAPP (brand-coloured, not WhatsApp green)
   ========================================================================== */
.wa-float {
  position: fixed; z-index: 90;
  right: clamp(1rem, 3vw, 1.6rem);
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(1rem, 3vw, 1.6rem));
  display: inline-flex; align-items: center;
  background: var(--brand); color: #fff;
  border-radius: 100px; padding: .9rem;
  box-shadow: var(--shadow-md), 0 6px 16px -4px rgba(138, 28, 18, .6);
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast), box-shadow var(--t-fast);
}
.wa-float .icon { width: 1.65rem; height: 1.65rem; fill: currentColor; stroke: none; flex: none; }
.wa-float__label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-weight: 600; font-size: .92rem; transition: max-width .45s var(--ease-out), opacity .3s, margin .45s var(--ease-out); }
.wa-float:hover, .wa-float:focus-visible { background: var(--brand-2); transform: translateY(-3px); }
.wa-float:hover .wa-float__label, .wa-float:focus-visible .wa-float__label { max-width: 240px; opacity: 1; margin: 0 .45rem 0 .55rem; }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: var(--brand); opacity: .45; animation: waPulse 2.8s var(--ease-out) infinite; }
@keyframes waPulse { 0% { transform: scale(1); opacity: .45; } 70%, 100% { transform: scale(1.7); opacity: 0; } }

/* ==========================================================================
   REVEAL ANIMATIONS
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: .08s; }
[data-delay="2"] { transition-delay: .16s; }
[data-delay="3"] { transition-delay: .24s; }
[data-delay="4"] { transition-delay: .32s; }
[data-delay="5"] { transition-delay: .40s; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
  .nav__links, .nav__cta { display: none; }
  .burger { display: flex; }
  .intro__grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .pillars { grid-template-columns: 1fr; gap: 2rem; }
  .footer__top { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .scroll-cue { display: none; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero__media { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
