/* ============================================
   BestNotes — Design System
   Premium handwritten exam notes platform
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand palette — exact spec */
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --ink: #111827;
  --bg: #FAFAFA;
  --card: #FFFFFF;
  --gold: #C9A227;
  --gold-soft: #E8D9A8;
  --text: #6B7280;
  --text-dark: #374151;
  --success: #16A34A;

  /* Derived surfaces */
  --border: rgba(17, 24, 39, 0.08);
  --border-strong: rgba(17, 24, 39, 0.12);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 24px 64px rgba(17, 24, 39, 0.12);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 12px 32px rgba(37, 99, 235, 0.14);

  /* Radii — spec range 18–24px */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Type scale */
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.45s;
  --dur-slow: 0.8s;
}

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

html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  position: relative;
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.07);
  padding: 7px 16px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-head h2 {
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.section-head p {
  font-size: 17px;
  color: var(--text);
}

/* ---------- Gold highlight stroke — signature element ---------- */
.stroke {
  position: relative;
  white-space: nowrap;
}
.stroke svg {
  position: absolute;
  left: -2%;
  bottom: -0.12em;
  width: 104%;
  height: 0.4em;
  z-index: -1;
  overflow: visible;
}
.stroke svg path {
  stroke: var(--gold);
  stroke-width: 8;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  transition: stroke-dashoffset 1s var(--ease) 0.3s;
}
.stroke.in-view svg path { stroke-dashoffset: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 15px 30px;
  border-radius: var(--r-pill);
  transition: transform var(--dur-fast) var(--ease-soft), box-shadow var(--dur-fast) var(--ease-soft), background var(--dur-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.24), 0 0 0 1px rgba(37,99,235,0.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--r-pill);
}
.btn-ghost:hover { background: rgba(17,24,39,0.05); }

.btn-sm { padding: 10px 20px; font-size: 14px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease), border-color var(--dur-med);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-scale.in-view { opacity: 1; transform: scale(1); }

/* Stagger delays */
.d1 { transition-delay: 0.05s; }
.d2 { transition-delay: 0.12s; }
.d3 { transition-delay: 0.19s; }
.d4 { transition-delay: 0.26s; }
.d5 { transition-delay: 0.33s; }
.d6 { transition-delay: 0.4s; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-pill);
}
.badge-success { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.badge-gold { background: rgba(201, 162, 39, 0.12); color: #9C7E1E; }
.badge-primary { background: rgba(37, 99, 235, 0.1); color: var(--primary); }

/* ---------- Skeleton loader ---------- */
.skeleton {
  background: linear-gradient(90deg, #EEEFF1 25%, #F6F7F8 37%, #EEEFF1 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Floating decorative shapes ---------- */
.float-el {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: floaty 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- Star rating ---------- */
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ink);
  color: white;
  padding: 16px 22px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: all 0.35s var(--ease);
  z-index: 999;
  pointer-events: none;
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }
.toast svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

@media (max-width: 640px) {
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
.product-poster{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.product-poster{
    width:100%;
    height:220px;
    object-fit:cover;
    display:block;
    border-radius:18px 18px 0 0;
    background:#f5f5f5;
}

.dark .product-poster{
    background:#111827;
}