/* BookPace landing styles */
:root {
  --bg: #0b0f17;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --brand: #6ee7b7;
  --brand-600: #10b981;
  --accent: #60a5fa;
  --ring: rgba(99, 102, 241, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #05070c 0%, var(--bg) 100%);
}

.container { width: min(1100px, 92%); margin: 0 auto; }
.row { display: flex; gap: 1rem; }
.between { justify-content: space-between; }
.center { align-items: center; text-align: left; }
.grid { display: grid; gap: 1.25rem; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.3) blur(8px);
  background: rgba(11, 15, 23, 0.6);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-header .brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-text { font-weight: 700; letter-spacing: .2px; }
.logo {
  width: 56px; height: 56px; border-radius: 14px; display: block; object-fit: cover;
}
.nav a { color: var(--muted); text-decoration: none; padding: .75rem; border-radius: 8px; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }

.btn { display: inline-block; padding: .7rem 1rem; border-radius: 10px; text-decoration: none; color: var(--text); border: 1px solid rgba(255,255,255,.12); }
.btn:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.04); }
.btn.primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%); color: #0b0f17; border: none; box-shadow: 0 8px 24px rgba(16,185,129,.25); }
.btn.primary:hover { filter: brightness(.98); }
.btn.large { padding: .9rem 1.2rem; font-weight: 600; }

.hero { padding: 5.5rem 0 3rem; }
.hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
.hero-copy h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: 0 0 .6rem; }
.hero-copy p { color: var(--muted); margin: 0 0 1.25rem; }
.hero .actions { display: flex; gap: .75rem; align-items: center; }

/* Typed headline caret */
.typewrap { display: inline-block; }
.caret { display: inline-block; width: 2px; height: 1em; background: currentColor; margin-left: 4px; vertical-align: -0.2em; animation: caret-blink 1s steps(1, end) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-art { display: grid; grid-template-columns: auto minmax(200px, 300px) auto; align-items: center; justify-content: center; gap: 10px; }
.icon-card {
  width: 100%;
  justify-self: center;
  aspect-ratio: 9/19.5; /* tall phone */
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04);
}
.icon-card .slides { position: absolute; inset: 0; }
.icon-card .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; background: #0b0f17; }
.icon-card .slide.active { opacity: 1; }

/* Slider controls */
.slide-nav {
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.35);
  color: #fff; display: grid; place-items: center;
  cursor: pointer; user-select: none;
}
.slide-nav:hover { background: rgba(0,0,0,.5); }
.hero-art > .slide-nav { position: static; transform: none; }

.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.35); border: none; padding: 0; cursor: pointer; }
.dot.active { background: #fff; }

@media (max-width: 480px) {
  .slide-nav { width: 30px; height: 30px; }
}

.section { padding: 3.5rem 0; }
.section.alt { background: rgba(255,255,255,.02); border-top: 1px solid rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.06); }
.section h2 { margin: 0 0 1rem; font-size: 1.8rem; }

.features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 1rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }



.screenshots-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shot { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; margin: 0; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 9/19.5; object-fit: cover; background: #0b0f17; }

.hint { color: var(--muted); font-size: .9rem; }

.site-footer { padding: 2rem 0; border-top: 1px solid rgba(255,255,255,.08); color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer a:visited { color: var(--muted); }
.footer-nav { display: flex; gap: 1rem; }
.to-top { color: var(--muted); text-decoration: none; }
.to-top:hover { color: var(--text); }

@media (max-width: 880px) {
  .nav { display: none; }
  .cta { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  /* Reduce hero image footprint on small/tablet widths */
  .hero-art { order: -1; grid-template-columns: 1fr; }
  /* Use viewport-based width so it never fills the screen */
  .icon-card { width: clamp(200px, 42vw, 320px); margin-inline: auto; }
  .hero-art > .slide-nav { display: none; }
  .features { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { width: 90%; }

  /* Header adjustments */
  .site-header { padding: 0.5rem 0; }
  .logo { width: 36px; height: 36px; border-radius: 9px; }
  .brand-text { font-size: 1rem; }

  /* Hero section */
  .hero { padding: 2rem 0 1.5rem; }
  .hero-copy { min-height: 240px; }
  .hero-copy h1 { font-size: clamp(1.5rem, 7vw, 2rem); margin-bottom: 0.75rem; line-height: 1.2; }
  .hero .actions { flex-direction: column; width: 100%; gap: 0.5rem; }
  .hero .actions .btn { width: 100%; text-align: center; padding: 0.65rem 0.9rem; font-size: 0.95rem; }

  /* Make icon-card smaller on mobile */
  .hero-art { grid-template-columns: 1fr; justify-content: center; }
  .icon-card { width: clamp(160px, 42vw, 240px); border-radius: 22px; }

  /* Section spacing */
  .section { padding: 2rem 0; }
  .section h2 { font-size: 1.4rem; margin-bottom: 1rem; }

  /* Grid spacing */
  .grid { gap: 1rem; }

  /* Cards - more compact */
  .card { padding: 1rem; }
  .card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
  .card p { font-size: 0.9rem; line-height: 1.5; }

  /* Legal pages */
  body:has(.legal-container) .container { width: 95%; }

  /* Footer stacking */
  .site-footer { padding: 1.5rem 0; }
  .site-footer .row { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .footer-nav { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
  .container { width: 88%; }

  /* Even more compact header */
  .logo { width: 32px; height: 32px; border-radius: 8px; }
  .brand-text { font-size: 0.95rem; }

  /* Tighter spacing on very small screens */
  .hero { padding: 1.5rem 0 1.25rem; }
  .hero-copy { min-height: 220px; }
  .hero-copy h1 { font-size: clamp(1.35rem, 6vw, 1.75rem); }
  .section { padding: 1.75rem 0; }
  .section h2 { font-size: 1.3rem; }

  /* Even smaller icon-card on very small screens */
  .hero-art { grid-template-columns: 1fr; }
  .icon-card { width: clamp(140px, 38vw, 220px); border-radius: 20px; }

  /* Tighter grid spacing */
  .grid { gap: 0.875rem; }

  /* More compact cards */
  .card { padding: 0.875rem; }
  .card h3 { font-size: 0.95rem; }
  .card p { font-size: 0.85rem; }

  /* Smaller buttons */
  .btn { font-size: 0.9rem; padding: 0.6rem 0.85rem; }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f9fafb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #4b5563;
  }
  body { background: #f3f4f6; }
  .site-header { background: rgba(255,255,255,.75); }
  .card { background: #fff; }
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 500px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1001;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1001;
  transition: all 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-nav.prev {
  left: 1.5rem;
}

.lightbox-nav.next {
  right: 1.5rem;
}

.shot {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shot:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(110, 231, 183, 0.15);
}

.shot:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .lightbox-content {
    max-width: 320px;
    max-height: 60vh;
  }

  .lightbox-img {
    max-height: 60vh;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-nav.prev {
    left: 1rem;
  }

  .lightbox-nav.next {
    right: 1rem;
  }
}
