/* Shared theme for Color Pop's site pages (colorpop.html, privacy.html, support.html).
   Colors and the balloon shape are pulled directly from the app: PaintColor.swift's
   red/orange/yellow/green/blue/purple values and BalloonIcon.swift's Canvas geometry.

   Deliberately light/playful always, no dark-mode variant: the brand IS a bright sky,
   so letting the OS theme flip it dark fights the whole point. */

@font-face {
  font-family: "Baloo 2";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/baloo2-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Baloo 2";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("fonts/baloo2-latin.woff2") format("woff2");
}

:root {
  --sky-top: #4f8fc4;
  --sky-mid: #6fb2dd;
  --sky-bottom: #87ceeb;
  --sky-pale: #eaf6fc;

  --accent: #215ede;
  --accent-dark: #1a4bb8;
  --accent-tint: #eaf1fd;
  --green: #2eb838;
  --green-dark: #238a2a;

  --balloon-red: #ed2e2e;
  --balloon-orange: #fa8c0d;
  --balloon-yellow: #fad11a;
  --balloon-green: #2eb838;
  --balloon-blue: #215ede;
  --balloon-purple: #9426bf;

  --ink: #1a1a1a;
  --ink-soft: #55555c;
  --paper: #ffffff;
  --paper-soft: #f4f8fc;
  --border: #e2e8f1;
  --shadow: 0 10px 30px rgba(20, 40, 70, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 22%, var(--sky-bottom) 42%, var(--sky-pale) 78%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  line-height: 1.7;
}

.cp-wordmark {
  font-family: "Baloo 2", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* ---------- Hero (colorpop.html) ---------- */

.cp-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 24px 40px;
  text-align: center;
}

.cp-hero-content { position: relative; z-index: 2; }

.cp-icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: block;
  margin: 0 auto 18px;
}

.cp-hero h1 {
  margin: 0 0 8px;
  font-size: 3rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 40, 90, 0.35), 0 6px 18px rgba(0, 30, 70, 0.25);
}

.cp-hero p.cp-tagline {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 40, 90, 0.3);
}

/* ---------- Page row (privacy.html, support.html) ----------
   "Back" button and the white content card sit side by side (an hstack),
   the button pinned toward the left edge and the card centered in the
   remaining space — not stacked on top of one another. No separate colored
   banner behind either: that meant a second gradient layered over the
   body's, and the two never lined up once page length varied (privacy/
   support are much taller than colorpop.html). Both just sit directly on
   the one continuous body gradient. */

.cp-page-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.cp-topbar {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}

@media (max-width: 760px) {
  .cp-page-row { flex-direction: column; align-items: center; }
}

/* ---------- Balloon / confetti decoration ---------- */

.cp-balloon {
  position: absolute;
  z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 30, 70, 0.18));
  animation: cp-float 6s ease-in-out infinite;
}

.cp-confetti {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  opacity: 0.85;
}

@keyframes cp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .cp-balloon { animation: none; }
}

/* ---------- Description card ----------
   Styled after the app's own results overlay: a solid-color header bar
   ("Level 13") sitting on top of a white card. */

.cp-blurb {
  max-width: 640px;
  margin: 0 auto 40px;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.cp-blurb-header {
  background: var(--accent);
  padding: 16px 28px;
  text-align: center;
}

.cp-blurb-header h2 {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
}

.cp-blurb-body { padding: 26px 30px 30px; }

.cp-blurb-body p { margin: 0 0 16px; font-size: 1.02rem; }

.cp-blurb-body h3 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  margin: 22px 0 8px;
  color: var(--accent-dark);
}

.cp-blurb-body ul { margin: 0 0 4px; padding-left: 22px; }
.cp-blurb-body li { margin-bottom: 6px; }
.cp-blurb-body li::marker { color: var(--balloon-orange); }

.cp-blurb-body p.cp-closing {
  margin-top: 20px;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Screenshot showcase ----------
   Each shot sits on its own white card so it doesn't melt into the sky
   background behind it (the screenshots are themselves sky-blue). */

.cp-showcase {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px clamp(24px, 8vw, 120px) 28px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: clamp(24px, 8vw, 120px);
  -webkit-overflow-scrolling: touch;

  /* Fade the two edges so cut-off cards read as "more to scroll", not a layout bug. */
  mask-image: linear-gradient(
    to right, transparent, black 48px, black calc(100% - 48px), transparent
  );
  -webkit-mask-image: linear-gradient(
    to right, transparent, black 48px, black calc(100% - 48px), transparent
  );

  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.cp-showcase::-webkit-scrollbar { height: 8px; }
.cp-showcase::-webkit-scrollbar-track { background: transparent; }
.cp-showcase::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

.cp-shot {
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--paper);
  padding: 10px;
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(15, 35, 65, 0.28);
}

.cp-shot img {
  height: 440px;
  width: auto;
  max-width: none;
  border-radius: 14px;
  display: block;
}

@media (max-width: 640px) {
  .cp-shot img { height: 340px; }
}

/* ---------- Buttons ----------
   Matches ResultsOverlayView+ActionButtons.swift exactly: solid fill,
   RoundedRectangle (not a pill), and a flat hard-edged offset shadow
   (SwiftUI's `.shadow(radius: 0, y: 4)`) instead of a blurred bevel. */

.cp-links {
  max-width: 420px;
  margin: 44px auto 8px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.cp-btn-candy {
  display: block;
  width: 100%;
  text-align: center;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border: none;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.cp-btn-candy:hover { color: #fff; }

.cp-btn-primary {
  padding: 15px 20px;
  border-radius: 16px;
  font-size: 1.15rem;
  background: #34c759;
  box-shadow: 0 4px 0 0 #006100;
  margin-bottom: 12px;
}

.cp-btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 0 #006100; }

.cp-btn-row { display: flex; gap: 10px; }

.cp-btn-secondary {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  background: var(--accent);
  box-shadow: 0 3px 0 0 #0f338c;
  flex: 1;
}

.cp-btn-secondary:active { transform: translateY(3px); box-shadow: 0 0 0 0 #0f338c; }

/* Standalone button dropped into a paragraph/content flow, not a full-width action row. */
.cp-btn-inline { display: inline-block; width: auto; }

/* ---------- Content (privacy.html, support.html) ---------- */

.cp-content {
  flex: 1 1 auto;
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 0 24px;
  position: relative;
  z-index: 3;
}

.cp-card {
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 28px 8px;
}

h1.cp-page-title {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  margin: 0 0 4px;
}

.cp-rainbow-rule {
  height: 5px;
  width: 64px;
  border-radius: 3px;
  margin: 0 0 20px;
  background: linear-gradient(
    90deg,
    var(--balloon-red), var(--balloon-orange), var(--balloon-yellow),
    var(--balloon-green), var(--balloon-blue), var(--balloon-purple)
  );
}

.cp-meta { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 30px; }

h2 { font-size: 1.1rem; margin-top: 34px; }
p, li { font-size: 0.97rem; color: var(--ink); }
ul { padding-left: 20px; }

li::marker { color: var(--accent); }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 700; }

.cp-callout {
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
}

/* ---------- Footer ---------- */

.cp-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 24px 24px 48px;
  position: relative;
  z-index: 2;
}

.cp-footer a { color: var(--ink-soft); }
