/* ============================================================
   GLOBAL.CSS — Reset, Base, Layout Primitives & Utilities
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  cursor: none; /* Custom cursor active */
}

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

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

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

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

ul, ol {
  list-style: none;
}

/* ── CUSTOM CURSOR ──────────────────────────────────────────── */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--champagne);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-preloader);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.2s;
  mix-blend-mode: multiply;
}

.cursor-circle {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid rgba(201, 169, 110, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-preloader);
  transform: translate(-50%, -50%);
  transition: transform 0.12s var(--ease-out), width 0.3s var(--ease-luxury), height 0.3s var(--ease-luxury);
}

.cursor-dot.active  { width: 12px; height: 12px; }
.cursor-circle.active { width: 60px; height: 60px; opacity: 0.6; }

@media (hover: none) {
  .cursor-dot, .cursor-circle { display: none; }
  body { cursor: auto; }
  button { cursor: pointer; }
}

/* ── CONTAINER ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}
.container--wide    { max-width: var(--container-wide); }
.container--narrow  { max-width: var(--container-narrow); }

/* ── SECTION BASE ───────────────────────────────────────────── */
.section {
  padding-block: var(--section-py);
}
.section--sm {
  padding-block: var(--section-py-sm);
}

/* ── TYPOGRAPHY UTILITIES ────────────────────────────────────── */
.serif        { font-family: var(--font-serif); }
.sans         { font-family: var(--font-sans); }

.display-hero {
  font-family: var(--font-serif);
  font-size: var(--text-7xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.display-1 {
  font-family: var(--font-serif);
  font-size: var(--text-6xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.display-2 {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.heading-1 {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
}

.heading-2 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}

.heading-3 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--champagne);
}

.body-lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.body-text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ── COLOR UTILITIES ─────────────────────────────────────────── */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-accent    { color: var(--champagne) !important; }
.text-green     { color: var(--earth-green) !important; }
.text-white     { color: var(--white) !important; }
.text-cream     { color: var(--cream) !important; }

.bg-cream     { background-color: var(--cream); }
.bg-ivory     { background-color: var(--ivory); }
.bg-dark      { background-color: var(--obsidian); }
.bg-green     { background-color: var(--earth-green); }
.bg-champagne { background-color: var(--champagne-pale); }

/* ── SPACING UTILITIES ───────────────────────────────────────── */
.mb-2  { margin-bottom: var(--sp-2); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }
.mb-16 { margin-bottom: var(--sp-16); }
.mt-4  { margin-top: var(--sp-4); }
.mt-8  { margin-top: var(--sp-8); }

/* ── LAYOUT UTILITIES ────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-4         { gap: var(--sp-4); }
.gap-6         { gap: var(--sp-6); }
.gap-8         { gap: var(--sp-8); }
.gap-12        { gap: var(--sp-12); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider {
  width: 48px;
  height: 1px;
  background: var(--champagne);
  margin-block: var(--sp-6);
}
.divider--center { margin-inline: auto; }
.divider--wide { width: 80px; }

/* ── SECTION HEADER ──────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-16);
}
.section-header .eyebrow { margin-bottom: var(--sp-3); }
.section-header .divider { margin-inline: auto; margin-block: var(--sp-6); }
.section-header .body-lead { max-width: 560px; margin-inline: auto; }

/* ── REVEAL ANIMATIONS ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur-slow) var(--ease-luxury),
              transform var(--dur-slow) var(--ease-luxury);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity var(--dur-slow) var(--ease-luxury),
              transform var(--dur-slow) var(--ease-luxury);
}
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--dur-slow) var(--ease-luxury),
              transform var(--dur-slow) var(--ease-luxury);
}
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }

/* Staggered children */
.stagger-children > * { opacity: 0; transform: translateY(20px); }
.stagger-children.is-visible > *:nth-child(1) { animation: fadeUp 0.7s var(--ease-luxury) 0.0s forwards; }
.stagger-children.is-visible > *:nth-child(2) { animation: fadeUp 0.7s var(--ease-luxury) 0.1s forwards; }
.stagger-children.is-visible > *:nth-child(3) { animation: fadeUp 0.7s var(--ease-luxury) 0.2s forwards; }
.stagger-children.is-visible > *:nth-child(4) { animation: fadeUp 0.7s var(--ease-luxury) 0.3s forwards; }
.stagger-children.is-visible > *:nth-child(5) { animation: fadeUp 0.7s var(--ease-luxury) 0.4s forwards; }
.stagger-children.is-visible > *:nth-child(6) { animation: fadeUp 0.7s var(--ease-luxury) 0.5s forwards; }
.stagger-children.is-visible > *:nth-child(7) { animation: fadeUp 0.7s var(--ease-luxury) 0.6s forwards; }
.stagger-children.is-visible > *:nth-child(8) { animation: fadeUp 0.7s var(--ease-luxury) 0.7s forwards; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── IMAGE FILL UTILITIES ────────────────────────────────────── */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aspect-video   { aspect-ratio: 16/9; }
.aspect-square  { aspect-ratio: 1/1; }
.aspect-portrait{ aspect-ratio: 3/4; }
.aspect-wide    { aspect-ratio: 4/3; }

/* ── GLASS UTILITIES ─────────────────────────────────────────── */
.glass {
  background: var(--glass-cream);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-subtle);
}

.glass-dark {
  background: var(--glass-dark);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(201,169,110,0.15);
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--champagne); border-radius: var(--radius-full); }

/* ── SELECTION ───────────────────────────────────────────────── */
::selection { background: var(--champagne-pale); color: var(--obsidian); }

/* ── FOCUS RING ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 3px;
}

/* ── RESPONSIVE BREAKPOINTS ──────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section-header { margin-bottom: var(--sp-10); }
}
