/* ═══════════════════════════════════════════════
   OUR STORY — Design System & Base Styles
   A premium love-story microsite for Aashi & Ash
   ═══════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&display=swap');

/* ── Design Tokens ── */
:root, [data-theme="light"] {
  /* Colors — Luxury Romantic Light Palette */
  --bg: #FFF9FA; /* warm creamy blush white */
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFF1F5;
  --primary-pink: #D6456E; /* rich vibrant rose */
  --primary-pink-glow: rgba(214, 69, 110, 0.2);
  --primary-pink-dim: rgba(214, 69, 110, 0.55);
  --soft-pink: #FCE8EE;
  --cream: #38242A;
  --text: #1C1115;
  --text-secondary: #503B43;
  --muted: #826C74;
  --muted-dim: #B4A0A8;
  --accent-warm: #C87548;
  --accent-rose: #D94870;
  --accent-midnight: #56436B;
  --border: rgba(214, 69, 110, 0.16);
  --border-hover: rgba(214, 69, 110, 0.35);
  --overlay: rgba(255, 249, 250, 0.9);
  --overlay-heavy: rgba(255, 249, 250, 0.97);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --grain-opacity: 0.12;

  /* Typography */
  --font-heading: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-heading-alt: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'DM Sans', sans-serif;

  /* Font Sizes */
  --fs-hero: clamp(3rem, 8vw, 7rem);
  --fs-chapter: clamp(2.2rem, 5vw, 4.5rem);
  --fs-h1: clamp(1.8rem, 4vw, 3rem);
  --fs-h2: clamp(1.4rem, 3vw, 2.2rem);
  --fs-h3: clamp(1.1rem, 2vw, 1.5rem);
  --fs-body: clamp(0.9rem, 1.5vw, 1.05rem);
  --fs-small: clamp(0.75rem, 1.2vw, 0.85rem);
  --fs-tiny: clamp(0.65rem, 1vw, 0.75rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-tight: 600px;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(180, 70, 100, 0.06);
  --shadow-md: 0 6px 22px rgba(180, 70, 100, 0.09);
  --shadow-lg: 0 14px 44px rgba(180, 70, 100, 0.12);
  --shadow-glow: 0 0 25px rgba(214, 69, 110, 0.22);
  --shadow-glow-lg: 0 0 50px rgba(214, 69, 110, 0.32);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.7s;
  --duration-cinematic: 1.2s;

  /* Z-Index Scale */
  --z-base: 1;
  --z-above: 10;
  --z-nav: 100;
  --z-modal: 1000;
  --z-overlay: 900;
  --z-toast: 1100;
  --z-particles: 5;
}

[data-theme="dark"] {
  /* Colors — Dark Romance */
  --bg: #0D0B0C;
  --bg-elevated: #161214;
  --bg-card: #1A1517;
  --bg-card-hover: #221D1F;
  --primary-pink: #F2A6B8;
  --primary-pink-glow: rgba(242, 166, 184, 0.25);
  --primary-pink-dim: rgba(242, 166, 184, 0.6);
  --soft-pink: #F8DDE4;
  --cream: #F5EFE7;
  --text: #FFFFFF;
  --text-secondary: #D4CDD0;
  --muted: #9C9295;
  --muted-dim: #6B6568;
  --accent-warm: #E8C4A0;
  --accent-rose: #E07A9E;
  --accent-midnight: #7B6B8D;
  --border: rgba(242, 166, 184, 0.12);
  --border-hover: rgba(242, 166, 184, 0.25);
  --overlay: rgba(13, 11, 12, 0.85);
  --overlay-heavy: rgba(13, 11, 12, 0.95);
  --nav-bg: rgba(13, 11, 12, 0.9);
  --grain-opacity: 0.5;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--primary-pink-glow);
  --shadow-glow-lg: 0 0 60px var(--primary-pink-glow);
}

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.7s;
  --duration-cinematic: 1.2s;

  /* Z-Index Scale */
  --z-base: 1;
  --z-above: 10;
  --z-nav: 100;
  --z-modal: 1000;
  --z-overlay: 900;
  --z-toast: 1100;
  --z-particles: 5;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ── Film Grain Overlay ── */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  background: transparent
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E")
    repeat;
  animation: grain 8s steps(10) infinite;
  pointer-events: none;
  opacity: var(--grain-opacity, 0.12);
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--muted-dim);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-pink-dim);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  font-family: var(--font-body);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--fs-body);
}

a {
  color: var(--primary-pink);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  color: var(--soft-pink);
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: var(--font-body);
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Utility Classes ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--tight {
  max-width: var(--container-tight);
}

.text-center { text-align: center; }
.text-pink { color: var(--primary-pink); }
.text-cream { color: var(--cream); }
.text-muted { color: var(--muted); }

.font-serif { font-family: var(--font-heading); }
.font-serif-alt { font-family: var(--font-heading-alt); }
.font-sans { font-family: var(--font-body); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Selection ── */
::selection {
  background: var(--primary-pink);
  color: var(--bg);
}

/* ── Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--primary-pink);
  outline-offset: 3px;
}

/* ── Page Sections ── */
.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-3xl) var(--space-md);
}

.section--auto {
  min-height: auto;
  padding: var(--space-2xl) var(--space-md);
}

/* ── Loading Screen ── */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-expo), visibility 0.8s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading-screen .loading-heart {
  font-size: 2.5rem;
  animation: heartPulse 1.2s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ── Chapter Label ── */
.chapter-label {
  font-family: var(--font-accent);
  font-size: var(--fs-tiny);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary-pink);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.chapter-number {
  font-family: var(--font-heading-alt);
  font-size: var(--fs-chapter);
  font-weight: 300;
  font-style: italic;
  color: var(--soft-pink);
  opacity: 0.15;
  position: absolute;
  top: 10%;
  right: 10%;
  pointer-events: none;
}
