:root {
  --bg: #fafbfd;
  --bg-alt: #f5f7fa;
  --text: #1a1a1a;
  --text-soft: #4a5568;
  --accent: #0F2B74;
  --accent-light: #1e4d99;
  --accent-soft: #e8eef9;
  --max-width: 720px;

  /* Easings used across motion. The "spring" curve gives a gentle
     overshoot for tile pop-ins; the "smooth" curve is the standard
     scroll-in fade-up. */
  --ease-spring: cubic-bezier(0.2, 0.85, 0.4, 1.05);
  --ease-smooth: cubic-bezier(0.2, 0.6, 0.4, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  line-height: 1.55;
  padding: 0 1.25rem;
  /* Multi-stop radial mesh in the brand color. Subtle on purpose —
     decorative, not noisy. `fixed` attachment so the mesh stays put
     as the user scrolls, giving the page a sense of depth without
     parallax math. */
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(15, 43, 116, 0.10), transparent 65%),
    radial-gradient(circle 700px at 5% 30%, rgba(30, 77, 153, 0.07), transparent 70%),
    radial-gradient(circle 800px at 95% 70%, rgba(15, 43, 116, 0.06), transparent 70%),
    linear-gradient(180deg, #fafbfd 0%, #f3f6fb 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
}

/* HERO (landing) */
.hero {
  text-align: center;
  padding: 5rem 0 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(15, 43, 116, 0.18);
  margin-bottom: 1.5rem;
  /* Entrance + a gentle ambient glow that breathes once per ~5 seconds.
     The breathing pulse runs forever but is so soft it's only noticed
     if the visitor is staring at the icon — it adds a touch of life
     without being a distraction while reading. */
  animation:
    scaleIn 0.7s var(--ease-spring) both,
    iconBreath 5s ease-in-out 1.5s infinite;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  /* Brand gradient on the title — same accent palette, just lifted
     a notch so the headline reads as the "richest" element. */
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 70%, #2c63b4 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback for very old browsers */
  animation:
    fadeInUp 0.6s var(--ease-smooth) 0.15s both,
    gradientShift 12s ease-in-out infinite;
}

.tagline {
  font-size: 1.25rem;
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto;
  animation: fadeInUp 0.5s var(--ease-smooth) 0.45s both;
}

/* ─────── Motion keyframes (used across the site) ─────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes iconBreath {
  0%, 100% { box-shadow: 0 8px 32px rgba(15, 43, 116, 0.18); }
  50%      { box-shadow: 0 14px 48px rgba(15, 43, 116, 0.30); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* Scroll-in utility — apply `class="scroll-in"` to any element to
   make it fade-up the first time it enters the viewport. The tiny
   inline observer in index.html toggles `.visible` per element.
   Uses the modern `translate` property (not `transform`) so the
   animation composes with any `transform` already on the element
   (e.g. the gallery's `translateX(-50%)` recentering). Supported in
   all evergreen browsers; falls back gracefully where unsupported. */
.scroll-in {
  opacity: 0;
  translate: 0 24px;
  transition:
    opacity 0.7s var(--ease-smooth),
    translate 0.7s var(--ease-smooth);
}
.scroll-in.visible {
  opacity: 1;
  translate: 0 0;
}

/* MAIN */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 4rem;
}

section { margin: 3rem 0; }

.intro p {
  font-size: 1.125rem;
  color: var(--text-soft);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 1rem;
  border-bottom: 1px solid #ececec;
  border-radius: 10px;
  transition: background 0.25s var(--ease-smooth),
              transform 0.25s var(--ease-smooth);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li:hover {
  background: rgba(232, 238, 249, 0.55);
  transform: translateX(4px);
}

.feature-list li strong {
  color: var(--accent);
}

main ul:not(.feature-list) li {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  position: relative;
  list-style: none;
}

main ul:not(.feature-list) li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* GALLERY (screenshots)
 *
 * The gallery breaks out of the 720px <main> column so the grid can
 * fan out to ~1100px on desktop. The centering pattern is the standard
 * "viewport-wide break-out" — position relative, shifted half a parent
 * width left, then transformed back half a viewport-width to recenter
 * on the page. Resetting `max-width` ensures the inner grid stays
 * within the cap on huge screens.
 */
.gallery {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 100vw - 2.5rem);
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.gallery h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

.gallery-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  transition:
    transform 0.35s var(--ease-spring),
    filter 0.35s var(--ease-smooth);
}
.gallery-tile:hover {
  transform: translateY(-6px);
}
.gallery-tile:hover img {
  box-shadow: 0 22px 48px rgba(15, 43, 116, 0.28);
}

