/* ==========================================================================
   KHAMAREE (খামারী) — Botanical Luxury & Living Organic Atmosphere
   Artisanal farm-to-table brand identity, crafted with high-performance CSS.
   ========================================================================== */

:root {
  --c-forest: #162F19;
  --c-forest-deep: #0F2012;
  --c-sprout: #96BF3D;
  --c-sprout-bright: #A8D644;
  --c-olive: #5B6D4E;
  --c-olive-soft: #7A8E6B;
  --c-gold: #C79A3B;
  --c-gold-light: #F3D27E;
  --c-paper-0: #FAF6EE;
  --c-paper-1: #F5F0E4;
  --c-paper-2: #EDE5D2;
  --c-paper-3: #E4D8BE;
  --font-bangla-serif: 'Tiro Bangla', 'Hind Siliguri', serif;
  --font-bangla-sans: 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, sans-serif;
  --font-latin-serif: 'Cormorant Garamond', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background-color: var(--c-paper-1);
}

body {
  font-family: var(--font-bangla-sans);
  background-color: var(--c-paper-1);
  background-image: radial-gradient(130% 95% at 50% 20%, var(--c-paper-0) 0%, var(--c-paper-1) 42%, var(--c-paper-2) 76%, var(--c-paper-3) 100%);
  background-attachment: fixed;
  color: var(--c-forest);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Custom artisanal parchment scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(245, 240, 228, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(91, 109, 78, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--c-sprout);
}

::selection {
  background: rgba(150, 191, 61, 0.32);
  color: var(--c-forest-deep);
}

/* ================= Initial Reveal States (Only when JS is active) ================= */

html.js [data-reveal] {
  opacity: 0;
  visibility: hidden;
}

html.js [data-reveal="header"] {
  transform: translateY(-16px);
}

html.js [data-reveal="logo"] {
  transform: translateY(16px) scale(0.96);
  filter: blur(8px);
}

html.js [data-reveal="divider"] {
  transform: scale(0.9);
}

html.js [data-reveal="h1"] {
  transform: translateY(22px);
  filter: blur(4px);
}

html.js [data-reveal="sub"] {
  transform: translateY(18px);
}

html.js [data-reveal="pillars"] {
  transform: translateY(16px);
}

html.js [data-reveal="countdown"] {
  transform: translateY(20px) scale(0.97);
}

html.js [data-reveal="waitlist"] {
  transform: translateY(22px);
}

html.js [data-reveal="foot"] {
  transform: translateY(16px);
}

html.js .rule-l {
  transform: scaleX(0);
  transform-origin: right center;
}

html.js .rule-r {
  transform: scaleX(0);
  transform-origin: left center;
}

html.js .divider-leaf {
  opacity: 0;
  transform: scale(0.2) rotate(-25deg);
}

html:not(.js) .veil {
  display: none;
}

/* Guaranteed visible fallback if scripts fail */
html.force-reveal [data-reveal] {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  filter: none !important;
}

html.force-reveal .rule-l,
html.force-reveal .rule-r {
  transform: scaleX(1) !important;
}

html.force-reveal .divider-leaf {
  opacity: 1 !important;
  transform: none !important;
}

html.force-reveal .veil {
  opacity: 0 !important;
  visibility: hidden !important;
}

html.force-reveal .glow,
html.force-reveal .sunbeam {
  opacity: 0.85 !important;
}

/* ================= 3D / 2D Canvas Atmosphere Layers ================= */

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#scene.ready {
  opacity: 1;
}

/* Sunbeams (Komorebi dappled canopy rays) */
.sunbeam {
  position: fixed;
  inset: -15%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 65% 50% at 35% 10%, rgba(255, 250, 230, 0.75) 0%, rgba(255, 248, 222, 0.35) 45%, rgba(255, 246, 214, 0) 75%),
              conic-gradient(from 205deg at 35% 10%, rgba(255, 255, 240, 0) 0deg, rgba(255, 252, 235, 0.22) 25deg, rgba(255, 255, 240, 0) 45deg, rgba(255, 252, 235, 0.16) 65deg, rgba(255, 255, 240, 0) 90deg);
  filter: blur(28px);
  animation: beamBreathe 14s ease-in-out infinite alternate;
}

