/* ============================================================
   BOOKINK WEBSITE
   Hybrid dark/light marketing site
   ============================================================ */

@import url('design-system/colors_and_type.css');

/* ---- Theme: dark-by-default (hero/CTA), light surfaces opt-in via .surface-light ---- */
:root {
  /* Accent (tweakable) */
  --accent: #FF3B30;
  --accent-glow: rgba(255, 59, 48, 0.45);
  --accent-soft: rgba(255, 59, 48, 0.12);

  /* Dark surface tokens (override defaults for dark sections) */
  --dark-bg: #050505;
  --dark-bg-2: #0c0c0e;
  --dark-bg-3: #131316;
  --dark-fg: #ffffff;
  --dark-fg-2: rgba(255, 255, 255, 0.72);
  --dark-fg-3: rgba(255, 255, 255, 0.50);
  --dark-fg-4: rgba(255, 255, 255, 0.32);
  --dark-border: rgba(255, 255, 255, 0.10);
  --dark-border-strong: rgba(255, 255, 255, 0.18);
  --dark-card: rgba(255, 255, 255, 0.04);
  --dark-card-hover: rgba(255, 255, 255, 0.07);
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--dark-bg);
  color: var(--dark-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "kern";
}

body {
  overflow-x: hidden;
}

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

::selection { background: var(--accent); color: white; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-tight {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
}

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

.section-tight { padding: 80px 0; }

@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .container, .container-tight { padding: 0 20px; }
}

/* ============================================================
   SURFACES
   ============================================================ */

.surface-dark {
  background: var(--dark-bg);
  color: var(--dark-fg);
  position: relative;
}

.surface-light {
  background: #fafafa;
  color: var(--color-gray-900);
  position: relative;
}

.surface-white { background: #ffffff; color: var(--color-gray-900); }

/* ============================================================
   LIGHT THEME OVERRIDES
   When body has .theme-light, dark sections become cream/light
   ============================================================ */

body.theme-light .surface-dark {
  --dark-bg: #f7f4ef;
  --dark-bg-2: #ffffff;
  --dark-bg-3: #efeae0;
  --dark-fg: #0a0a0a;
  --dark-fg-2: rgba(10, 10, 10, 0.78);
  --dark-fg-3: rgba(10, 10, 10, 0.62);
  --dark-fg-4: rgba(10, 10, 10, 0.38);
  --dark-border: rgba(10, 10, 10, 0.08);
  --dark-border-strong: rgba(10, 10, 10, 0.18);
  --dark-card: rgba(255, 255, 255, 0.6);
  --dark-card-hover: rgba(255, 255, 255, 0.85);
  background: var(--dark-bg);
  color: var(--dark-fg);
}

body.theme-light .surface-light {
  background: #ffffff;
}

/* Dot grid: invert to dark dots on cream */
body.theme-light .surface-dark .dot-grid {
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.09) 1px, transparent 1px);
}

/* Pill on light theme */
body.theme-light .surface-dark .pill {
  border-color: rgba(10, 10, 10, 0.10);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-gray-700);
  backdrop-filter: blur(10px);
}

