/* ==========================================================================
   ELCASA ENTERTAINMENT — Global Stylesheet
   main.css — Design tokens, reset, typography, cursor, shared components
   Built by ThisUncle Technologies (thisuncle.netlify.app)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
-------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --color-bg:           #0a0a0a;
  --color-surface:      #111111;
  --color-card:         #161616;
  --color-accent:       #ffffff;
  --color-accent-muted: rgba(255, 255, 255, 0.6);
  --color-highlight:    #c9a84c;
  --color-highlight-dim:rgba(201, 168, 76, 0.15);
  --color-highlight-dk: #a88832;
  --color-text:         #f0f0f0;
  --color-text-muted:   #888888;
  --color-border:       rgba(255, 255, 255, 0.06);

  /* Typography */
  --font-heading: 'Bebas Neue', sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Type Scale */
  --text-xs:   0.625rem;   /* 10px */
  --text-sm:   0.75rem;    /* 12px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  2rem;       /* 32px */
  --text-4xl:  2.5rem;     /* 40px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  4rem;       /* 64px */
  --text-hero: clamp(72px, 11vw, 150px);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-max: 1320px;
  --nav-h: 96px;

  /* Radius */
  --radius-card: 20px;
  --radius-pill: 100px;

  /* Transitions */
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo:  cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out:    cubic-bezier(0.76, 0, 0.24, 1);
  --dur-fast:  0.2s;
  --dur-med:   0.4s;
  --dur-slow:  0.7s;

  /* Z-index layers */
  --z-base:    1;
  --z-above:   10;
  --z-nav:     100;
  --z-overlay: 300;
  --z-cursor:  9999;
}


/* --------------------------------------------------------------------------
   2. RESET & BASE
-------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  touch-action: pan-y;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol { list-style: none; }

button {
  font-family: var(--font-body);
  cursor: none;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
}

::selection {
  background: var(--color-highlight);
  color: var(--color-bg);
}

:focus-visible {
  outline: 2px solid var(--color-highlight);
  outline-offset: 3px;
}


/* --------------------------------------------------------------------------
   3. UTILITY CLASSES
-------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.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;
}

/* Italic gold accent text */
.italic-gold {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-highlight);
}

/* Section label — "01 — Events" */
.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(10px, 1.5vw, 11px);
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-highlight);
  margin-bottom: var(--space-4);
}

/* Section heading */
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(36px, 7vw, 80px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--space-8);
}

/* Red text link */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-highlight);
  position: relative;
  transition: color var(--dur-fast) ease;
}

.text-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-highlight);
  transition: width var(--dur-med) var(--ease-smooth);
}

.text-link:hover::after {
  width: 100%;
}


/* --------------------------------------------------------------------------
   4. BUTTONS
-------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
  cursor: none;
}

.btn:hover { transform: scale(1.02); }

/* Gold filled */
.btn-gold {
  background: var(--color-highlight);
  color: #000;
  border: 2px solid var(--color-highlight);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.25);
}
.btn-gold:hover {
  background: var(--color-highlight-dk);
  border-color: var(--color-highlight-dk);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.4);
}

/* White outlined (ghost on dark) */
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.45);
}
.btn-outline:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}


/* --------------------------------------------------------------------------
   5. CUSTOM CURSOR
-------------------------------------------------------------------------- */
#cursor-dot,
#cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  will-change: transform, width, height;
}

#cursor-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

#cursor-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              border-radius 0.3s var(--ease-out-expo),
              opacity 0.2s ease;
}

/* Hover state — oval/pill morph */
#cursor-ring.cursor-hover {
  width: 80px;
  height: 40px;
  border-radius: 999px;
  border-color: var(--color-highlight);
}

#cursor-dot.cursor-hover {
  transform: translate(-50%, -50%) scale(0);
}

/* Hide native cursor on interactive elements */
a, button, [role="button"], input, textarea, select, label,
.card, .swiper-slide, [data-cursor] {
  cursor: none;
}


/* --------------------------------------------------------------------------
   6. PAGE TRANSITION OVERLAY
-------------------------------------------------------------------------- */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: calc(var(--z-cursor) + 1);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}


/* --------------------------------------------------------------------------
   7. SCROLL PROGRESS BAR — disabled (using native scrollbar instead)
-------------------------------------------------------------------------- */
.scroll-progress {
  display: none;
}


/* --------------------------------------------------------------------------
   8. INNER PAGE HERO BANNER — now in css/page-hero.css
-------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   9. CTA BAND — currently disabled across all pages
-------------------------------------------------------------------------- */
/*
.cta-band {
  background: var(--color-surface);
  padding: var(--space-20) var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta-band h2 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.cta-band p {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 480px;
  margin-inline: auto;
}
*/