@keyframes beamBreathe {
  0% { transform: scale(1) rotate(0deg); opacity: 0.55; }
  50% { transform: scale(1.04) rotate(1.5deg); opacity: 0.78; }
  100% { transform: scale(0.98) rotate(-1deg); opacity: 0.6; }
}

/* Warm ambient morning glow */
.glow {
  position: fixed;
  z-index: 3;
  left: -10%;
  right: -10%;
  top: -24%;
  height: 85vh;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(56% 62% at 50% 22%, rgba(255, 250, 228, 0.98) 0%, rgba(255, 246, 216, 0.45) 48%, rgba(255, 246, 216, 0) 75%);
  transition: opacity 1.8s ease;
}

/* Interactive cursor light follower */
.cursor-glow {
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  margin-top: -240px;
  margin-left: -240px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 235, 0.42) 0%, rgba(255, 248, 220, 0.18) 35%, rgba(255, 245, 210, 0) 70%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transform: translate3d(50vw, 50vh, 0);
  transition: opacity 0.8s ease, transform 0.12s ease-out;
  will-change: transform, opacity;
}

/* Warm parchment vignette */
.vignette {
  position: fixed;
  z-index: 15;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 82% at 50% 48%, rgba(0, 0, 0, 0) 52%, rgba(70, 55, 30, 0.08) 85%, rgba(45, 35, 15, 0.16) 100%);
}

/* Tactile handmade paper fiber grain */
.grain {
  position: fixed;
  z-index: 16;
  inset: 0;
  pointer-events: none;
  opacity: 0.65;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.38 0 0 0 0 0.34 0 0 0 0 0.28 0 0 0 0.065 0'/></filter><rect width='200' height='200' filter='url(%23g)'/></svg>");
  background-size: 200px 200px;
}

/* Cinematic opening veil */
.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--c-paper-1);
  pointer-events: none;
}

/* ================= Stage & Card Architecture (Flat & Simple) ================= */

.stage {
  position: relative;
  z-index: 20;
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(36px, 8vh, 72px) clamp(20px, 4vw, 40px) clamp(16px, 3vh, 24px);
}

.card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 820px;
  width: 100%;
}

/* ================= Logo & SVG Refinements ================= */

.logo {
  width: clamp(240px, 42vw, 440px);
  margin-inline: auto;
  position: relative;
  cursor: default;
  user-select: none;
}

.logo svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 16px 36px rgba(22, 47, 25, 0.12)) drop-shadow(0 4px 10px rgba(22, 47, 25, 0.06));
  transition: filter 0.5s ease;
}

.card-wrap:hover .logo svg {
  filter: drop-shadow(0 22px 48px rgba(22, 47, 25, 0.16)) drop-shadow(0 6px 14px rgba(22, 47, 25, 0.08));
}

/* Sprout leaves living micro-animation (Disabled per user request) */
.logo-sprout {
  transform-origin: 50% 100%;
}

/* ================= Divider & Botanical Ornament ================= */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 20px);
  width: min(340px, 68vw);
  margin: clamp(24px, 4.2vh, 36px) auto clamp(22px, 3.8vh, 32px);
  position: relative;
}

.rule {
  flex: 1;
  height: 1px;
  position: relative;
  overflow: hidden;
}

.rule-l {
  background: linear-gradient(90deg, rgba(199, 154, 59, 0), rgba(199, 154, 59, 0.45) 40%, rgba(212, 175, 55, 0.95) 100%);
}

.rule-r {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.95) 0%, rgba(199, 154, 59, 0.45) 60%, rgba(199, 154, 59, 0) 100%);
}

/* Subtle light gleam that travels down the rule */
.rule::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  animation: ruleGleam 6s ease-in-out infinite;
}

.rule-r::after {
  animation-delay: 0.4s;
}

