/* =========================================================================
   Simply Scripture — Landing Page
   Design tokens extracted from Figma (Web Master + Web foundations)
   ========================================================================= */

:root {
  /* Colour */
  --color-bg-surface: #f3f4f6;
  --color-red: #ff0b0b;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2f6fe0;
  --color-text-primary: #111827;
  --color-text-secondary: #374151;
  --color-text-tertiary: #4b5563;
  --color-text-light: #ffffff;
  --color-gray-300: #d1d5db;

  /* Type */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  /* Radius */
  --radius-card: 64px;
  --radius-pill: 100px;

  /* Shadow (light/elevation-200-canvas) */
  --shadow-card:
    0 0 0.5px 0 rgba(0, 0, 0, 0.18),
    0 3px 8px 0 rgba(0, 0, 0, 0.10),
    0 1px 3px 0 rgba(0, 0, 0, 0.10);
  --shadow-device: 0 24px 60px -20px rgba(0, 0, 0, 0.35);

  /* Layout */
  --panel-pad: 16px;
}

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: var(--color-text-primary);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--color-blue-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- Layout */
.landing {
  display: flex;
  min-height: 100svh;
  align-items: stretch;
}
.hero,
.showcase {
  flex: 1 1 50%;
  display: flex;
}

/* ----------------------------------------------------------- Hero panel */
.hero {
  padding: var(--panel-pad);
  align-items: center;
}
.hero__card {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  margin: 0;                 /* panel already has 16px padding — avoid doubling the outer gap */
  border-radius: var(--radius-card);
  background: var(--color-red);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* anchor brand block lower, matching Figma */
}
/* Subtle tone-on-tone shapes (recreated from the Figma background — no harsh glow) */
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(56% 50% at 80% 58%, rgba(0, 0, 0, 0.065) 0 44%, rgba(0, 0, 0, 0) 70%),
    radial-gradient(44% 40% at 98% 2%, rgba(0, 0, 0, 0.05) 0 42%, rgba(0, 0, 0, 0) 72%),
    radial-gradient(70% 60% at 4% -2%, rgba(255, 255, 255, 0.05) 0 40%, rgba(255, 255, 255, 0) 70%);
}
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  padding-left: clamp(32px, 7vw, 80px);
  padding-right: 24px;
  padding-bottom: clamp(140px, 19vh, 190px);  /* sits the block lower, per Figma */
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-light);
}
.brand__mark { width: 56px; height: 56px; flex: none; }
.brand__mark svg,
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.brand__name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hero__headline {
  color: var(--color-text-light);
  font-weight: 400;
  font-size: clamp(30px, 3.1vw, 40px);
  line-height: 1.4;            /* 40px → 56px, matches Figma */
  max-width: 404px;           /* Figma headline width */
}

/* --------------------------------------------------------------- Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  align-self: flex-start;
}
.btn--download { background: var(--color-blue-500); }
.btn--download:hover { background: var(--color-blue-600); transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.6); }
.btn--download:active { transform: translateY(0); }
.btn__icon { width: 20px; height: 24px; flex: none; }

/* ------------------------------------------------------------ Showcase */
.showcase {
  padding: var(--panel-pad);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.carousel {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.carousel__viewport {
  overflow: hidden;
  /* Grow to fill the panel so the dots pin to the right edge (16px in, via
     the showcase padding); the phone + caption stay centred within it */
  flex: 1 1 auto;
  min-width: 0;
  /* Tall enough to contain phone + caption + the rise animation + the
     phone's soft shadow, so nothing is clipped by overflow:hidden */
  height: 780px;
}
.carousel__track {
  display: flex;
  flex-direction: column;   /* vertical stack */
  height: 100%;
  /* easeOutExpo-style curve for a smooth, premium glide */
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;                /* Figma phone → caption gap */
  padding: 8px 12px;
}
/* Premium staggered entrance: each slide's phone + caption rise and fade in */
.slide .device,
.slide .caption { will-change: transform, opacity; }
.slide.is-active .device  { animation: rs-rise 0.85s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide.is-active .caption { animation: rs-rise 0.85s 0.18s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes rs-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Caption ---- */
.caption {
  text-align: center;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.caption__title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text-primary);
}
.caption__body {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-secondary);
}

/* ---- Carousel dots (vertical on desktop) ---- */
.carousel__dots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-gray-300);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.dot[aria-selected="true"] { background: var(--color-text-primary); transform: scale(1.1); }

/* ---------------------------------------------------------------- Footer */
.footer { width: 100%; display: flex; justify-content: center; padding-top: 8px; }
.footer__links {
  display: flex;
  gap: 24px;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-text-tertiary);
}
.footer__links a { transition: color 0.15s ease; }
.footer__links a:hover { color: var(--color-text-primary); }

