:root {
  /* enable native form control theming */
  color-scheme: dark light;

  /* Dark mode (default) */
  --cream: #ede0cb;
  --warm: #c4a882;
  --warm-dark: #9a7a56;
  --amber: #bc9a72;
  --dark: #191410;
  --darker: #0d0a07;
  --text: #d0bfa4;
  --text-dim: #9e8b74;

  /* helper RGB helpers for alpha-based utilites */
  --cream-rgb: 237,224,203;
  --warm-rgb: 196,168,130;
  --amber-rgb: 188,154,114;
  --dark-rgb: 25,20,16;
  --darker-rgb: 13,10,7;

  --border: rgba(var(--warm-rgb), .1);
  --glass: rgba(var(--warm-rgb), .05);
  
  /* Component backgrounds (dark mode) */
  --topbar-scrolled-bg: rgba(10, 7, 4, .9);
  --topbar-bg: rgba(10, 7, 4, .95);
  --smenu-bg: rgba(7, 5, 3, .97);
  --modal-bg: rgba(13, 10, 7, .97);
  --overlay-dark: rgba(0, 0, 0, .55);
  --hero-overlay: linear-gradient(180deg, rgba(8, 5, 3, .25) 0%, rgba(8, 5, 3, .0) 25%, rgba(8, 5, 3, .6) 70%, rgba(8, 5, 3, .97) 100%), linear-gradient(90deg, rgba(8, 5, 3, .55) 0%, transparent 55%);
  --hero-overlay-secondary: linear-gradient(180deg, rgba(8, 5, 3, 0) 40%, rgba(8, 5, 3, 0.9) 100%);
  --artist-overlay: linear-gradient(180deg, rgba(8, 5, 3, .1) 0%, rgba(8, 5, 3, 0) 30%, rgba(8, 5, 3, .85) 100%);
  --artist-gallery-hover: linear-gradient(to right, rgba(8, 5, 3, 0), rgba(8, 5, 3, .4));
  --gallery-bg: rgba(30, 22, 14, .8);
  --gallery-overlay-hover: rgba(8, 5, 3, .5);
  --tab-bg-inactive: rgba(10, 7, 4, .55);
  --vignette-shadow: radial-gradient(ellipse at center, transparent 52%, rgba(8, 5, 3, .35) 78%, rgba(8, 5, 3, .72) 100%);

  /* Hero background colors (dark) */
  --hero-bg-1: #3e2b1a;
  --hero-bg-2: #1c1208;
  --hero-bg-3: #080503;
  
  /* Breakpoints (use in @media queries) */
  --mobile: 480px;
  --tablet: 720px;
  --desktop: 1000px;
}

/* Light mode palette */
html[data-theme="light"] {
  --cream: #0d0a07;
  --warm: #524135;
  --warm-dark: #8b7c6f;
  --amber: #8b7c6f;
  --dark: #e8ddd0;
  --darker: #f5f0eb;
  --text: #3c2f1d;
  --text-dim: #524135;

  /* update RGB helpers */
  --cream-rgb: 13,10,7;
  --warm-rgb: 82,65,53;
  --amber-rgb: 139,124,111;
  --dark-rgb: 232,221,208;
  --darker-rgb: 245,240,235;

  --border: rgba(61, 48, 32, .1);
  --glass: rgba(61, 48, 32, .05);
  
  /* Hero backgrounds (light) */
  --hero-bg-1: #e8ddd0;
  --hero-bg-2: #f5f0eb;
  --hero-bg-3: #f5f0eb;

  /* Component backgrounds (light mode) */
  --topbar-scrolled-bg: rgba(232, 221, 208, .92);
  --topbar-bg: rgba(232, 221, 208, .95);
  --smenu-bg: rgba(245, 240, 235, .98);
  --modal-bg: rgba(240, 235, 230, .98);
  --overlay-dark: rgba(61, 48, 32, .5);
  --hero-overlay: linear-gradient(180deg, rgba(232, 221, 208, .15) 0%, rgba(232, 221, 208, .0) 25%, rgba(232, 221, 208, .4) 70%, rgba(232, 221, 208, .85) 100%), linear-gradient(90deg, rgba(232, 221, 208, .35) 0%, transparent 55%);
  --hero-overlay-secondary: linear-gradient(180deg, rgba(232, 221, 208, 0) 40%, rgba(232, 221, 208, 0.75) 100%);
  --artist-overlay: linear-gradient(180deg, rgba(232, 221, 208, .1) 0%, rgba(232, 221, 208, 0) 30%, rgba(232, 221, 208, .65) 100%);
  --artist-gallery-hover: linear-gradient(to right, rgba(232, 221, 208, 0), rgba(232, 221, 208, .3));
  --gallery-bg: rgba(210, 200, 185, .7);
  --gallery-overlay-hover: rgba(232, 221, 208, .4);
  --tab-bg-inactive: rgba(232, 221, 208, .45);
  --vignette-shadow: radial-gradient(ellipse at center, transparent 52%, rgba(61, 48, 32, .25) 78%, rgba(61, 48, 32, .5) 100%);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: 'Josefin Sans', sans-serif;
  background: var(--darker);
  color: var(--cream);
  cursor: none;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme transition support for color-dependent elements */
a, button, input, textarea, select {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* GRAIN */
.grain {
  position: fixed;
  inset: -200%;
  width: 400%;
  height: 400%;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.036;
  animation: grainShift 0.08s steps(1) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  will-change: transform;
}

@keyframes grainShift {
  0% { transform: translate(0, 0) }
  10% { transform: translate(-5%, -8%) }
  20% { transform: translate(-12%, 3%) }
  30% { transform: translate(4%, -6%) }
  40% { transform: translate(-6%, 10%) }
  50% { transform: translate(10%, -4%) }
  60% { transform: translate(-3%, 8%) }
  70% { transform: translate(8%, 3%) }
  80% { transform: translate(-8%, -3%) }
  90% { transform: translate(3%, 10%) }
  100% { transform: translate(-4%, -8%) }
}

/* CURSOR */
.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--amber);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  transform: translate(-50%, -50%);
  transition: width .3s, height .3s, background .3s, box-shadow .3s;
  box-shadow: 0 0 12px rgba(var(--amber-rgb), 0.4);
}

