/* ============================================================
   rapporter.app — stylesheet
   Design tokens extracted directly from the iOS/macOS app.
   ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
  /* Intelligence gradient — app's signature stroke */
  --grad-rose:   #FF5C9E;
  --grad-orange: #FF8C4D;
  --grad-gold:   #FFC74D;
  --grad-violet: #9966FF;
  --grad-sky:    #59A6FF;

  /* Tab capsule gradient */
  --tab-purple: #9E80FF;
  --tab-mauve:  #DB75DB;
  --tab-coral:  #FF8C99;

  /* Royal blue chip gradient */
  --chip-deep:  #3A5ED9;
  --chip-mid:   #4D85F5;

  /* Blob colors */
  --blob-1: #FF5C9E;
  --blob-2: #9966FF;
  --blob-3: #59A6FF;
  --blob-4: #FF8C4D;

  /* Shape */
  --radius-card:    14px;
  --radius-bar:     18px;
  --radius-pill:    9999px;
  --radius-section: 20px;

  /* Spacing */
  --space-section: 100px;
  --space-content: 24px;
  --max-width: 1100px;

  /* Light mode defaults */
  --bg:              #F5F5F7;
  --bg-surface:      rgba(255, 255, 255, 0.82);
  --bg-surface-alt:  rgba(59, 94, 217, 0.04);
  --text-primary:    rgba(0, 0, 0, 0.88);
  --text-secondary:  rgba(0, 0, 0, 0.46);
  --border:          rgba(0, 0, 0, 0.08);
  --border-strong:   rgba(0, 0, 0, 0.14);
  --shadow:          rgba(0, 0, 0, 0.08);
  --blob-opacity:    0.22;
  --chip-bg:         linear-gradient(135deg, var(--chip-deep), var(--chip-mid));
  --chip-text:       #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #141414;
    --bg-surface:     rgba(255, 255, 255, 0.06);
    --bg-surface-alt: rgba(89, 166, 255, 0.05);
    --text-primary:   rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.52);
    --border:         rgba(255, 255, 255, 0.10);
    --border-strong:  rgba(255, 255, 255, 0.18);
    --shadow:         rgba(0, 0, 0, 0.40);
    --blob-opacity:   0.42;
    --chip-bg:        rgba(255, 255, 255, 0.08);
    --chip-text:      rgba(255, 255, 255, 0.92);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Blob background ────────────────────────────────────────── */
.blob-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: var(--blob-opacity);
  filter: blur(90px);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.blob-1 { width: 60vw; height: 60vw; background: var(--blob-1); animation: drift-1 21s ease-in-out infinite alternate; top: -10%;   left: 20%; }
.blob-2 { width: 55vw; height: 55vw; background: var(--blob-2); animation: drift-2 26s ease-in-out infinite alternate; top: 30%;    left: -5%; }
.blob-3 { width: 50vw; height: 50vw; background: var(--blob-3); animation: drift-3 18s ease-in-out infinite alternate; top: 55%;    right: 0;  }
.blob-4 { width: 65vw; height: 65vw; background: var(--blob-4); animation: drift-4 31s ease-in-out infinite alternate; bottom: -15%; left: 40%; }

@keyframes drift-1 { from { transform: translate(0,    0);    } to { transform: translate(8vw,   12vh);  } }
@keyframes drift-2 { from { transform: translate(0,    0);    } to { transform: translate(-6vw, -10vh);  } }
@keyframes drift-3 { from { transform: translate(0,    0);    } to { transform: translate(10vw,  8vh);   } }
@keyframes drift-4 { from { transform: translate(0,    0);    } to { transform: translate(-8vw,  6vh);   } }

@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none;
    filter: blur(120px);
  }
}

/* ── Intelligence gradient utilities ───────────────────────── */
.intelligence-gradient {
  background: linear-gradient(
    90deg,
    var(--grad-rose),
    var(--grad-orange),
    var(--grad-gold),
    var(--grad-violet),
    var(--grad-sky)
  );
}

.gradient-text {
  background: linear-gradient(90deg, var(--grad-rose), var(--grad-violet), var(--grad-sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout helpers ─────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-content);
}

/* ── Scroll-reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px var(--space-content) 60px;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero__icon {
  width: 120px;
  height: 120px;
  border-radius: 26.8%;        /* Apple squircle approximation */
  box-shadow: 0 24px 60px rgba(153, 102, 255, 0.30),
              0 8px  20px rgba(0, 0, 0, 0.18);
}