@keyframes ruleGleam {
  0%, 65% { left: -100%; }
  100% { left: 100%; }
}

.divider-leaf {
  width: clamp(22px, 3.5vw, 26px);
  height: auto;
  flex: none;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(22, 47, 25, 0.18));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.divider:hover .divider-leaf {
  transform: scale(1.22) rotate(12deg);
}

/* ================= Typography & Luxury Foil Accents ================= */

.hero-heading {
  font-family: var(--font-bangla-serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 5.8vw, 3.75rem);
  line-height: 1.38;
  color: var(--c-forest);
  letter-spacing: 0.015em;
  position: relative;
  display: inline-block;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 8px 24px rgba(22, 47, 25, 0.08);
  user-select: none;
}

.title-text {
  position: relative;
  z-index: 1;
}

/* Luxury gold-foil shimmer sheen */
.shimmer-glint {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(212, 175, 55, 0) 38%, rgba(255, 245, 215, 0.85) 50%, rgba(212, 175, 55, 0) 62%, transparent 80%);
  background-size: 250% 100%;
  background-position: 150% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foilShimmer 7.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  opacity: 0.85;
}

@keyframes foilShimmer {
  0%, 70% {
    background-position: 150% 0;
    opacity: 0;
  }
  75% {
    opacity: 0.95;
  }
  90% {
    background-position: -80% 0;
    opacity: 0.95;
  }
  100% {
    background-position: -80% 0;
    opacity: 0;
  }
}

.sub {
  margin-top: clamp(12px, 2.2vh, 18px);
  font-weight: 300;
  font-size: clamp(1.02rem, 2.3vw, 1.22rem);
  line-height: 1.95;
  color: var(--c-olive);
  max-width: min(580px, 88vw);
  letter-spacing: 0.02em;
  text-wrap: balance;
  transition: color 0.3s ease;
}

.sub:hover {
  color: var(--c-forest);
}

/* ================= Site Footer ================= */

.site-foot {
  position: relative;
  z-index: 25;
  width: 100%;
  padding: 16px clamp(20px, 4vw, 40px) clamp(20px, 3.5vh, 28px);
  margin-top: auto;
  pointer-events: auto;
  background: transparent;
}

.foot-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  border-top: 1px solid rgba(199, 154, 59, 0.22);
  padding-top: 16px;
  background: transparent;
}

.foot-copy {
  font-size: clamp(0.78rem, 1.8vw, 0.84rem);
  color: var(--c-olive);
  opacity: 0.85;
  letter-spacing: 0.025em;
  font-weight: 400;
}

/* ================= Screen Size & Orientation Adaptations ================= */

/* Small Mobile screens */
@media (max-width: 520px) {

  .stage {
    padding-top: max(68px, calc(env(safe-area-inset-top) + 56px));
    padding-bottom: 24px;
  }

  .logo {
    width: clamp(230px, 72vw, 300px);
  }

  .divider {
    width: 65vw;
    margin-top: 18px;
    margin-bottom: 16px;
  }

  .hero-heading {
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
  }

  .sub {
    font-size: 0.95rem;
    line-height: 1.8;
  }
}

/* Short height screens (e.g. landscape phones or low-height laptops) */
@media (max-height: 640px) {
  .stage {
    padding-top: 72px;
    padding-bottom: 30px;
  }

  .divider {
    margin-top: 14px;
    margin-bottom: 12px;
  }
}

/* Tablet screens (Portrait & Landscape) */
@media (min-width: 768px) and (max-width: 1024px) {
  .logo {
    width: clamp(340px, 48vw, 420px);
  }

  .hero-heading {
    font-size: clamp(2.8rem, 5vw, 3.4rem);
  }
}

/* Large 4K / Ultra-wide displays */
@media (min-width: 2000px) {
  .logo {
    width: 520px;
  }

  .hero-heading {
    font-size: 4.5rem;
  }

  .sub {
    font-size: 1.5rem;
    max-width: 760px;
  }
}

/* High-contrast and reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #scene {
    transition: none !important;
  }

  .shimmer-glint {
    display: none;
  }
}