/* ======================================================================
   Device mockup (recreated in CSS — no raster assets)
   ====================================================================== */
.device { display: flex; justify-content: center; }
.device__img {
  width: 272px;
  height: auto;
  max-width: 100%;
  /* drop-shadow follows the phone's transparent silhouette (not a box) */
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.13));
}
.device__frame {
  position: relative;
  width: 272px;
  height: 566px;
  border-radius: 44px;
  padding: 10px;
  background: #1c1c1e;
  box-shadow:
    inset 0 0 0 2px #3a3a3c,
    var(--shadow-device);
}
.device__island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 24px;
  background: #000;
  border-radius: 14px;
  z-index: 3;
}
.device__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.device--dark .device__screen { background: #0b0b0c; }

/* ---- Status bar ---- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #111;
  flex: none;
}
.statusbar--light { color: #fff; }
.statusbar__time { letter-spacing: 0.02em; }
.statusbar__icons { display: inline-flex; align-items: center; gap: 5px; }
.statusbar__icons i { display: inline-block; background: currentColor; }
.ico-signal { width: 16px; height: 10px; clip-path: polygon(0 100%,18% 100%,18% 55%,0 55%,0 100%,40% 100%,40% 38%,22% 38%,22% 100%,62% 100%,62% 20%,44% 20%,44% 100%,84% 100%,84% 2%,66% 2%,66% 100%); }
.ico-wifi { width: 15px; height: 11px; clip-path: polygon(50% 100%,0 38%,12% 26%,50% 64%,88% 26%,100% 38%); border-radius: 2px; }
.ico-battery { width: 22px; height: 11px; border-radius: 3px; }

/* ---- Reader (light) ---- */
.reader {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 8px 20px 0;
  font-family: var(--font-serif);
  color: #1a1a1a;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}
.reader__chapter { font-size: 22px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }
.reader__heading { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.reader__verse { font-size: 12.5px; line-height: 1.62; margin-bottom: 10px; color: #2a2a2a; }
.reader__verse sup { font-size: 8px; color: #9a9a9a; padding: 0 1px; font-family: var(--font-body); }
.reader__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 26px 16px;
  color: #6b7280;
}
.reader__dots { font-size: 18px; letter-spacing: 1px; line-height: 1; }
.reader__tools { display: inline-flex; gap: 16px; }
.reader__tools i { width: 15px; height: 15px; display: inline-block; background: currentColor; }
.ico-clock { -webkit-mask: radial-gradient(circle at 50% 50%, transparent 4.5px, #000 5px 6.5px, transparent 7px); mask: radial-gradient(circle at 50% 50%, transparent 4.5px, #000 5px 6.5px, transparent 7px); position: relative; }
.ico-search { border-radius: 50%; -webkit-mask: radial-gradient(circle at 42% 42%, transparent 3.5px, #000 4px 5.5px, transparent 6px); mask: radial-gradient(circle at 42% 42%, transparent 3.5px, #000 4px 5.5px, transparent 6px); }

/* ---- Books (dark) ---- */
.books { flex: 1 1 auto; overflow: hidden; padding: 6px 18px 0; color: #f2f2f5; font-family: var(--font-body);
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 88%, transparent 100%); }
.books__head { display: flex; align-items: center; justify-content: center; position: relative; padding: 6px 0 14px; }
.books__title { font-size: 15px; font-weight: 600; }
.books__close { position: absolute; right: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #2c2c2e; color: #c7c7cc; font-size: 15px; line-height: 22px; text-align: center; }
.books__item { font-size: 14px; padding: 11px 2px; border-bottom: 1px solid #1f1f22; }
.books__item--muted { color: #8e8e93; }
.books__item--active { font-weight: 600; }
.books__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; padding: 12px 0 6px; }
.chip {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #1c1c1e;
  font-size: 13px;
  font-weight: 500;
  color: #e6e6ea;
}
.chip--on { background: #e8e8ea; color: #111; }
.books__section { font-size: 11px; color: #8e8e93; padding: 14px 0 4px; }

/* ======================================================================
   Responsive — stacked layout (from Figma responsive frame, 412px)
   ====================================================================== */
@media (max-width: 900px) {
  .landing {
    flex-direction: column;
    min-height: auto;
  }
  .hero, .showcase { flex: none; width: 100%; }

  .hero { padding: 16px 16px 0; }
  .hero__card {
    margin: 0;
    min-height: 560px;
    border-radius: 40px;
    align-self: auto;
  }
  .hero__content {
    max-width: none;
    padding: 0 32px;
    gap: 28px;
    justify-content: flex-end;
    padding-bottom: 44px;
    min-height: 560px;
  }
  .brand__mark { width: 44px; height: 44px; }
  .brand__name { font-size: 24px; }
  .hero__headline { font-size: 28px; line-height: 1.35; max-width: 18ch; }
  .btn { height: 52px; font-size: 17px; }

  .showcase { padding: 32px 16px 28px; gap: 24px; }
  /* Stack vertically: phone + caption, then horizontal dots underneath */
  .carousel { flex-direction: column; gap: 20px; align-items: center; justify-content: center; }
  .carousel__viewport { height: 740px; width: 100%; max-width: 100%; flex: 0 0 auto; }
  /* Slides glide left ↔ right on mobile, matching the swipe gesture */
  .carousel__track { flex-direction: row; }
  .carousel__dots { flex-direction: row; }
  .slide { gap: 32px; }
}

@media (max-width: 420px) {
  .hero__card { min-height: 500px; }
  .hero__content { min-height: 500px; padding: 0 28px 40px; }
  .caption__title { font-size: 28px; }
}

/* Honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .carousel__track { transition: none; }
  .btn { transition: none; }
  .slide.is-active .device,
  .slide.is-active .caption { animation: none; }
}

/* ======================================================================
   Legal pages (Terms & Privacy) — centred reading column
   ====================================================================== */
.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 100px) 24px 96px;
}
.legal__header { text-align: left; margin-bottom: 40px; }
.legal__mark {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 0 24px;
  color: var(--color-red);
}
.legal__mark svg,
.legal__mark img { width: 100%; height: 100%; object-fit: contain; }
.legal__title {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}
.legal__updated {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}
.legal__intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
}
.legal__section { margin-bottom: 32px; }
.legal__section h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}
.legal__section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 18px 0 6px;
}
.legal__section p,
.legal__section li {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--color-text-secondary);
}
.legal__section p { margin-bottom: 12px; }
.legal__section ul { padding-left: 22px; margin: 0 0 12px; list-style: disc; }
.legal__section li { margin-bottom: 6px; }
.legal__section a { color: var(--color-blue-600); text-decoration: underline; }
.legal__note {
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-tertiary);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 12px;
}
.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--color-text-tertiary);
}
.legal__back:hover { color: var(--color-text-primary); }
.legal__footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
}
.legal__footer a:hover { color: var(--color-text-primary); }