.cursor.hov {
  width: 6px;
  height: 6px;
  background: var(--cream);
  box-shadow: 0 0 15px rgba(var(--cream-rgb), 0.6);
}

.cursor-ring {
  position: fixed;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--amber-rgb), 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width .4s cubic-bezier(0.23, 1, 0.32, 1), height .4s cubic-bezier(0.23, 1, 0.32, 1), border-color .4s, background .4s;
  backdrop-filter: blur(1px);
}

.cursor-ring.hov {
  width: 64px;
  height: 64px;
  background: rgba(var(--warm-rgb), 0.15);
  border-color: var(--cream);
  border-width: 1.5px;
}

/* LOADER & VIGNETTE */
.loader, .vignette {
  position: fixed;
  inset: 0;
  background: var(--darker);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  transition: opacity .8s cubic-bezier(0.4, 0, 0.2, 1), visibility .8s;
  pointer-events: all;
}

.vignette {
  z-index: 9997;
  background: var(--vignette-shadow);
  pointer-events: none;
}

.loader.done, .vignette.done {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.loader-logo {
  width: 180px;
  height: auto;
  opacity: 0;
  animation: fIn .6s ease .2s forwards;
}

.loader-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(196, 168, 130, .15));
}

.loader-bar-wrap {
  width: 160px;
  height: 1px;
  background: rgba(196, 168, 130, .15);
  overflow: hidden;
  opacity: 0;
  animation: fIn .4s ease .5s forwards;
}

.loader-bar {
  height: 100%;
  background: linear-gradient(to right, var(--amber), var(--warm));
  transform: scaleX(0);
  transform-origin: left;
  animation: lBar 1.4s cubic-bezier(.76, 0, .24, 1) .6s forwards;
}

@keyframes fIn {
  to { opacity: 1 }
}

@keyframes lBar {
  to { transform: scaleX(1) }
}

/* SCROLL REVEAL CLASES GLOBALES */
.rev {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.rev.in {
  opacity: 1;
  transform: translateY(0);
}

.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }

/* BOTONES GLOBALES */
.btn-f {
  display: inline-block;
  padding: 18px 32px;
  background: var(--cream);
  color: var(--darker);
  text-decoration: none;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .35em;
  position: relative;
  overflow: hidden;
  cursor: none;
}

.btn-f::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--warm);
  transform: translateX(-105%);
  transition: transform .45s cubic-bezier(.76, 0, .24, 1);
}

.btn-f span {
  position: relative;
  z-index: 1;
}

.btn-f:hover::after {
  transform: translateX(0);
}

.btn-o {
  display: inline-block;
  padding: 16px 32px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 10px;
  letter-spacing: .25em;
  position: relative;
  cursor: none;
  transition: color .3s;
}

.btn-o::before {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 32px;
  right: 32px;
  height: 1px;
  background: rgba(196, 168, 130, .3);
  transition: background .3s;
}

.btn-o:hover {
  color: var(--cream);
}

.btn-o:hover::before {
  background: var(--amber);
}

/* TYPOGRAPHY SHARED */
.eyebrow {
  font-size: 10px;
  letter-spacing: .4em;
  color: var(--amber);
  margin-bottom: 24px;
}

.stitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  line-height: .95;
  margin-bottom: 56px;
}

.stitle em {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  color: var(--warm);
}

/* UX / Accessibility Improvements */
:root {
  --ui-transition: 180ms;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none !important; }
  .loader-bar { animation: none !important; }
  .rev { transition: none !important; }
}

/* Disable heavy grain and cursor hiding on touch devices / small screens */
@media (hover: none), (pointer: coarse), (max-width: 600px) {
  .grain { display: none; }
  body, .btn-f, .btn-o, a, button, input { cursor: auto !important; }
  .cursor, .cursor-ring { display: none !important; }
  body { padding-top: calc(64px + env(safe-area-inset-top)); }
}

/* Improved focus styles for keyboard users */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(196,168,130,0.18);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduce loader duration on perceived load for snappier UX */
.loader.done { transition-duration: 350ms; }
