/* ============================================================
   BÀNAY BAKERY + CAFE — Main CSS
   Global styles, CSS custom properties, reset
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Jost:wght@200;300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --ink: #0d0d0b;
  --cream: #faf7f2;
  --sand: #f4ede0;
  --warm: #e8dcc8;
  --terra: #b5673a;
  --gold: #c9974a;
  --ocean: #1b4b5a;
  --teal: #2a7a72;
  --white: #fffdf9;
  --muted: rgba(13,13,11,0.5);

  /* Typography */
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Jost', sans-serif;
  --font-accent: 'Playfair Display', serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-2xl: 12rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);
  --duration-fast: 0.3s;
  --duration-mid: 0.6s;
  --duration-slow: 1.1s;

  /* Layout */
  --max-width: 1440px;
  --container: 1200px;
  --gutter: clamp(1.5rem, 5vw, 5rem);
}

/* ============================================================
   MODERN CSS RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hide default cursor when custom cursor is active */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* ============================================================
   SKIP TO CONTENT (Accessibility)
   ============================================================ */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--terra);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  border-radius: 0 0 6px 6px;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-accent  { font-family: var(--font-accent); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--max-width);
}

/* ============================================================
   GLOBAL SECTION HEADINGS
   ============================================================ */
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-title--light {
  color: var(--white);
}

.section-title--gold {
  color: var(--gold);
}

.section-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.8;
  color: var(--muted);
  max-width: 520px;
}

.section-body--light {
  color: rgba(250, 247, 242, 0.7);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border-radius: 3px;
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 44px;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.btn:hover::before {
  opacity: 1;
}

.btn--primary {
  background-color: var(--terra);
  color: var(--white);
}

.btn--primary:hover {
  background-color: #9e5530;
}

.btn--ghost {
  background-color: transparent;
  color: var(--white);
  border: 1px solid rgba(255,253,249,0.4);
}

.btn--ghost:hover {
  border-color: var(--white);
  background-color: rgba(255,253,249,0.08);
}

.btn--ghost-dark {
  background-color: transparent;
  color: var(--ink);
  border: 1px solid rgba(13,13,11,0.25);
}

.btn--ghost-dark:hover {
  border-color: var(--ink);
}

.btn--gold {
  background-color: var(--gold);
  color: var(--white);
}

.btn--gold:hover {
  background-color: #b5843a;
}

/* ============================================================
   DIVIDERS & DECORATIVE ELEMENTS
   ============================================================ */
.divider-line {
  width: 48px;
  height: 1px;
  background: var(--terra);
  display: block;
  margin: var(--space-sm) 0;
}

.divider-line--gold {
  background: var(--gold);
}

.divider-line--center {
  margin-inline: auto;
}

/* ============================================================
   NOISE TEXTURE SVG (applied via filter)
   ============================================================ */
.noise-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ============================================================
   OVERFLOW HIDDEN UTILITY
   ============================================================ */
.overflow-hidden { overflow: hidden; }
.overflow-clip { overflow: clip; }

/* ============================================================
   VISUALLY HIDDEN (Accessibility)
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   SCROLL BEHAVIOR
   ============================================================ */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* ============================================================
   CHAR SPLIT ANIMATION HELPER
   ============================================================ */
.char-wrap {
  overflow: hidden;
  display: inline-block;
}

.char {
  display: inline-block;
  transform: translateY(105%);
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3rem;
  color: var(--cream);
  opacity: 0;
  animation: loaderFade 0.8s var(--ease-out) 0.2s forwards;
}

@keyframes loaderFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   WHATSAPP FLOATING BUTTON
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  animation: whatsappPulse 2.5s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(37, 211, 102, 0.55);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: white;
}

@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4); }
  50%       { box-shadow: 0 4px 36px rgba(37, 211, 102, 0.65); }
}

/* ============================================================
   PAGE TRANSITION CURTAIN
   ============================================================ */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: var(--terra);
  transform-origin: bottom;
  transform: scaleY(0);
  pointer-events: none;
}
