/* ============================================================
   i-KEYZ HOME STUDIO — DESIGN SYSTEM
   Intelligent Key, Perfect Home
   Version: 1.0 | Phase 2 Foundation
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;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 Colors */
  --color-teal:          #0A5C49;
  --color-teal-dark:     #083D30;
  --color-teal-deeper:   #062E24;
  --color-teal-light:    #0D6B57;
  --color-teal-muted:    rgba(10, 92, 73, 0.08);

  --color-gold:          #C9A96E;
  --color-gold-light:    #D9BC8A;
  --color-gold-dark:     #A8833F;
  --color-gold-muted:    rgba(201, 169, 110, 0.15);

  --color-white:         #FFFFFF;
  --color-off-white:     #FAFAF8;
  --color-cream:         #F5F2EC;
  --color-light-gray:    #F0EDEA;
  --color-mid-gray:      #C8C4BE;
  --color-text-muted:    #8A8580;
  --color-text-body:     #3A3530;
  --color-text-dark:     #1A1410;

  /* Overlays */
  --overlay-hero:        rgba(6, 28, 22, 0.55);
  --overlay-card:        rgba(10, 92, 73, 0.72);
  --overlay-light:       rgba(250, 250, 248, 0.92);

  /* Typography */
  --font-display:        'Cormorant Garamond', Georgia, serif;
  --font-body:           'DM Sans', -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:   6rem;       /* 96px */

  /* Spacing */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-5:    1.25rem;
  --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;

  /* Layout */
  --max-width:        1280px;
  --max-width-narrow: 800px;
  --max-width-wide:   1440px;
  --container-pad:    clamp(1.25rem, 5vw, 4rem);

  /* Border */
  --radius-sm:   3px;
  --radius-md:   6px;
  --radius-lg:   12px;
  --radius-full: 9999px;
  --border-gold: 1px solid var(--color-gold);
  --border-teal: 1px solid var(--color-teal);
  --border-light: 1px solid rgba(201, 169, 110, 0.2);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(10, 60, 40, 0.08);
  --shadow-md:   0 4px 16px rgba(10, 60, 40, 0.12);
  --shadow-lg:   0 8px 32px rgba(10, 60, 40, 0.16);
  --shadow-xl:   0 16px 64px rgba(10, 60, 40, 0.20);
  --shadow-gold: 0 0 0 1px rgba(201, 169, 110, 0.4);

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   600ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-luxury: 700ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-base:     1;
  --z-above:    10;
  --z-nav:      100;
  --z-modal:    200;
  --z-floating: 300;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::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-body);
  font-size: var(--text-base);
  color: var(--color-text-body);
  background-color: var(--color-off-white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

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

/* ── Typography ───────────────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl));
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-dark);
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl));
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl));
  font-weight: 400;
  line-height: 1.15;
}

.display-sm {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 3vw, var(--text-4xl));
  font-weight: 400;
  line-height: 1.2;
}

.heading-lg {
  font-family: var(--font-display);
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-3xl));
  font-weight: 500;
  line-height: 1.25;
}

.heading-md {
  font-family: var(--font-display);
  font-size: clamp(var(--text-md), 2vw, var(--text-2xl));
  font-weight: 500;
  line-height: 1.3;
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.body-lg {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--color-text-body);
}

.body-md {
  font-size: var(--text-base);
  line-height: 1.7;
}

.body-sm {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section--sm {
  padding-block: clamp(var(--space-10), 5vw, var(--space-20));
}

.section--dark {
  background-color: var(--color-teal-deeper);
  color: var(--color-off-white);
}

.section--teal {
  background-color: var(--color-teal);
  color: var(--color-off-white);
}

.section--cream {
  background-color: var(--color-cream);
}

.section--white {
  background-color: var(--color-white);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-6);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

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

.btn--primary {
  background-color: var(--color-teal);
  color: var(--color-white);
  border: 1px solid var(--color-teal);
}

.btn--primary:hover {
  background-color: var(--color-teal-light);
  border-color: var(--color-teal-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--gold {
  background-color: var(--color-gold);
  color: var(--color-teal-deeper);
  border: 1px solid var(--color-gold);
}

.btn--gold:hover {
  background-color: var(--color-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.35);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.5);
}

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

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

.btn--outline-teal:hover {
  background-color: var(--color-teal);
  color: var(--color-white);
  transform: translateY(-1px);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
  letter-spacing: 0.08em;
}

/* ── Gold Divider ─────────────────────────────────────────── */
.gold-rule {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  margin-block: var(--space-4);
}

.gold-rule--center {
  margin-inline: auto;
}

.gold-rule--lg {
  width: 80px;
  height: 2px;
}

/* ── Section Headers ──────────────────────────────────────── */
.section-header {
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

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

.section-header--center .gold-rule {
  margin-inline: auto;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-luxury);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card--bordered {
  border: var(--border-light);
}

.card--bordered:hover {
  border-color: rgba(201, 169, 110, 0.5);
}

/* Product/Category Card */
.product-card {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-luxury);
}

.product-card:hover .product-card__image {
  transform: scale(1.06);
}

.product-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6, 28, 22, 0.88) 0%,
    rgba(6, 28, 22, 0.2) 50%,
    transparent 100%
  );
  transition: background var(--transition-base);
}

