/* Bookify DS tokens — light-only website, brand colors as accents */
:root {
  --ds-primary: #162447;
  --ds-primary-light: #1f3a6e;
  --ds-primary-dark: #0d1830;
  --ds-accent: #1363ff;
  --ds-accent-light: #89a9ef;
  --ds-gold: #f5a623;
  --ds-success: #00c896;
  --ds-error: #ef4444;

  --ds-bg: #ffffff;
  --ds-surface: #ffffff;
  --ds-surface-2: #f7f8fc;
  --ds-text: #0d1830;
  --ds-text-sec: #4a5468;
  --ds-text-muted: #8c95ad;
  --ds-border: #e4e7ef;
  --ds-card: #ffffff;
  --ds-nav: #ffffff;

  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-space-xs: 4px;
  --ds-space-sm: 8px;
  --ds-space-md: 16px;
  --ds-space-lg: 24px;
  --ds-space-xl: 32px;

  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --max: 1080px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ds-text);
  background: var(--ds-bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ds-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(100% - 2 * var(--ds-space-md), var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ds-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-md);
  padding: var(--ds-space-md) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-sm);
  color: var(--ds-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-links {
  display: none;
  gap: var(--ds-space-lg);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ds-text-sec);
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ds-primary);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-text);
  cursor: pointer;
}

.nav-toggle[aria-expanded="true"] + .nav-links,
.nav.is-open .nav-links {
  display: flex;
}

@media (max-width: 767px) {
  .nav.is-open {
    flex-wrap: wrap;
  }

  .nav.is-open .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: var(--ds-space-md);
    gap: var(--ds-space-md);
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
  }
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex-shrink: 0;
  color: #f0f4ff;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.carousel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-lg);
}

.carousel-inner.carousel-split {
  flex-direction: column;
}

@media (min-width: 768px) {
  .carousel-inner.carousel-split {
    flex-direction: row;
    align-items: center;
  }

  .carousel-inner.carousel-split .carousel-text {
    flex: 1;
  }

  .carousel-inner.carousel-split .carousel-image {
    flex: 0 0 40%;
    max-width: 40%;
  }
}

.carousel-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 var(--ds-space-md);
  max-width: 18ch;
  color: #fff;
}

.carousel-text p {
  margin: 0 0 var(--ds-space-lg);
  max-width: 38rem;
  color: rgba(240, 244, 255, 0.82);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.carousel-image img {
  width: 100%;
  height: auto;
  border-radius: var(--ds-radius-md);
  object-fit: cover;
  max-height: 320px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--ds-space-sm);
  padding: var(--ds-space-md) 0;
  background: var(--ds-bg);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: var(--ds-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, width 0.2s;
}

.carousel-dot.active {
  background: var(--ds-accent);
  width: 28px;
}

/* Legacy hero fallback */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--ds-accent) 28%, transparent), transparent 60%),
    linear-gradient(160deg, var(--ds-primary-dark), var(--ds-primary) 55%, var(--ds-primary-light));
  color: #f0f4ff;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 var(--ds-space-md);
  max-width: 14ch;
}

.hero p {
  margin: 0 0 var(--ds-space-lg);
  max-width: 38rem;
  color: color-mix(in srgb, #f0f4ff 82%, transparent);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-sm);
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: var(--ds-radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ds-accent);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ds-accent) 35%, transparent);
}

.btn-secondary {
  background: color-mix(in srgb, #fff 12%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, #fff 28%, transparent);
}

.btn-outline {
  background: #fff;
  color: var(--ds-primary);
  border-color: var(--ds-border);
}

.btn-outline:hover {
  border-color: var(--ds-accent);
  color: var(--ds-accent);
}

.btn-muted {
  background: var(--ds-surface-2);
  color: var(--ds-text-sec);
  border-color: var(--ds-border);
  cursor: default;
}

.btn-muted:hover {
  transform: none;
}

/* Sections */
.section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-primary);
}

.section .lede {
  color: var(--ds-text-sec);
  max-width: 40rem;
  margin: 0 0 var(--ds-space-lg);
}

.grid-3 {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: #fff;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-lg);
  box-shadow: 0 2px 12px rgba(22, 36, 71, 0.06);
}

.card h3 {
  font-family: var(--font-display);
  margin: 0 0 var(--ds-space-sm);
  font-size: 1.15rem;
  color: var(--ds-primary);
}

.card p {
  margin: 0;
  color: var(--ds-text-sec);
}

/* Policy pages */
.page-hero {
  background: var(--ds-surface-2);
  border-bottom: 1px solid var(--ds-border);
  padding: clamp(2rem, 5vw, 3rem) 0;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-primary);
}

.page-hero p {
  margin: 0;
  color: var(--ds-text-sec);
}

.policy-list {
  display: grid;
  gap: var(--ds-space-md);
}

.policy-section {
  background: #fff;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-lg);
}

.policy-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-primary);
}

.policy-section .body {
  color: var(--ds-text-sec);
  white-space: pre-wrap;
}

.status {
  padding: var(--ds-space-lg);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-2);
  color: var(--ds-text-sec);
  border: 1px dashed var(--ds-border);
}

.status.error {
  border-color: color-mix(in srgb, var(--ds-error) 40%, var(--ds-border));
  color: var(--ds-error);
}

.download-row {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .download-row {
    grid-template-columns: 1fr 1fr;
  }
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-md);
  align-items: flex-start;
}

.store-card .badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ds-accent) 10%, transparent);
  color: var(--ds-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Footer — subtle navy tint */
.site-footer {
  border-top: 1px solid var(--ds-border);
  background: var(--ds-surface-2);
  padding: var(--ds-space-xl) 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: var(--ds-space-lg);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.site-footer h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-primary);
}

.site-footer p,
.site-footer a {
  color: var(--ds-text-sec);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--ds-space-sm);
}

.footer-copy {
  margin-top: var(--ds-space-xl);
  padding-top: var(--ds-space-md);
  border-top: 1px solid var(--ds-border);
  color: var(--ds-text-muted);
  font-size: 0.9rem;
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}
