/* ============================================================
   AUREAITER — LUXURY DESIGN SYSTEM
   main.css · Design Tokens + Global Styles + Layout
   ============================================================ */

/* --- Google Fonts Import ---------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Inter:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

/* --- Design Tokens --------------------------------------- */
:root {
  /* Colors */
  --c-black:       #080807;
  --c-dark:        #0E0D0C;
  --c-dark-2:      #141312;
  --c-slate:       #1C1A19;
  --c-slate-2:     #242220;
  --c-stone:       #6B6560;
  --c-stone-light: #9A9490;
  --c-ivory:       #F0EBE3;
  --c-ivory-soft:  #D8D2C8;
  --c-white:       #FDFCFB;

  --c-gold:        #C9A96E;
  --c-gold-light:  #DFC18E;
  --c-gold-dark:   #9E7D4E;
  --c-copper:      #B87333;

  /* Typography */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Inter', -apple-system, sans-serif;
  --font-mono:     'Space Mono', monospace;

  /* Type Scale */
  --text-xs:   0.625rem;   /* 10px */
  --text-sm:   0.75rem;    /* 12px */
  --text-base: 0.875rem;   /* 14px */
  --text-md:   1rem;       /* 16px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.5rem;     /* 40px */
  --text-4xl:  3.5rem;     /* 56px */
  --text-5xl:  5rem;       /* 80px */
  --text-6xl:  7rem;       /* 112px */
  --text-hero: clamp(3rem, 7.5vw, 6.5rem);
  --text-display: clamp(2.5rem, 6vw, 6rem);
  --text-section: clamp(2rem, 4vw, 4rem);

  /* 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;
  --space-32:  8rem;
  --space-40:  10rem;
  --space-48:  12rem;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Transitions */
  --ease-luxury:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-cinematic:cubic-bezier(0.76, 0, 0.24, 1);
  --ease-reveal:   cubic-bezier(0.77, 0, 0.175, 1);

  --dur-fast:   0.2s;
  --dur-mid:    0.4s;
  --dur-slow:   0.7s;
  --dur-xl:     1.1s;
  --dur-cinematic: 1.4s;

  /* Z-layers */
  --z-bg:        -1;
  --z-base:       0;
  --z-float:     10;
  --z-nav:      100;
  --z-overlay:  200;
  --z-modal:    300;
  --z-loader:   400;
}

/* --- Reset & Base ---------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent any flash of background before loader paints */
  background-color: #080807;
  overflow-x: hidden;
}

body {
  background-color: var(--c-black);
  color: var(--c-ivory);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Hide page content while loader is active ──────────────────
   Prevents sections from bleeding through the loader overlay.
   .site-loaded is added by JS when the loader finishes.
──────────────────────────────────────────────────────────────── */
body:not(.site-loaded) header,
body:not(.site-loaded) main,
body:not(.site-loaded) footer,
body:not(.site-loaded) .mobile-actions {
  visibility: hidden;
  opacity: 0;
}

/* Fade everything in together once loader is done */
body.site-loaded header,
body.site-loaded main,
body.site-loaded footer,
body.site-loaded .mobile-actions {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s var(--ease-luxury);
}

body.nav-open {
  overflow: hidden;
}

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

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

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

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

/* --- Typography ------------------------------------------ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.display-giant {
  font-size: var(--text-hero);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.display-large {
  font-size: var(--text-display);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.025em;
}

.display-section {
  font-size: var(--text-section);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.label-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
}

.label-sans {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.body-text {
  font-size: var(--text-md);
  line-height: 1.75;
  font-weight: 300;
  color: var(--c-stone-light);
}

.body-text-large {
  font-size: var(--text-lg);
  line-height: 1.65;
  font-weight: 300;
  color: var(--c-stone-light);
}

/* --- Gold Line Accent ------------------------------------ */
.gold-line {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--c-gold);
  margin-bottom: var(--space-6);
}

/* --- Gold Rule ------------------------------------------- */
.gold-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--c-gold), transparent);
  border: none;
  margin: var(--space-8) 0;
}

/* --- Italic serif ---------------------------------------- */
.serif-italic {
  font-style: italic;
  font-family: var(--font-display);
}