.product-card:hover .product-card__overlay {
  background: linear-gradient(
    to top,
    rgba(10, 92, 73, 0.92) 0%,
    rgba(10, 92, 73, 0.4) 60%,
    transparent 100%
  );
}

.product-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6);
}

.product-card__explore {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-base);
  margin-top: var(--space-2);
}

.product-card:hover .product-card__explore {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scroll Reveal Animations ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }
.reveal--delay-5 { transition-delay: 0.5s; }

.reveal--left {
  transform: translateX(-32px);
}

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

.reveal--right {
  transform: translateX(32px);
}

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

/* ── Image 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: 21/9; }

/* ── Decorative Elements ──────────────────────────────────── */
.gold-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-gold);
  vertical-align: middle;
}

.teal-line {
  width: 2px;
  background: linear-gradient(to bottom, var(--color-teal), transparent);
  flex-shrink: 0;
}

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

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Responsive Utilities ─────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .grid-2, .grid-3, .grid-4 { gap: var(--space-4); }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── VISUAL RICHNESS OVERRIDES ────────────────────────────── */
/* Makes the site look premium even before real photos arrive  */

body {
  background-color: var(--color-teal-deeper);
}

/* Alternating rich sections */
.section {
  background: var(--color-off-white);
}

.section--cream {
  background: var(--color-cream);
}

/* Product card placeholders — rich gradients until photos arrive */
.product-card {
  background: var(--color-teal-dark);
}

.product-card__image[src=""] ,
.product-card__image:not([src]),
.product-card__image[src*="products/tiles-hero"],
.product-card__image[src*="products/sanitaryware-hero"],
.product-card__image[src*="products/quartz-hero"],
.product-card__image[src*="products/paints-hero"],
.product-card__image[src*="products/hardware-hero"],
.product-card__image[src*="products/plumbing-hero"] {
  display: none;
}

/* Tile placeholder gradient */
a[href*="tiles"] .product-card {
  background: linear-gradient(135deg, #1a3a2e 0%, #0d5240 40%, #2a5a3a 100%);
}
a[href*="sanitaryware"] .product-card {
  background: linear-gradient(135deg, #0a3d30 0%, #145244 40%, #1a6652 100%);
}
a[href*="quartz"] .product-card {
  background: linear-gradient(135deg, #2a2a1a 0%, #3d3820 40%, #c9a96e22 100%), linear-gradient(135deg, #1a2a20, #0a3028);
}
a[href*="paints"] .product-card {
  background: linear-gradient(135deg, #1a2d38 0%, #0d3d4a 40%, #0a4a5a 100%);
}
a[href*="hardware"] .product-card {
  background: linear-gradient(135deg, #2d2010 0%, #3d2a0a 40%, #4a3510 100%);
}
a[href*="plumbing"] .product-card {
  background: linear-gradient(135deg, #0a1a2d 0%, #0d2240 40%, #0a2a4a 100%);
}

/* Show card content even without image */
.product-card__overlay {
  background: linear-gradient(
    to top,
    rgba(4, 16, 12, 0.95) 0%,
    rgba(4, 16, 12, 0.3) 50%,
    transparent 100%
  ) !important;
}

/* Instagram placeholders — styled */
.instagram-placeholder {
  background: linear-gradient(135deg, var(--color-teal-dark), var(--color-teal-deeper));
  color: rgba(201, 169, 110, 0.5);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(201, 169, 110, 0.1);
}

/* Hero poster — use showroom render */
.hero__poster {
  background-image: url('/images/showroom/showroom-exterior.jpg');
  background-size: cover;
  background-position: center 30%;
}

/* If poster image also fails, use rich gradient */
.hero {
  background: linear-gradient(135deg, 
    var(--color-teal-deeper) 0%, 
    var(--color-teal-dark) 40%, 
    #0d4a35 70%,
    var(--color-teal-deeper) 100%
  );
}
