/* ═══════════════════════════════════════════════════════
   Thinnai Interiors — style.css
   Premium dark luxury interior design site
════════════════════════════════════════════════════════ */

/* ── 1. Design Tokens ─────────────────────────────────── */
:root {
  --bg:           #0D0D0D;
  --surface:      #141414;
  --surface-2:    #1A1A1A;
  --border:       rgba(201, 164, 92, 0.15);
  --gold:         #C9A45C;
  --gold-light:   #DDB96E;
  --gold-dim:     rgba(201, 164, 92, 0.12);
  --text:         #F0EBE0;
  --text-muted:   #9A9080;
  --text-dim:     #5C5650;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --container: min(1100px, 100% - 2 * 1.5rem);
  --radius: 2px;
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scrolling */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img, canvas { display: block; }

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

/* ── 3. Loader ────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out);
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: min(320px, 80vw);
}

.loader-brand {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text);
}

.loader-bar-track {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

#loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.15s linear;
  will-change: width;
}

#loader-pct {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

/* ── 4. Hero Scroll Section ───────────────────────────── */
#hero {
  position: relative;
  height: 400vh;
}

#hero-canvas {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  will-change: transform; /* hint GPU compositing */
}

/* ── 5. Hero Overlays ─────────────────────────────────── */
/*
  Overlays are position: fixed so they track the viewport
  while the canvas is stuck. IntersectionObserver on #hero
  hides them completely (visibility: hidden, opacity: 0,
  pointer-events: none) the moment the hero section leaves
  the viewport in either direction — so they NEVER appear
  over the sections below.
*/
.hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  text-align: center;

  /* Default: fully hidden */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.7s var(--ease-out),
    visibility 0s linear 0.7s; /* delay visibility reset until fade completes */
}

/* When hero exits viewport — JS adds this to body */
body.hero-done .hero-overlay,
body.hero-done .hero-overlay.visible {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

/* Visible state (JS adds .visible class) */
.hero-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none; /* text overlays: no pointer events */
  transition:
    opacity 0.7s var(--ease-out),
    visibility 0s linear 0s; /* immediately visible */
}

/* Overlay 3 needs click-through for the CTA button */
#overlay-3.visible {
  pointer-events: auto;
}

/* Gradient behind overlay text for readability */
.overlay-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.28) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

.hero-caption {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text);
  max-width: 14ch;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}

.hero-caption em {
  font-style: italic;
  color: var(--gold);
}

/* ── 6. Shared Components ─────────────────────────────── */
.container {
  width: var(--container);
  margin-inline: auto;
}

.section-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* Gold CTA Button */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.35s var(--ease-out);
  z-index: 1;
}

.btn-gold::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
  z-index: -1;
}

.btn-gold:hover {
  color: var(--bg);
}

.btn-gold:hover::before {
  transform: scaleX(1);
}

/* ── 7. Services Section ──────────────────────────────── */
#services {
  padding: clamp(5rem, 10vw, 9rem) 0;
  background: var(--bg);
}

#services .section-title {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.service-card {
  background: var(--bg);
  padding: clamp(1.8rem, 4vw, 2.8rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  transition: background 0.3s;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.8rem;
  right: 1.8rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
}

.service-card:hover {
  background: var(--surface);
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-num {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.service-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.service-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 300;
}

/* ── 8. Stats Strip ───────────────────────────────────── */
#stats {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 3.5rem;
  background: var(--border);
  flex-shrink: 0;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-plus,
.stat-unit {
  font-size: 0.55em;
  color: var(--gold);
  vertical-align: super;
  font-weight: 500;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── 9. Contact Section ───────────────────────────────── */
#contact {
  padding: clamp(5rem, 10vw, 9rem) 0;
  background: var(--bg);
}

.contact-inner {
  max-width: 640px;
}

.contact-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
  margin-top: 1.25rem;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 2.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color 0.25s;
}

a.contact-link:hover {
  color: var(--gold);
}

.contact-sep {
  color: var(--text-dim);
}

.btn-whatsapp {
  gap: 0.7rem;
}

/* ── 10. Footer ───────────────────────────────────────── */
#footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  padding: clamp(3rem, 6vw, 5rem) 0;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 22ch;
  line-height: 1.6;
}

.footer-links-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-right nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-right nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.25s;
  letter-spacing: 0.03em;
}

.footer-right nav a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── 11. Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .stat-divider { display: none; }
  .stat { border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }

  .stats-row {
    flex-direction: column;
    gap: 0;
  }

  .footer-inner { flex-direction: column; gap: 2rem; }

  .footer-bottom .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .contact-sep { display: none; }
}

@media (max-width: 480px) {
  .hero-caption { max-width: 18ch; }
  .services-grid { grid-template-columns: 1fr; }
}

/* ── 12. Reduced Motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-overlay,
  .btn-gold,
  .btn-gold::before,
  .service-card,
  .service-card::after {
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
