/* ============================================
   MARIANN GRAY · Base styles
   Reset + typography defaults
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body {
  font-family: var(--font-serif);
  color: var(--color-ink);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

body {
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, var(--color-peach) 0%, transparent 80%),
    radial-gradient(ellipse 85% 75% at 0% 100%, var(--color-rose) 0%, transparent 80%),
    var(--color-cream);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: auto;
}

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* Default browser cursor + pointer for interactive elements */
a, button, [role="button"], .cat-product, [data-magnetic],
.cat-arrow, .qv-arrow, .qv-thumb, .quick-view-close,
.collection-tab, .ritual-toggle-btn, .lang-switcher button,
.sound-toggle, .scroll-top-btn, .nav-logo {
  cursor: pointer;
}
input, textarea, [contenteditable] { cursor: text; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* —— ELEMENTS —— */
a {
  color: inherit;
  text-decoration: none;
  cursor: auto;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: auto;
  font-family: var(--font-serif);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--color-terra);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-burgundy);
}

/* —— UTILITY: Floating petals (used in hero + section transitions) —— */
.petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-petals);
  overflow: hidden;
}

.petal {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, var(--color-rose-soft), var(--color-rose));
  opacity: 0.4;
  animation: petal-fall linear infinite;
  filter: blur(0.5px);
}

.petal:nth-child(1)  { left: 6%;  width: 12px; height: 12px; animation-duration: 22s; animation-delay: 0s; }
.petal:nth-child(2)  { left: 18%; width: 18px; height: 18px; animation-duration: 28s; animation-delay: -5s; }
.petal:nth-child(3)  { left: 30%; width: 10px; height: 10px; animation-duration: 24s; animation-delay: -12s; }
.petal:nth-child(4)  { left: 44%; width: 16px; height: 16px; animation-duration: 30s; animation-delay: -3s; }
.petal:nth-child(5)  { left: 58%; width: 13px; height: 13px; animation-duration: 26s; animation-delay: -8s; }
.petal:nth-child(6)  { left: 72%; width: 17px; height: 17px; animation-duration: 32s; animation-delay: -16s; }
.petal:nth-child(7)  { left: 84%; width: 11px; height: 11px; animation-duration: 23s; animation-delay: -2s; }
.petal:nth-child(8)  { left: 92%; width: 15px; height: 15px; animation-duration: 29s; animation-delay: -10s; }
.petal:nth-child(9)  { left: 38%; width: 9px;  height: 9px;  animation-duration: 27s; animation-delay: -18s; }

@keyframes petal-fall {
  0%   { transform: translateY(-10vh) rotate(0deg);    opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(540deg);  opacity: 0; }
}

/* —— UTILITY: Section eyebrow (script accent) —— */
.eyebrow {
  font-family: var(--font-script);
  font-size: clamp(22px, 2.4vw, 32px);
  color: var(--color-terra);
  margin-bottom: var(--space-2);
  display: inline-block;
}

/* —— UTILITY: Decorative ornament line —— */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-3) auto;
}
.ornament::before, .ornament::after {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.7;
}
.ornament-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-terra);
}

/* —— Drop cap utility —— */
.has-dropcap::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 0.1em 0.1em 0 0;
  color: var(--color-burgundy);
}

/* —— Roman numerals for chapter markers —— */
.chapter-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--color-gold);
  letter-spacing: 0.2em;
}

/* —— UTILITY: Scroll reveal —— */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
html.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* —— LANGUAGE-AWARE FONT FALLBACKS —— */
/* Armenian doesn't render well in Playfair italic — switch to Noto Serif Armenian */
html[lang="hy"] .story-title,
html[lang="hy"] .story-prose p,
html[lang="hy"] .pull-quote p,
html[lang="hy"] .teaser-title,
html[lang="hy"] .chapter-divider-name,
html[lang="hy"] .story-subtitle {
  font-family: var(--font-armenian);
}
html[lang="hy"] .pull-quote p,
html[lang="hy"] .story-title,
html[lang="hy"] .teaser-title {
  font-style: normal;
  font-weight: 500;
}

/* Drop cap: language-aware */
html[lang="hy"] .story-prose .has-dropcap::first-letter {
  font-family: var(--font-armenian);
  font-style: normal;
  font-weight: 600;
}
