/* ==========================================================================
   Book Cover Designers Canada - Transparent Logo, 3D Flipbook & 3D Mockups
   ========================================================================== */

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

:root {
  --bg-dark: #0a0b10;
  --bg-card: #12141d;
  --bg-card-hover: #1a1d2b;
  --bg-glass: rgba(10, 11, 16, 0.92);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(220, 38, 38, 0.45);

  --primary: #dc2626;        /* Canadian Crimson Red */
  --primary-light: #ef4444;  /* Bright Canadian Red */
  --primary-dark: #b91c1c;   /* Deep Crimson Red */
  
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --accent-cyan: #38bdf8;
  --accent-rose: #f43f5e;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #64748b;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --shadow-card: 0 15px 35px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 35px rgba(220, 38, 38, 0.35);
  --shadow-gold: 0 0 30px rgba(245, 158, 11, 0.3);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-gold);
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 40%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Container */
.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Full Transparent Logo */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.4rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Full Transparent Logo - Large & Spans Top to Bottom for Maximum Readability */
.logo-img-full {
  height: 68px;
  max-height: 74px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.8));
  transition: var(--transition);
}

.logo-img-full:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.4));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: -20px;
  width: 270px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 0.65rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.dropdown-link:hover {
  background: rgba(220, 38, 38, 0.15);
  color: var(--primary-light);
  transform: translateX(4px);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.6rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 45px rgba(220, 38, 38, 0.55);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #000;
  font-weight: 800;
}

.btn-gold:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  color: #000;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  background: rgba(220, 38, 38, 0.12);
  color: var(--primary-light);
}

/* Hero Section */
.hero {
  padding: 5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 950px;
  height: 600px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.22) 0%, rgba(185, 28, 28, 0.12) 40%, transparent 80%);
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.2);
}

/* 3D CSS Book Mockup Component */
.book-3d-wrapper {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.book-3d {
  width: 260px;
  height: 380px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-25deg) rotateX(10deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s ease;
  cursor: pointer;
}

.book-3d:hover {
  transform: rotateY(-10deg) rotateX(4deg) scale(1.05);
}

.book-3d-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #180808 0%, #7f1d1d 50%, #dc2626 100%);
  border-radius: 4px 14px 14px 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.6), inset -2px 0 5px rgba(255, 255, 255, 0.2);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.book-3d-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 12%, rgba(255,255,255,0) 88%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

.book-3d-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 100%;
  background: linear-gradient(90deg, #7f1d1d 0%, #450a0a 50%, #991b1b 100%);
  transform: rotateY(-90deg) translateZ(19px);
  border-radius: 4px 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}

.book-3d-pages {
  position: absolute;
  top: 4px;
  right: 0;
  width: 32px;
  height: calc(100% - 8px);
  background: repeating-linear-gradient(90deg, #f1f5f9 0px, #e2e8f0 1px, #cbd5e1 2px);
  transform: rotateY(90deg) translateZ(242px);
  border-radius: 0 4px 4px 0;
}

.book-3d-shadow {
  position: absolute;
  bottom: -30px;
  left: 5%;
  width: 90%;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 70%);
  transform: rotateX(80deg) translateZ(-40px);
  filter: blur(10px);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.book-3d:hover .book-3d-shadow {
  transform: rotateX(80deg) translateZ(-60px) scale(1.1);
  opacity: 0.75;
}

/* ==========================================================================
   INTERACTIVE FLIPBOOK PREVIEW COMPONENT
   ========================================================================== */

.flipbook-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.flipbook-stage {
  perspective: 1400px;
  height: 380px;
  margin: 2rem auto;
  position: relative;
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
}

.flipbook-book {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  display: flex;
}

.flipbook-page {
  width: 50%;
  height: 100%;
  background: #fcfcfc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  padding: 2rem;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 10px 25px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  top: 0;
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-origin: left center;
  backface-visibility: hidden;
  user-select: none;
}

.flipbook-page.left {
  left: 0;
  border-radius: 8px 0 0 8px;
  transform-origin: right center;
}

.flipbook-page.right {
  right: 0;
  border-radius: 0 8px 8px 0;
  transform-origin: left center;
}

.flipbook-page-header {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

.flipbook-page-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
}

.flipbook-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Section Common */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem;
}

.section-subtitle {
  color: var(--primary-light);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-gold) 100%);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-7px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

.card-visual-header {
  height: 150px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 0.85rem;
}

.card-text {
  font-size: 0.98rem;
  color: var(--text-muted);
  flex-grow: 1;
}

/* Portfolio & Filter */
.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.8rem;
}

.portfolio-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.portfolio-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.portfolio-info {
  padding: 1.4rem;
}

.portfolio-cat {
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

/* Interactive Calculator */
.calc-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.form-group {
  margin-bottom: 1.4rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.form-select, .form-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.calc-summary {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.calc-price {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin: 1rem 0;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

/* SEO Math Auditor Bar */
.seo-math-badge {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9998;
  background: var(--bg-card);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.85rem;
}

.seo-math-badge:hover {
  transform: scale(1.06);
  border-color: var(--accent-gold);
}

.seo-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.seo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.seo-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.seo-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: var(--shadow-glow);
}

.seo-modal-close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

/* Footer */
.footer {
  background: #06070a;
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h4 {
  font-size: 1.15rem;
  margin-bottom: 1.4rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-contact {
  list-style: none;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-contact li {
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-links {
    position: fixed;
    top: 75px;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    flex-direction: column;
    padding: 2.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: none;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