/* Nav: light glass */
body.theme-light .nav.scrolled {
  background: rgba(247, 244, 239, 0.78);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* btn-primary becomes dark (since white-on-cream is invisible) */
body.theme-light .surface-dark .btn-primary {
  background: #0a0a0a;
  color: #ffffff;
}
body.theme-light .surface-dark .btn-primary:hover { background: #2a2a2a; }

/* btn-ghost-dark becomes light ghost — needs solid background + border on light */
body.theme-light .surface-dark .btn-ghost-dark,
body.theme-light .btn-ghost-dark {
  background: rgba(0, 0, 0, 0.04);
  color: #0a0a0a;
  border-color: rgba(0, 0, 0, 0.14);
}
body.theme-light .surface-dark .btn-ghost-dark:hover,
body.theme-light .btn-ghost-dark:hover { background: rgba(0, 0, 0, 0.08); }

/* Nav links live outside .surface-dark — flip them too */
body.theme-light .nav-link {
  color: rgba(10, 10, 10, 0.72);
}
body.theme-light .nav-link:hover { color: #0a0a0a; }

/* Nav buttons (live outside surface-dark on plain nav) — also flip */
body.theme-light .nav a.btn { background: #0a0a0a !important; color: #fff !important; }

/* Stat numbers gradient */
body.theme-light .surface-dark .stat-num {
  background: linear-gradient(180deg, #0a0a0a 0%, #888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Reduce decorative glow saturation in light theme so it reads as a tint, not a spotlight */
body.theme-light .glow-orb { opacity: 0.5 !important; mix-blend-mode: multiply; }

/* Footer borders */
body.theme-light footer.surface-dark { border-top-color: rgba(0, 0, 0, 0.08); }

/* Cinematic glow backdrops */
.glow-backdrop {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  pointer-events: none;
}

/* ============================================================
   TYPOGRAPHY (website-scale, NOT app-scale)
   ============================================================ */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dark-fg-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.surface-light .eyebrow { color: var(--color-gray-500); }

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.h-display {
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.h-xl {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.h-lg {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.h-md {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.body-lg {
  font-size: clamp(17px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--dark-fg-2);
}

.surface-light .body-lg { color: var(--color-gray-600); }

.body-md {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--dark-fg-2);
}

.surface-light .body-md { color: var(--color-gray-600); }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  transition: all 200ms var(--ease-out);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #ffffff;
  color: #0a0a0a;
}
.btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 0 transparent, 0 12px 32px -8px var(--accent-glow);
}
.btn-accent:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 0 0 transparent, 0 18px 40px -8px var(--accent-glow);
}

.btn-ghost-dark {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  border-color: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,0.10); }

.btn-ghost-light {
  background: transparent;
  color: var(--color-gray-900);
  border-color: var(--color-gray-200);
}
.btn-ghost-light:hover { background: var(--color-gray-100); }

.btn-dark {
  background: #0a0a0a;
  color: #ffffff;
}
.btn-dark:hover { background: #222; transform: translateY(-1px); }

.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-sm { padding: 10px 16px; font-size: 13px; }

/* ============================================================
   PILLS / CHIPS / BADGES
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 100px;
  border: 1px solid var(--dark-border);
  background: rgba(255,255,255,0.04);
  color: var(--dark-fg-2);
  backdrop-filter: blur(10px);
}

.surface-light .pill {
  border-color: var(--color-gray-200);
  background: white;
  color: var(--color-gray-700);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* ============================================================
   PHONE FRAME (used many places)
   ============================================================ */

.phone {
  width: 320px;
  height: 660px;
  background: #0a0a0a;
  border-radius: 44px;
  padding: 8px;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.15),
    0 60px 120px -20px rgba(0,0,0,0.6),
    0 30px 60px -20px rgba(0,0,0,0.4);
  position: relative;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #0a0a0a;
  border-radius: 100px;
  z-index: 20;
}

/* Status bar inside phone */
.phone-status {
  height: 50px;
  padding: 18px 28px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #0a0a0a;
  flex-shrink: 0;
}

.phone-status .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============================================================
   DECORATIVE GRID PATTERN
   ============================================================ */

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

.dot-grid-light {
  background-image: radial-gradient(circle, rgba(0,0,0,0.10) 1px, transparent 1px);
}

/* ============================================================
   GENERIC UTILITIES
   ============================================================ */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.gap-8 { gap: 32px; } .gap-10 { gap: 40px; } .gap-12 { gap: 48px; }

.text-center { text-align: center; }
.relative { position: relative; }

.divider-dark { height: 1px; background: var(--dark-border); width: 100%; }
.divider-light { height: 1px; background: var(--color-gray-200); width: 100%; }

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: all 300ms var(--ease-out);
}

.nav.scrolled {
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark-fg-2);
  transition: color 200ms;
}

.nav-link:hover { color: var(--dark-fg); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in.delay-1 { transition-delay: 80ms; }
.fade-in.delay-2 { transition-delay: 160ms; }
.fade-in.delay-3 { transition-delay: 240ms; }
.fade-in.delay-4 { transition-delay: 320ms; }
.fade-in.delay-5 { transition-delay: 400ms; }

/* ============================================================
   APP MOCKS — shared styles for the "in-product" displays
   ============================================================ */

.app-mock {
  background: white;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5), 0 12px 30px -10px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
}

.app-mock-light {
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.12), 0 12px 30px -10px rgba(0,0,0,0.08);
  border: 1px solid var(--color-gray-200);
}

/* ============================================================
   STAT CARD
   ============================================================ */

.stat-num {
  font-size: clamp(56px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 0%, #888888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.surface-light .stat-num {
  background: linear-gradient(180deg, #0a0a0a 0%, #666 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   STAGGERED GRID
   ============================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 16px; }
}