.gallery-tile img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(15, 43, 116, 0.16);
  background: #000;
  /* Default = iPhone portrait. Stable aspect so layout doesn't jump as
     images stream in; `object-fit: contain` is the safer default for
     marketing screenshots so we never crop content even if the source
     resolution doesn't match the assumed ratio. */
  aspect-ratio: 1206 / 2622;
  object-fit: contain;
  display: block;
  transition: box-shadow 0.35s var(--ease-smooth);
}

/* Watch tile has a different aspect ratio and gets a tighter max-width
   so it sits visually balanced alongside the taller iPhone tiles. */
.gallery-tile.is-watch img {
  aspect-ratio: 422 / 514;
  max-width: 70%;
  border-radius: 28px;
}

/* Landscape iPhone shots (e.g. the Live courtside view rendered
   sideways at the side of the court). Spans 2 grid columns on
   desktop so the image stays large enough to read, falls back to
   carousel-width on mobile via the flex media query below. */
.gallery-tile.is-landscape {
  grid-column: span 2;
}
.gallery-tile.is-landscape img {
  aspect-ratio: 2868 / 1320;
  border-radius: 16px;
  max-width: 100%;
}

.gallery-caption {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.4;
  max-width: 240px;
}

@media (max-width: 600px) {
  .gallery {
    /* On phones the desktop break-out reverts to a simple full-bleed
       strip — disable the transform-centering trick and let the flex
       grid below handle its own horizontal scroll. */
    position: static;
    left: auto;
    transform: none;
    width: auto;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding: 0;
  }
  .gallery h2 { margin: 0 1.25rem 1rem; }
  .gallery-grid {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0 1.25rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .gallery-tile {
    flex: 0 0 70%;
    scroll-snap-align: center;
  }
  /* Landscape tile is wider than tall — give it more carousel
     room so it doesn't read as a tiny thumbnail. */
  .gallery-tile.is-landscape { flex: 0 0 90%; }
  .gallery-tile.is-watch img { max-width: 90%; }
}

.privacy-highlight {
  background: linear-gradient(135deg, var(--accent-soft) 0%, #f1f6fc 100%);
  padding: 2rem;
  border-radius: 16px;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
  /* Soft brand-color ring around the card, achieved with two shadows
     (inner accent + outer ambient) rather than a hard border. */
  box-shadow:
    inset 0 0 0 1px rgba(15, 43, 116, 0.12),
    0 8px 32px rgba(15, 43, 116, 0.08);
}

.privacy-highlight h2 {
  margin-top: 0;
}

/* Decorative shield glyph in the corner. SVG-via-CSS, low opacity. */
.privacy-highlight::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(15, 43, 116, 0.10) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.cta {
  text-align: center;
  padding: 2rem 0 3rem;
}

.coming-soon {
  font-size: 1.125rem;
  color: var(--accent);
  padding: 0.85rem 1.75rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-soft) 100%);
  border-radius: 999px;
  display: inline-block;
  font-weight: 500;
  box-shadow:
    inset 0 0 0 1px rgba(15, 43, 116, 0.12),
    0 6px 20px rgba(15, 43, 116, 0.10);
  transition:
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-smooth);
}
.coming-soon:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    inset 0 0 0 1px rgba(15, 43, 116, 0.20),
    0 12px 28px rgba(15, 43, 116, 0.18);
}
.coming-soon em {
  color: var(--text-soft);
  font-style: normal;
  font-size: 0.9em;
  margin-left: 0.25rem;
}

/* LEGAL pages */
.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 2rem;
  animation: fadeInUp 0.5s var(--ease-smooth) both;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.6rem 0.25rem 0.4rem;
  border-radius: 999px;
  background: rgba(15, 43, 116, 0.06);
  transition: background 0.25s var(--ease-smooth),
              transform 0.25s var(--ease-smooth);
}

.back-link:hover {
  background: rgba(15, 43, 116, 0.12);
  transform: translateX(-2px);
  text-decoration: none;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.effective-date {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.legal {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 4rem;
  animation: fadeInUp 0.6s var(--ease-smooth) 0.1s both;
}

.legal h2 {
  margin-top: 2.5rem;
}

.legal h3 {
  color: var(--accent);
}

.legal p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* FOOTER */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0;
  border-top: 1px solid rgba(15, 43, 116, 0.12);
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

footer nav {
  margin-top: 0.75rem;
}

footer nav a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s var(--ease-smooth);
}

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

.sep {
  color: #cbd5e0;
  margin: 0 0.5rem;
}

/* ─────── Reduced-motion override ─────── *
 * Respect the user's OS-level Reduce Motion preference. Animations
 * become near-instant; the scroll-in fade-up resolves to its visible
 * state immediately so content isn't hidden behind disabled motion.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-in {
    opacity: 1 !important;
    translate: 0 0 !important;
    transform: none !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2.25rem; }
  .tagline { font-size: 1.05rem; }
  .app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .page-header h1 { font-size: 1.75rem; }
}
