/* ===================================================================
   ANNAPOORNA — PREMIUM CRAFT LAYER
   Texture · custom cursor · magnetic CTAs · cinematic reveals
   creed section · refined footer · editorial detailing
   Loaded AFTER styles.css. Vanilla, no libraries, reduced-motion aware.
   =================================================================== */

/* ---------- 1. FILM GRAIN / PAPER TEXTURE ----------
   A fixed, ultra-subtle noise layer over the whole site adds the
   tactility that separates "designed" from "generated". */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- 2. CUSTOM CURSOR (desktop, fine-pointer only) ----------
   A small ember ring + dot that trails the pointer and swells over
   interactive elements. Fail-open: native cursor only hidden once JS
   adds .cursor-ready, so a JS failure leaves the native cursor intact. */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--ember);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(200, 150, 10, 0.55);
  transition: width 0.25s cubic-bezier(0.22,1,0.36,1),
              height 0.25s cubic-bezier(0.22,1,0.36,1),
              background 0.25s, border-color 0.25s, opacity 0.3s;
}
body.cursor-ready.cursor-active .cursor-dot,
body.cursor-ready.cursor-active .cursor-ring { opacity: 1; }
body.cursor-ready.cursor-hover .cursor-ring {
  width: 64px; height: 64px;
  background: rgba(200, 150, 10, 0.10);
  border-color: rgba(200, 150, 10, 0.8);
}
@media (hover: hover) and (pointer: fine) {
  body.cursor-ready, body.cursor-ready a, body.cursor-ready button { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ---------- 3. MAGNETIC BUTTONS ---------- */
.magnetic { will-change: transform; transition: transform 0.25s cubic-bezier(0.22,1,0.36,1); }

/* ---------- 4. CINEMATIC IMAGE REVEAL (clip-path wipe) ---------- */
[data-clip] {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: clip-path;
}
[data-clip].is-revealed { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  [data-clip] { clip-path: none; }
}

/* ---------- 5. LINE-BY-LINE HEADING REVEAL ---------- */
.reveal-lines .line { overflow: hidden; display: block; }
.reveal-lines .line > span {
  display: block;
  transform: translateY(105%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-lines.is-revealed .line:nth-child(1) > span { transition-delay: 0.05s; }
.reveal-lines.is-revealed .line:nth-child(2) > span { transition-delay: 0.16s; }
.reveal-lines.is-revealed .line:nth-child(3) > span { transition-delay: 0.27s; }
.reveal-lines.is-revealed .line:nth-child(4) > span { transition-delay: 0.38s; }
.reveal-lines.is-revealed .line > span { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-lines .line > span { transform: none; }
}

/* ---------- 6. KEN BURNS HERO ---------- */
.hero-bg.kenburns {
  animation: kenburns 22s ease-in-out infinite alternate;
  transform-origin: 68% 42%;
}
@keyframes kenburns {
  from { transform: scale(1.0); }
  to   { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg.kenburns { animation: none; }
}

/* ---------- 7. THE CREED (authentic brand slogan) ----------
   Built on Al Tazaj's real positioning line. The set-piece that makes
   the site feel written FOR them, not templated. */
.creed {
  background: var(--charcoal);
  color: var(--cream);
  padding: clamp(7rem, 15vw, 12rem) 0;
  position: relative;
  overflow: hidden;
}
.creed::before {
  /* oversized faded ember quotation mark */
  content: "\201C";
  position: absolute;
  top: -2rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: clamp(16rem, 34vw, 34rem);
  line-height: 1;
  color: var(--ember);
  opacity: 0.12;
  pointer-events: none;
}
.creed::after {
  /* warm glow */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(200,150,10,0.16), transparent 60%);
  pointer-events: none;
}
.creed-inner { max-width: 26ch; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.creed-ar {
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.8;
  color: var(--saffron);
  margin-bottom: 2.2rem;
  font-weight: 500;
  opacity: 0.92;
}
.creed-en {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.creed-en em { font-style: italic; color: var(--saffron); }
.creed-attr {
  margin-top: 2.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245,237,216,0.5);
}

/* ---------- 8. EDITORIAL SECTION INDEX LABELS ---------- */
.sec-index {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ember);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.sec-index::before { content: ""; width: 2rem; height: 1px; background: var(--ember); opacity: 0.6; }

/* ---------- 9. REFINED FOOTER with oversized watermark ---------- */
footer { position: relative; overflow: hidden; }
.footer-watermark {
  position: absolute;
  bottom: -3.5rem; right: -1rem; left: 0;
  text-align: center;
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
  font-size: clamp(8rem, 26vw, 24rem);
  line-height: 0.8;
  color: var(--cream);
  opacity: 0.04;
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
}
footer .container { position: relative; z-index: 1; }

/* ---------- 10. BUTTON SHEEN ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s cubic-bezier(0.22,1,0.36,1);
}
.btn:hover::after { left: 130%; }

/* ---------- 11. SECTION DIVIDER (charcoal hairline + ember node) ---------- */
.rule {
  display: flex; align-items: center; gap: 1.2rem;
  margin: 0 auto; max-width: var(--max-w);
  padding: 0 var(--pad-x);
}
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.rule-node { width: 7px; height: 7px; transform: rotate(45deg); background: var(--ember); flex: 0 0 auto; }

/* ---------- 12. PRODUCT CARD — premium framing ---------- */
.product-card { position: relative; }
.product-img::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(26,52,40,0.28));
  opacity: 0; transition: opacity 0.4s; z-index: 1;
}
.product-card:hover .product-img::before { opacity: 1; }

/* ---------- 13. NAV refinement ---------- */
.nav-links a { overflow: hidden; }
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1.5px; background: var(--ember);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 14. SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--ember), var(--saffron));
  z-index: 9997;
  transition: width 0.1s linear;
}

