/* ==========================================================
   Rare East — custom styles (works alongside Tailwind CDN)
   ========================================================== */

:root {
  --cream: #F6F0E6;
  --parchment: #EFE6D5;
  --forest: #1C3327;
  --forest2: #264535;
  --bronze: #B58C4A;
  --bronzedark: #8E6B33;
  --ink: #2B2620;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
}

::selection {
  background: var(--bronze);
  color: var(--cream);
}

/* ---------------------------------------------------------
   LOADING SCREEN
   --------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.loader.loader-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
  padding: 0 1.5rem;
}

.loader-mountain {
  width: 200px;
  margin: 0 auto 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  animation: loaderFadeUp 1s ease forwards 0.15s;
}

.loader-wordmark {
  font-family: 'Cormorant', serif;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  letter-spacing: 0.14em;
  color: var(--forest);
  opacity: 0;
  transform: translateY(10px);
  animation: loaderFadeUp 1s ease forwards 0.5s;
}

.loader-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.9rem 0 2rem;
  opacity: 0;
  transform: translateY(10px);
  animation: loaderFadeUp 1s ease forwards 0.85s;
}

.loader-rule span {
  height: 1px;
  width: 2.5rem;
  background: var(--bronze);
}

.loader-rule p {
  font-family: 'EB Garamond', serif;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--bronzedark);
}

.loader-bar {
  width: 160px;
  height: 1px;
  background: rgba(43, 38, 32, 0.15);
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  animation: loaderFadeUp 0.6s ease forwards 1.1s;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--bronze);
  animation: loaderProgress 1.6s ease-in-out forwards 1.2s;
}

@keyframes loaderFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loaderProgress {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* ---------------------------------------------------------
   SITE REVEAL
   --------------------------------------------------------- */
.site-hidden {
  opacity: 0;
}

.site-visible {
  opacity: 1;
  transition: opacity 0.8s ease;
}

.fade-item {
  opacity: 0;
  transform: translateY(14px);
  animation: heroFadeUp 0.9s ease forwards;
}
.fade-item:nth-child(1) { animation-delay: 0.05s; }
.fade-item:nth-child(2) { animation-delay: 0.18s; }
.fade-item:nth-child(3) { animation-delay: 0.3s; }
.fade-item:nth-child(4) { animation-delay: 0.42s; }
.fade-item:nth-child(5) { animation-delay: 0.54s; }
.fade-item:nth-child(6) { animation-delay: 0.66s; }

@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   NAV
   --------------------------------------------------------- */
header[data-state="top"] {
  background: transparent;
  color: var(--forest);
}
header[data-state="top"] .nav-word { color: var(--forest); }

header[data-state="scrolled"] {
  background: var(--cream);
  box-shadow: 0 1px 0 rgba(43,38,32,0.08);
  color: var(--forest);
}
header[data-state="scrolled"] .nav-word { color: var(--forest); }

.nav-link {
  position: relative;
  padding-bottom: 2px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 1px;
  background: var(--bronze);
  transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

.mobile-link {
  display: block;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, #F8F3EA 0%, var(--cream) 60%, var(--cream) 100%);
}

.hero-mist {
  position: absolute;
  inset: 0;
  background-image: url('assets/misty-texture.png');
  background-repeat: no-repeat;
  background-position: center right;
  background-size: cover;
  opacity: 0.3;
  mask-image: linear-gradient(to left, black, transparent 65%),
              linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  mask-composite: intersect;
  -webkit-mask-image: linear-gradient(to left, black, transparent 65%),
                       linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  -webkit-mask-composite: source-in;
  pointer-events: none;
}

/* ---------------------------------------------------------
   PRODUCT CARDS
   --------------------------------------------------------- */
.product-shelf {
  position: relative;
}

/* Fixed-height "shelf" box each bottle sits in, bottom-aligned —
   so every card's title starts at the same line regardless of
   how tall that particular bottle image is. */
.shelf-slot {
  height: 10rem;        /* h-40 */
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 768px) {
  .shelf-slot { height: 14rem; } /* md:h-56, matches the tallest (Body Elixir) bottle */
}

/* Same idea for the soap grid: bars are near-identical in height but
   not pixel-identical, so give them a shared shelf too. */
.shelf-slot-soap {
  height: 11rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 768px) {
  .shelf-slot-soap { height: 13rem; }
}

.product-card img {
  filter: drop-shadow(0 10px 14px rgba(43,38,32,0.12));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.product-card:hover img {
  transform: translateY(-4px);
  filter: drop-shadow(0 16px 18px rgba(43,38,32,0.18));
}

.product-card h3 {
  line-height: 1.25;
}

/* ---------------------------------------------------------
   STORY BAND
   --------------------------------------------------------- */
.story-band {
  background:
    linear-gradient(180deg, rgba(28,51,39,0.88), rgba(28,51,39,0.93)),
    url('assets/misty-texture.png');
  background-size: cover;
  background-position: center;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.footer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.footer-contact-item:hover {
  opacity: 1;
  color: var(--bronzedark);
}

/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .loader-mountain, .loader-wordmark, .loader-rule, .loader-bar, .fade-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .loader-bar-fill { width: 100% !important; }
  html { scroll-behavior: auto; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
}