.hero__name {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
}

.hero__tagline {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.hero__sub {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 360px;
}

/* App Store badge */
.hero__badge {
  display: inline-block;
  transition: opacity 0.2s, transform 0.2s;
}
.hero__badge:hover { opacity: 0.80; transform: scale(0.97); }
.hero__badge img { height: 60px; width: auto; }

/* Platform pills — mirrors the app's chip buttons */
.hero__platforms {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: -4px;
}

.platform-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--chip-text);
  background: var(--chip-bg);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════════════════
   FEATURE STRIP
   ════════════════════════════════════════════════════════════ */
.features {
  padding: var(--space-section) var(--space-content);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  /* Tinted background matches app's Color.accentColor.opacity(0.15) feel */
  background: rgba(153, 102, 255, 0.12);
}

.feature-card__headline {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.feature-card__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   SCREENSHOTS
   ════════════════════════════════════════════════════════════ */
.screenshots {
  padding: var(--space-section) 0;
  overflow: hidden;
}

.screenshots__label {
  text-align: center;
  padding: 0 var(--space-content);
  margin-bottom: 40px;
}

.screenshots__label h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.screenshots__label p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.screenshots__scroll {
  display: flex;
  gap: 20px;
  padding: 0 var(--space-content);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screenshots__scroll::-webkit-scrollbar { display: none; }

.screenshot-frame {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 280px;
}

.screenshot-frame__device {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 44px;
  overflow: hidden;
  box-shadow: 0 24px 60px var(--shadow),
              0 0 0 1px var(--border-strong);
  aspect-ratio: 9/19.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder shown until real screenshots exist */
.screenshot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(
    160deg,
    rgba(153, 102, 255, 0.15) 0%,
    rgba(89, 166, 255, 0.10) 50%,
    rgba(255, 92, 158, 0.10) 100%
  );
}

.screenshot-placeholder__icon {
  font-size: 40px;
  opacity: 0.5;
}

.screenshot-placeholder__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 16px;
}

.screenshot-frame__caption {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   PRIVACY BLOCK
   ════════════════════════════════════════════════════════════ */
.privacy {
  padding: var(--space-section) var(--space-content);
  background: var(--bg-surface-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-top: 10px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.privacy__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

/* Mirrors PrivacyDataView.infoRow() exactly */
.privacy-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.privacy-row__icon {
  font-size: 26px;
  flex-shrink: 0;
  margin-top: 2px;
  /* Simulate hierarchical rendering with gradient */
  background: linear-gradient(135deg, var(--tab-purple), var(--tab-mauve));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.privacy-row__text h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.privacy-row__text p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   HOW IT WORKS
   ════════════════════════════════════════════════════════════ */
.how-it-works {
  padding: var(--space-section) var(--space-content);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Connecting line between steps */
.steps::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 44px;
  bottom: 44px;
  width: 1px;
  background: linear-gradient(to bottom, var(--grad-violet), var(--grad-sky));
  opacity: 0.30;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 0;
}

.step__number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--tab-purple), var(--tab-mauve), var(--tab-coral));
  box-shadow: 0 4px 16px rgba(158, 128, 255, 0.40);
  position: relative;
  z-index: 1;
}

.step__content h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-top: 10px;
}

.step__content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   BOTTOM CTA
   ════════════════════════════════════════════════════════════ */
.cta-bottom {
  position: relative;
  padding: var(--space-section) var(--space-content);
  text-align: center;
  overflow: hidden;
}

.cta-bottom__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cta-bottom__icon {
  width: 80px;
  height: 80px;
  border-radius: 18%;
  box-shadow: 0 12px 40px rgba(153, 102, 255, 0.28);
}

.cta-bottom h2 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta-bottom p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 400px;
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 36px var(--space-content);
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer__links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--text-primary); }

.footer__copy {
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.65;
}

/* ════════════════════════════════════════════════════════════
   SECTION DIVIDERS
   ════════════════════════════════════════════════════════════ */
.section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--grad-violet), var(--grad-sky));
  border-radius: var(--radius-pill);
  margin: 0 auto 36px;
  opacity: 0.50;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --space-section: 72px;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .screenshot-frame {
    width: 240px;
  }

  .steps::before {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* On desktop: center the screenshots without scroll when 3 fit */
@media (min-width: 920px) {
  .screenshots__scroll {
    justify-content: center;
    overflow-x: visible;
  }
}