/* ---------- 15. PREMIUM TYPE TWEAKS ---------- */
.display, h1, h2, h3 { text-wrap: balance; }
.lede, p { text-wrap: pretty; }

/* ---------- 17. LOCATIONS accurate layout ---------- */
.loc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 3rem 0 1rem;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0;
}
.loc-stats .proof-stat { display: block; font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 500; color: var(--ember); line-height: 1; }
.loc-stats .proof-stat-label { display: block; margin-top: 0.7rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(26,52,40,0.55); }
.loc-region-title { margin-top: 4.5rem; margin-bottom: 1.8rem; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.loc-link { color: var(--ember); border-bottom: 1px solid currentColor; }
@media (max-width: 800px) { .loc-stats { grid-template-columns: 1fr 1fr; gap: 2.4rem 1rem; } }

/* ---------- 18. MOBILE MENU ---------- */
.mobile-order { display: none; }
.menu-toggle { transition: transform 0.3s; z-index: 120; }
body.nav-open .menu-toggle { transform: rotate(90deg); }
@media (max-width: 880px) {
  /* turn the hidden nav-links into a slide-down panel */
  .nav-links {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 6.5rem var(--pad-x) 2.5rem;
    background: rgba(245, 237, 216, 0.99);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 110;
  }
  body.nav-open .nav-links { transform: translateY(0); }
  .nav-links a {
    font-family: var(--serif);
    font-size: 1.6rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-links a::after { display: none; }
  .mobile-order {
    display: inline-block !important;
    margin-top: 1.6rem;
    background: var(--ember);
    color: var(--cream) !important;
    font-family: var(--sans) !important;
    font-size: 0.95rem !important;
    text-align: center;
    padding: 1rem 1.5rem !important;
    border-radius: 999px;
    border-bottom: none !important;
  }
  body.nav-open { overflow: hidden; }
}

/* ---------- 16. accessibility: respect reduced motion globally ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn::after { display: none; }
  .hero-bg { transform: none !important; }
}
