/* ============================================================
   SILVI SAREE HOUSE — DESIGN SYSTEM
   Official Brand Colour Palette:
   Primary Burgundy: #580828
   Warm Ivory:       #F5EDD8
   Soft Cream:       #EDE0C4
   Deep Wine:        #240416
   ============================================================ */

@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=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&display=swap');

/* ─── CSS CUSTOM PROPERTIES ─── */
:root {
  /* Brand Colours */
  --color-primary:          #580828;
  --color-primary-dark:     #3D0619;
  --color-primary-light:    #7A1040;
  --color-primary-muted:    #8B3050;
  --color-primary-subtle:   #F0E0E6;

  --color-secondary:        #C4956A;   /* warm gold accent */
  --color-secondary-light:  #DDB88A;
  --color-secondary-dark:   #9A6E44;

  --color-wine-deep:        #240416;   /* near-black, headings/text */
  --color-wine-mid:         #3D0B22;

  /* Neutral / Background */
  --color-bg:               #FDFAF7;   /* warm white page bg */
  --color-ivory:            #F5EDD8;   /* official ivory */
  --color-cream:            #EDE0C4;   /* official cream */
  --color-cream-dark:       #E0D0B0;
  --color-surface:          #F9F4EE;   /* card/section bg */
  --color-surface-warm:     #F3EBE0;

  /* Text */
  --color-text-primary:     #240416;   /* deep wine - main text */
  --color-text-secondary:   #6B4C55;   /* muted warm */
  --color-text-tertiary:    #9C7B85;
  --color-text-light:       #F5EDD8;   /* for dark backgrounds */
  --color-text-on-primary:  #F5EDD8;

  /* Borders & Dividers */
  --color-border:           #E8D8C8;
  --color-border-light:     #F0E8DC;
  --color-border-strong:    #C4A890;

  /* States */
  --color-success:          #4A7C59;
  --color-error:            #C0392B;
  --color-warning:          #C4956A;
  --color-info:             #5B7FA6;

  /* ─── Typography ─── */
  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'DM Sans', system-ui, -apple-system, sans-serif;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.125rem;   /* 18px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  1.875rem;   /* 30px */
  --text-3xl:  2.25rem;    /* 36px */
  --text-4xl:  3rem;       /* 48px */
  --text-5xl:  3.75rem;    /* 60px */
  --text-6xl:  4.5rem;     /* 72px */
  --text-7xl:  5.5rem;     /* 88px */

  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-relaxed:1.75;

  --tracking-tight:  -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.12em;
  --tracking-widest:  0.2em;

  /* ─── Spacing ─── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  /* The scale skipped 7 while a dozen rules referenced it - dialog padding,
     the empty-addresses panel, the policy nav gap. An undefined custom
     property makes the whole declaration invalid at computed-value time, so
     each of those silently resolved to no spacing at all. */
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Section padding */
  --section-py:       80px;
  --section-py-sm:    48px;
  --section-py-lg:    120px;

  /* ─── Layout ─── */
  --container-max:    1440px;
  --container-wide:   1280px;
  --container-mid:    1100px;
  --container-narrow: 760px;
  --container-px:     clamp(16px, 4vw, 80px);

  /* ─── Border Radius ─── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-full:9999px;

  /* ─── Shadows ─── */
  --shadow-xs:  0 1px 3px rgba(36,4,22,0.06);
  --shadow-sm:  0 2px 8px rgba(36,4,22,0.08);
  --shadow-md:  0 4px 20px rgba(36,4,22,0.10);
  --shadow-lg:  0 8px 40px rgba(36,4,22,0.12);
  --shadow-xl:  0 16px 60px rgba(36,4,22,0.15);

  /* ─── Transitions ─── */
  --ease-default:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:       cubic-bezier(0.4, 0, 1, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-elegant:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-xslow:  600ms;
  --duration-reveal: 800ms;

  /* ─── Z-Index ─── */
  --z-below:     -1;
  --z-base:       0;
  --z-raised:     10;
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-overlay:    300;
  --z-modal:      400;
  --z-toast:      500;

  /* ─── Header ─── */
  --header-height: 72px;
  --header-height-mobile: 60px;
  --announcement-height: 40px;
}

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

/*
 * Restores the centring the reset above removes.
 *
 * A modal <dialog> is centred by the UA stylesheet's `dialog:modal { margin:
 * auto }`, which the universal selector overrides, dropping every dialog into
 * the top-left corner of the viewport. Scoped to :modal so a non-modal dialog,
 * which is meant to sit in normal flow, is left alone.
 *
 * The height cap keeps a long form - the address dialog runs to ten fields -
 * scrolling inside the dialog rather than off the bottom of the screen.
 */
dialog:modal {
  margin: auto;
  max-height: calc(100dvh - 2rem);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* The header is position:fixed, so an anchor target would otherwise land
     underneath it. --announcement-height goes to 0 and the header moves to
     top:0 when the bar is dismissed, so this follows either state. */
  scroll-padding-top: calc(var(--announcement-height) + var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

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

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

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

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

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

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

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

.section {
  padding-block: var(--section-py);
}

.section--sm {
  padding-block: var(--section-py-sm);
}

.section--lg {
  padding-block: var(--section-py-lg);
}

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

.text-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.text-heading {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-secondary);
}

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

/* ─── COLOUR UTILITIES ─── */
.text-primary     { color: var(--color-primary); }
.text-secondary   { color: var(--color-text-secondary); }
.text-light       { color: var(--color-text-light); }
.text-on-dark     { color: var(--color-ivory); }
.text-gold        { color: var(--color-secondary); }

.bg-primary       { background-color: var(--color-primary); }
.bg-ivory         { background-color: var(--color-ivory); }
.bg-cream         { background-color: var(--color-cream); }
.bg-surface       { background-color: var(--color-surface); }
.bg-wine-deep     { background-color: var(--color-wine-deep); }

/* ─── GRID UTILITIES ─── */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--2           { grid-template-columns: 1fr; }
  :root {
    --section-py:    48px;
    --section-py-lg: 72px;
    --container-px:  16px;
  }
}

/* ─── FLEX UTILITIES ─── */
.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    { flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ─── SECTION HEADING PATTERN ─── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 400;
  color: var(--color-wine-deep);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

.section-header--left {
  text-align: left;
}

.section-header--left p {
  margin-inline: 0;
}

/* ─── DIVIDER ─── */
.divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin-block: var(--space-12);
}

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

.aspect-portrait img,
.aspect-landscape img,
.aspect-square img,
.aspect-wide img,
.aspect-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

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

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-reveal) var(--ease-elegant),
              transform var(--duration-reveal) var(--ease-elegant);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }
.reveal--delay-5 { transition-delay: 500ms; }

/* ─── HOVER LIFT ─── */
.hover-lift {
  transition: transform var(--duration-base) var(--ease-elegant),
              box-shadow var(--duration-base) var(--ease-elegant);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ─── STAGGER CHILDREN ─── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-reveal) var(--ease-elegant),
              transform var(--duration-reveal) var(--ease-elegant);
}
.stagger-children.revealed > *:nth-child(1) { opacity:1; transform:none; transition-delay: 0ms; }
.stagger-children.revealed > *:nth-child(2) { opacity:1; transform:none; transition-delay: 80ms; }
.stagger-children.revealed > *:nth-child(3) { opacity:1; transform:none; transition-delay: 160ms; }
.stagger-children.revealed > *:nth-child(4) { opacity:1; transform:none; transition-delay: 240ms; }
.stagger-children.revealed > *:nth-child(5) { opacity:1; transform:none; transition-delay: 320ms; }
.stagger-children.revealed > *:nth-child(6) { opacity:1; transform:none; transition-delay: 400ms; }
.stagger-children.revealed > *:nth-child(n+7) { opacity:1; transform:none; transition-delay: 480ms; }
