/* ============================================================
   ROOTS SIARGAO — DESIGN SYSTEM
   Version 1.0
   ============================================================ */

/* ── FONTS ─────────────────────────────────────────────────── */
@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=Jost:wght@300;400;500;600&display=swap');

/* ── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Color Palette */
  --color-cacao:        #1a100a;
  --color-espresso:     #221510;
  --color-charcoal:     #2c2520;
  --color-charcoal-mid: #3d342e;
  --color-bark:         #4a3b30;
  --color-sand:         #c4a882;
  --color-coconut:      #d4bc96;
  --color-linen:        #f0e9de;
  --color-ivory:        #faf6f0;
  --color-amber:        #c8882a;
  --color-amber-light:  #d9a84e;
  --color-brass:        #b8923e;
  --color-leaf:         #5c6b4a;
  --color-leaf-muted:   #7a8a64;
  --color-smoke:        rgba(26, 16, 10, 0.72);

  /* Typography */
  --font-serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:    'Jost', system-ui, -apple-system, sans-serif;

  /* Font Sizes — fluid scale */
  --fs-xs:   clamp(0.65rem,  1vw,   0.75rem);
  --fs-sm:   clamp(0.8rem,   1.2vw, 0.9rem);
  --fs-base: clamp(0.9rem,   1.3vw, 1rem);
  --fs-md:   clamp(1rem,     1.5vw, 1.125rem);
  --fs-lg:   clamp(1.2rem,   2vw,   1.5rem);
  --fs-xl:   clamp(1.6rem,   3vw,   2.25rem);
  --fs-2xl:  clamp(2rem,     4vw,   3rem);
  --fs-3xl:  clamp(2.8rem,   6vw,   4.5rem);
  --fs-4xl:  clamp(3.8rem,   8vw,   6.5rem);
  --fs-hero: clamp(4rem,     10vw,  8rem);

  /* 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;

  /* Layout */
  --max-width:      1400px;
  --max-width-text: 760px;
  --gutter:         clamp(1.25rem, 5vw, 3rem);

  /* Transitions */
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    0.2s;
  --dur-mid:     0.45s;
  --dur-slow:    0.8s;
  --dur-xslow:   1.2s;

  /* Borders */
  --radius-sm:  2px;
  --radius-md:  6px;
  --radius-lg:  12px;
  --border-hairline: 1px solid rgba(196, 168, 130, 0.2);
  --border-warm:     1px solid rgba(196, 168, 130, 0.4);

  /* Z-index layers */
  --z-base:    1;
  --z-overlay: 10;
  --z-nav:     100;
  --z-modal:   200;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-linen);
  background-color: var(--color-cacao);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

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

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

/* ── TYPOGRAPHY BASE ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-ivory);
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--color-coconut);
}

.serif { font-family: var(--font-serif); }
.sans  { font-family: var(--font-sans); }

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

.container--narrow {
  max-width: 900px;
}

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

.section {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.section--dark    { background-color: var(--color-cacao); }
.section--deep    { background-color: var(--color-espresso); }
.section--mid     { background-color: var(--color-charcoal); }

/* ── TYPOGRAPHY UTILITIES ───────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-amber);
}

.eyebrow--light {
  color: var(--color-sand);
}

.headline {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.headline--xl  { font-size: var(--fs-3xl); }
.headline--2xl { font-size: var(--fs-4xl); }
.headline--hero{ font-size: var(--fs-hero); }

.headline--italic { font-style: italic; }

.body-large {
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--color-coconut);
}

.body-small {
  font-size: var(--fs-sm);
  color: rgba(196, 168, 130, 0.7);
}

.text-sand   { color: var(--color-sand); }
.text-amber  { color: var(--color-amber); }
.text-ivory  { color: var(--color-ivory); }
.text-linen  { color: var(--color-linen); }
.text-muted  { color: rgba(196, 168, 130, 0.55); }

/* ── BUTTON COMPONENTS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  transition: all var(--dur-mid) var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

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

.btn--primary {
  background: var(--color-amber);
  color: var(--color-cacao);
}

.btn--primary:hover {
  background: var(--color-amber-light);
  transform: translateY(-1px);
}

.btn--outline {
  border: 1px solid rgba(196, 168, 130, 0.5);
  color: var(--color-coconut);
  background: transparent;
}

.btn--outline:hover {
  border-color: var(--color-sand);
  color: var(--color-ivory);
  transform: translateY(-1px);
}

.btn--ghost {
  color: var(--color-sand);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(196, 168, 130, 0.3);
  border-radius: 0;
  letter-spacing: 0.14em;
}

.btn--ghost::after { display: none; }

.btn--ghost:hover {
  color: var(--color-amber);
  border-bottom-color: var(--color-amber);
  transform: none;
}

.btn--ghost .btn-arrow {
  transition: transform var(--dur-mid) var(--ease-smooth);
}

.btn--ghost:hover .btn-arrow {
  transform: translateX(5px);
}

/* ── DIVIDER ───────────────────────────────────────────────── */
.divider {
  width: 40px;
  height: 1px;
  background: var(--color-amber);
  display: block;
  margin: var(--space-6) 0;
}

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

.divider--long {
  width: 100%;
  background: var(--border-hairline);
  border: none;
  height: 1px;
  margin: var(--space-12) 0;
}

/* ── GRAIN OVERLAY ─────────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.028;
  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-repeat: repeat;
  background-size: 200px 200px;
}

/* ── SCROLL ANIMATIONS ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

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

/* 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; }

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

.img-warm {
  filter: sepia(0.12) contrast(1.06) brightness(0.96) saturate(0.9);
}

/* ── ASPECT RATIOS ─────────────────────────────────────────── */
.ratio-square    { aspect-ratio: 1 / 1; }
.ratio-portrait  { aspect-ratio: 3 / 4; }
.ratio-landscape { aspect-ratio: 4 / 3; }
.ratio-wide      { aspect-ratio: 16 / 9; }
.ratio-cinema    { aspect-ratio: 21 / 9; }

/* ── PAGE TRANSITION OVERLAY ───────────────────────────────── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-cacao);
  z-index: var(--z-modal);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

.page-transition.entering {
  animation: pageEnter 0.5s var(--ease-in-out) forwards;
}

.page-transition.leaving {
  animation: pageLeave 0.5s var(--ease-in-out) forwards;
}

@keyframes pageEnter {
  from { transform: scaleY(0); transform-origin: bottom; }
  to   { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes pageLeave {
  from { transform: scaleY(1); transform-origin: top; }
  to   { transform: scaleY(0); transform-origin: top; }
}

/* ── CUSTOM SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--color-cacao); }
::-webkit-scrollbar-thumb { background: var(--color-bark); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-sand); }

/* ── SELECTION ─────────────────────────────────────────────── */
::selection {
  background: rgba(200, 136, 42, 0.35);
  color: var(--color-ivory);
}

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

/* ── UTILITY CLASSES ─────────────────────────────────────────*/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

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

.grid { display: grid; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.mt-auto { margin-top: auto; }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ── RESPONSIVE MEDIA QUERIES ───────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --gutter: 1.25rem;
  }
}

/* ── REDUCED MOTION ACCESSIBILITY ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .hero-bg-img {
    animation: none !important;
  }

  .marquee-track {
    animation: none !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
  }
}
