/* =============================================
   POLYLIB WEBSITE — style.css
   Aesthetic: Editorial Minimalism × Deep Teal
   ============================================= */

:root {
  --teal: #0f4c5c;
  --teal-light: #1a7a8a;
  --teal-pale: #e8f4f7;
  --accent: #f4a623;
  --accent-pale: #fef5e3;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #f9fafb;
  --white: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 4px 24px rgba(15, 76, 92, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 76, 92, 0.14);
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 68px;
  background: rgba(249, 250, 251, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: var(--shadow); }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
}
.logo-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--teal); }

.nav-cta {
  background: var(--teal);
  color: #fff;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover { background: var(--teal-light); transform: translateY(-1px); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed;
  top: 68px; left: 0; right: 0;
  z-index: 99;
  background: var(--white);
  padding: 24px 5% 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-110%);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}
.mobile-menu.open { transform: translateY(0); }
.mob-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.mob-cta {
  display: inline-block;
  margin-top: 12px;
  background: var(--teal);
  color: #fff;
  text-align: center;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 120px 8% 80px;
  overflow: hidden;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.s1 {
  width: 500px; height: 500px;
  background: var(--teal);
  top: -100px; right: -100px;
}
.s2 {
  width: 300px; height: 300px;
  background: var(--accent);
  bottom: 80px; left: -80px;
}
.s3 {
  width: 200px; height: 200px;
  background: var(--teal-light);
  top: 50%; left: 40%;
}

.hero-content {
  flex: 1;
  max-width: 560px;
  position: relative;
  z-index: 2;
  animation: fadeUp 0.8s ease both;
}

.badge {
  display: inline-block;
  background: var(--teal-pale);
  color: var(--teal);
  border: 1px solid rgba(15,76,92,0.2);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title em {
  font-style: italic;
  color: var(--teal);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 36px;
  font-weight: 300;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(15,76,92,0.25);
}
.btn-primary:hover {
  background: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,76,92,0.3);
}
.btn-primary.btn-large { padding: 16px 36px; font-size: 1.05rem; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 2px solid var(--teal);
  transition: opacity 0.2s;
}
.btn-outline:hover { opacity: 0.7; }

/* ===== PHONE MOCKUP ===== */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  animation: fadeUp 0.8s 0.2s ease both;
}

.phone-mockup {
  width: 240px;
  background: var(--teal);
  border-radius: 36px;
  padding: 16px;
  box-shadow: 0 32px 80px rgba(15,76,92,0.35), 0 0 0 2px rgba(255,255,255,0.1);
  transform: rotate(4deg);
  transition: transform 0.4s;
}
.phone-mockup:hover { transform: rotate(1deg) scale(1.02); }

.phone-screen {
  background: #0a3040;
  border-radius: 24px;
  padding: 16px;
  min-height: 400px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.screen-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.screen-books {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-card {
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.5s ease both;
}
.book-card span { font-size: 0.78rem; font-weight: 600; color: #fff; }
.book-card small { font-size: 0.65rem; color: rgba(255,255,255,0.6); }
.bc1 { background: rgba(244,166,35,0.25); border-left: 3px solid var(--accent); animation-delay: 0.1s; }
.bc2 { background: rgba(255,255,255,0.08); border-left: 3px solid #5ba4b8; animation-delay: 0.2s; }
.bc3 { background: rgba(255,255,255,0.08); border-left: 3px solid #7bc47a; animation-delay: 0.3s; }
.bc4 { background: rgba(255,255,255,0.08); border-left: 3px solid #e07bb5; animation-delay: 0.4s; }
.bc5 { background: rgba(255,255,255,0.08); border-left: 3px solid #a78bfa; animation-delay: 0.5s; }

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  background: var(--teal);
  padding: 36px 8%;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 40px;
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
}
.stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.stat-div {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.15);
}

/* ===== SECTIONS ===== */
.section {
  padding: 96px 8%;
}

.section-tag {
  display: inline-block;
  background: var(--accent-pale);
  color: var(--accent);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 56px;
  max-width: 520px;
}

/* FEATURES GRID */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feat-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* HOW SECTION */
.how-section { background: var(--teal-pale); }

.steps {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.step {
  flex: 1;
  min-width: 200px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
}
.step-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--teal);
  opacity: 0.2;
  margin-bottom: 12px;
}
.step h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.step p { font-size: 0.9rem; color: var(--text-muted); }
.step-arrow {
  font-size: 1.8rem;
  color: var(--teal);
  opacity: 0.3;
  padding-top: 50px;
  font-weight: 300;
}

/* CTA */
.cta-section {
  padding: 80px 8%;
  background: linear-gradient(135deg, var(--teal) 0%, #0a2d38 100%);
  text-align: center;
}
.cta-inner { max-width: 580px; margin: 0 auto; }
.cta-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.2;
}
.cta-section p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  margin-bottom: 36px;
}

/* FOOTER */
.footer {
  background: var(--text);
  padding: 56px 8% 40px;
  text-align: center;
}
.footer-inner { max-width: 520px; margin: 0 auto; }
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.footer-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}

/* ===== DOC PAGES ===== */
.doc-page {
  padding-top: 68px;
  min-height: 100vh;
  background: var(--bg);
}

.doc-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 48px 8% 40px;
  animation: fadeUp 0.5s ease both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 20px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }

.doc-badge {
  display: inline-block;
  background: var(--teal-pale);
  color: var(--teal);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
}

.doc-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.doc-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.doc-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 8%;
  animation: fadeUp 0.5s 0.1s ease both;
}

/* Markdown Styles */
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  margin-top: 36px;
  margin-bottom: 12px;
  line-height: 1.3;
}
.doc-body h1 { font-size: 1.8rem; border-bottom: 2px solid var(--border); padding-bottom: 12px; }
.doc-body h2 { font-size: 1.4rem; }
.doc-body h3 { font-size: 1.1rem; }
.doc-body p { color: var(--text-muted); margin-bottom: 16px; font-size: 0.97rem; line-height: 1.8; }
.doc-body a { color: var(--teal); }
.doc-body ul, .doc-body ol { padding-left: 24px; margin-bottom: 16px; }
.doc-body li { color: var(--text-muted); margin-bottom: 8px; font-size: 0.97rem; line-height: 1.7; }
.doc-body strong { color: var(--text); font-weight: 600; }
.doc-body blockquote {
  border-left: 3px solid var(--teal);
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--teal-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.doc-body blockquote p { margin-bottom: 0; color: var(--teal); }
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.doc-body code {
  background: var(--teal-pale);
  color: var(--teal);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.doc-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 8% 64px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.doc-footer a {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s;
}
.doc-footer a:hover { opacity: 0.7; }

/* LOADING */
.loading-spinner {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero {
    flex-direction: column;
    padding: 100px 6% 60px;
    text-align: center;
    min-height: auto;
  }
  .hero-btns { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }

  .stats-bar { gap: 0; }
  .stat { padding: 16px 20px; }
  .stat-div { display: none; }

  .step-arrow { display: none; }
  .steps { flex-direction: column; }

  .section { padding: 64px 6%; }
  .doc-header { padding: 40px 6% 32px; }
  .doc-body { padding: 40px 6%; }
  .doc-footer { padding: 32px 6% 48px; }

  .phone-mockup { transform: rotate(0deg); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .stat-num { font-size: 1.5rem; }
  .hero-btns { flex-direction: column; align-items: center; }
}