/* --------------------------------------------------------------------------
   10. BACK TO TOP
-------------------------------------------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: var(--z-overlay);
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--color-highlight);
  background: rgba(10, 10, 10, 0.85);
  color: var(--color-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s, background 0.25s, box-shadow 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--color-highlight);
  color: #000;
  box-shadow: 0 8px 28px rgba(201, 168, 76, 0.35);
}


/* --------------------------------------------------------------------------
   11. SCROLLBAR — subtle thin track
-------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}


/* --------------------------------------------------------------------------
   12. LIGHTBOX (Gallery page)
-------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cursor) - 1);
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  backdrop-filter: blur(12px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 48px; height: 48px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  cursor: none;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

.lightbox__close { top: 24px; right: 24px; }
.lightbox__prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 24px; top: 50%; transform: translateY(-50%); }


/* --------------------------------------------------------------------------
   13. RESPONSIVE BREAKPOINTS
-------------------------------------------------------------------------- */
/* ---------- Tablet (768-1199) ---------- */
@media (max-width: 1199px) {
  .container { padding-inline: var(--space-6); }
}

/* ---------- Mobile (below 768) ---------- */
@media (max-width: 767px) {
  /* Restore native cursor on mobile */
  *, *::before, *::after,
  a, button, [role="button"], input, textarea, select, label,
  .card, .swiper-slide, [data-cursor] {
    cursor: auto !important;
  }
  body { cursor: auto; }

  #cursor-dot, #cursor-ring { display: none !important; }

  /* page-hero responsive — see page-hero.css */

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  /* Lightbox mobile */
  .lightbox__img {
    max-width: 96vw;
    max-height: 80vh;
  }

  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__prev  { left: 8px; }
  .lightbox__next  { right: 8px; }
}

/* ---------- Mobile Small (below 480) ---------- */
@media (max-width: 479px) {
  :root { --nav-h: 64px; }
  .container { padding-inline: var(--space-4); }
}

/* ==========================================================================
   PRELOADER
   ========================================================================== */
.loader {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.loader.hidden {
    pointer-events: none;
}

/* ---- Ambient glow ---- */
.loader-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 420px;
    height: 420px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    filter: blur(60px);
}

/* ---- Noise + scanlines overlays ---- */
.noise-overlay {
    position: absolute;
    inset: 0;
    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");
    pointer-events: none;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.012) 2px,
        rgba(255, 255, 255, 0.012) 4px
    );
    pointer-events: none;
}

/* ---- Corner brackets ---- */
.corner-bracket {
    position: absolute;
    width: 36px;
    height: 36px;
    pointer-events: none;
    opacity: 0;
}

.corner-bracket.top-left {
    top: 2rem;
    left: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.corner-bracket.top-right {
    top: 2rem;
    right: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.corner-bracket.bottom-left {
    bottom: 2rem;
    left: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.corner-bracket.bottom-right {
    bottom: 2rem;
    right: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---- Horizontal accent lines ---- */
.loader-line {
    position: absolute;
    top: 50%;
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.25), transparent);
    pointer-events: none;
}

.loader-line--left {
    right: calc(50% + 160px);
    transform-origin: right center;
}

.loader-line--right {
    left: calc(50% + 160px);
    transform-origin: left center;
}

/* ---- Loader content (centered column) ---- */
.loader-content {
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Welcome text */
.loader-welcome {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
}

/* Logo — large & centered */
.loader-logo {
    width: clamp(180px, 22vw, 280px);
    height: auto;
    opacity: 0;
    transform: scale(0.92);
    filter: drop-shadow(0 0 40px rgba(201, 168, 76, 0.12));
}

/* Progress bar */
.loader-progress-container {
    width: 280px;
    margin: 2.2rem auto 0;
    position: relative;
    height: 2px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    border-radius: 1px;
}

.loader-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-highlight), #e0c96a);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
    border-radius: 1px;
}

.progress-segments {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 2px;
}

.progress-segments span {
    flex: 1;
    border-right: 1px solid rgba(5, 5, 5, 0.5);
}

.progress-segments span:last-child {
    border-right: none;
}

/* Percentage counter */
.loader-percentage {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 1rem;
    opacity: 0;
}

/* Motto / tagline */
.loader-motto {
    font-family: var(--font-body);
    font-size: clamp(0.65rem, 2vw, 0.9rem);
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--color-highlight);
    margin-top: 1.6rem;
    opacity: 0;
    transform: translateY(8px);
    text-align: center;
    padding-inline: 1rem;
}

/* Year badge — bottom center */
.loader-year {
    position: absolute;
    bottom: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.15);
    opacity: 0;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .loader-line { display: none; }
    .loader-glow { width: 280px; height: 280px; }
    .loader-progress-container { width: 220px; }
    .corner-bracket { width: 24px; height: 24px; }
    .corner-bracket.top-left,
    .corner-bracket.top-right { top: 1.2rem; }
    .corner-bracket.top-left,
    .corner-bracket.bottom-left { left: 1.2rem; }
    .corner-bracket.top-right,
    .corner-bracket.bottom-right { right: 1.2rem; }
    .corner-bracket.bottom-left,
    .corner-bracket.bottom-right { bottom: 1.2rem; top: auto; }

    /* GPU-accelerate all animated loader elements for smooth mobile */
    .loader,
    .loader-content,
    .loader-logo,
    .loader-glow,
    .loader-welcome,
    .loader-motto,
    .loader-percentage,
    .loader-progress,
    .loader-year,
    .corner-bracket {
      will-change: transform, opacity;
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }
}