/* --- Layout ---------------------------------------------- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container--narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container--wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

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

/* --- Section Padding ------------------------------------- */
.section {
  padding: var(--space-40) 0;
  position: relative;
}

.section--xl {
  padding: var(--space-48) 0;
}

/* --- Gold Gradient ---------------------------------------- */
.gradient-gold {
  background: linear-gradient(135deg, var(--c-gold-dark), var(--c-gold), var(--c-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all var(--dur-mid) var(--ease-luxury);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--c-gold);
  color: var(--c-black);
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-gold-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-cinematic);
}

.btn--primary:hover::after {
  transform: scaleX(1);
}

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

.btn--outline {
  border: 1px solid var(--c-gold);
  color: var(--c-gold);
  background: transparent;
}

.btn--outline::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-cinematic);
  z-index: 0;
}

.btn--outline:hover {
  color: var(--c-black);
}

.btn--outline:hover::after {
  transform: scaleX(1);
}

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

.btn--ghost {
  color: var(--c-ivory-soft);
  border-bottom: 1px solid transparent;
  padding: var(--space-2) 0;
  letter-spacing: 0.15em;
}

.btn--ghost:hover {
  color: var(--c-gold);
  border-bottom-color: var(--c-gold);
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
  font-family: var(--font-body);
  font-weight: 500;
  transition: gap var(--dur-fast) var(--ease-luxury);
}

.btn-arrow:hover {
  gap: var(--space-6);
}

.btn-arrow::after {
  content: '→';
  font-size: 1em;
}

/* --- Overlay helpers ------------------------------------- */
.overlay-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8,8,7,0.3) 0%, rgba(8,8,7,0.7) 100%);
  pointer-events: none;
}

.overlay-darker {
  position: absolute;
  inset: 0;
  background: rgba(8,8,7,0.55);
  pointer-events: none;
}

/* --- Reveal animations (applied by JS) ------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur-xl) var(--ease-luxury),
              transform var(--dur-xl) var(--ease-luxury);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity var(--dur-cinematic) var(--ease-luxury),
              transform var(--dur-cinematic) var(--ease-luxury);
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity var(--dur-xl) var(--ease-luxury),
              transform var(--dur-xl) var(--ease-luxury);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity var(--dur-xl) var(--ease-luxury),
              transform var(--dur-xl) var(--ease-luxury);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.35s; }
.delay-4 { transition-delay: 0.5s; }
.delay-5 { transition-delay: 0.65s; }
.delay-6 { transition-delay: 0.8s; }

/* Clip reveal for images */
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--dur-cinematic) var(--ease-reveal);
}

.clip-reveal.is-visible {
  clip-path: inset(0 0% 0 0);
}

/* Storia images: use simple fade instead of clip to avoid
   IntersectionObserver timing issues on initial viewport load */
.storia-chapter-img.clip-reveal {
  clip-path: none;
  opacity: 0;
  transition: opacity var(--dur-cinematic) var(--ease-luxury);
}

.storia-chapter-img.clip-reveal.is-visible {
  clip-path: none;
  opacity: 1;
}

/* --- Utility -------------------------------------------- */
.text-gold   { color: var(--c-gold); }
.text-ivory  { color: var(--c-ivory); }
.text-stone  { color: var(--c-stone-light); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.italic      { font-style: italic; }
.uppercase   { text-transform: uppercase; letter-spacing: 0.1em; }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }
.gap-8         { gap: var(--space-8); }

.full-bleed {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.abs-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Separator ------------------------------------------ */
.thin-line {
  width: 100%;
  height: 1px;
  background: rgba(201, 169, 110, 0.15);
  margin: var(--space-16) 0;
}


/* --- Prefers reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-up, .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }

  .clip-reveal {
    clip-path: none !important;
  }
}

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

@media (max-width: 900px) {
  .container, .container--narrow, .container--wide {
    padding: 0 var(--space-6);
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .section { padding: var(--space-24) 0; }
  .section--xl { padding: var(--space-32) 0; }
}

@media (max-width: 600px) {
  .container, .container--narrow, .container--wide {
    padding: 0 var(--space-4);
  }
}
