/* ScoreT — shared styles
   Brand colors come from the app icon (archive/img/ScoreT-AppIcon-1024.png):
   home blue #1976d2, navy #0d1b4c.
   Change --accent (and --accent-ink) to re-theme the whole site. */

:root {
  --accent: #1976d2;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);

  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: #e5e5ea;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.08);

  --radius: 16px;
  --max-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Lighter blue so links and buttons stay legible on black. */
    --accent: #5aa3eb;
    --accent-ink: #0d1b4c;

    --bg: #000000;
    --bg-alt: #111113;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --border: #2c2c2e;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.5);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }

.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Placeholder content still waiting on details — search for "todo" to find them all. */
.todo { background: #fff3a3; color: #5c4b00; border-radius: 4px; padding: 0 4px; }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.site-nav { display: flex; gap: 24px; }
.site-nav a { color: var(--text-muted); font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

@media (max-width: 480px) {
  .site-nav { gap: 16px; }
  .site-nav .nav-optional { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }

.app-store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 600;
}
.app-store-badge:hover { text-decoration: none; }
.app-store-badge small { display: block; font-size: 0.7rem; font-weight: 400; opacity: 0.8; line-height: 1; }
.app-store-badge span { line-height: 1.15; }
.app-store-badge[aria-disabled="true"] { cursor: default; opacity: 0.85; }

/* ---------- Hero ---------- */

.hero { padding: 80px 0 40px; text-align: center; }
.hero-icon { width: 112px; height: 112px; border-radius: 26px; margin: 0 auto 28px; box-shadow: var(--shadow); }
.hero .tagline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Carousel ---------- */

/* The selected slide sits in the middle at full size; its neighbours shrink and fade.
   --slide-w is the unscaled slide width, --active-scale how much the selected one grows. */
.carousel {
  --slide-w: 260px;
  --active-scale: 1.12;
  --track-pad-y: 56px;
  position: relative;
}

.carousel-track {
  display: flex; align-items: center; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  /* Vertical room so the enlarged slide isn't clipped by the scroll container. */
  padding: var(--track-pad-y) max(20px, calc(50% - var(--slide-w) / 2));
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }

.carousel-slide {
  /* snap-stop: a swipe or trackpad flick moves one slide instead of skipping several. */
  flex: 0 0 var(--slide-w); scroll-snap-align: center; scroll-snap-stop: always; margin: 0; text-align: center;
  transform: scale(0.86); opacity: 0.45;
  transition: transform 0.35s ease, opacity 0.35s ease;
  cursor: pointer;
}
.carousel-slide.is-active { transform: scale(var(--active-scale)); opacity: 1; cursor: default; }
@media (prefers-reduced-motion: reduce) { .carousel-slide { transition: none; } }
.carousel-slide figcaption { margin-top: 16px; font-weight: 600; }
.carousel-slide figcaption span { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.9rem; }

/* iPhone-style frame around each screenshot (screenshots are ~9:19.5) */
.phone {
  position: relative; aspect-ratio: 9 / 19.5;
  border-radius: 40px; padding: 10px;
  background: #1d1d1f; box-shadow: var(--shadow);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 31px; }

/* Apple Watch frame; its slide is vertically centred in the track, with the caption right below. */
.watch-slot { display: flex; justify-content: center; }
.watch {
  width: 82%; aspect-ratio: 374 / 446;
  border-radius: 54px; padding: 12px;
  background: #1d1d1f; box-shadow: var(--shadow);
}
.watch img { width: 100%; height: 100%; object-fit: cover; border-radius: 42px; }

/* ---------- iPhone + Apple Watch ---------- */

.companion-grid { display: grid; gap: 48px; align-items: center; grid-template-columns: 1fr 1fr; }
.companion-copy p { color: var(--text-muted); font-size: 1.1rem; max-width: 460px; }
.companion-devices { display: flex; align-items: flex-end; justify-content: center; }
.companion-devices img { filter: drop-shadow(0 20px 30px rgb(0 0 0 / 0.15)); }
.device-iphone { width: min(300px, 62%); }
.device-watch { width: min(180px, 38%); margin-left: -36px; margin-bottom: 40px; }

@media (max-width: 760px) {
  .companion-grid { grid-template-columns: 1fr; text-align: center; }
  .companion-copy p { margin-inline: auto; }
}

/* Arrows flank the selected image, vertically centred on its (enlarged) screen. */
.carousel-btn {
  position: absolute; z-index: 2;
  top: calc(var(--track-pad-y) + var(--slide-w) * 19.5 / 9 / 2);
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0 0 3px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.carousel-btn:hover:not(:disabled) { background: var(--bg-alt); }
.carousel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-btn-prev { left: max(8px, calc(50% - var(--slide-w) * var(--active-scale) / 2 - 72px)); }
.carousel-btn-next { right: max(8px, calc(50% - var(--slide-w) * var(--active-scale) / 2 - 72px)); }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.carousel-dot {
  width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0;
  background: var(--border); cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.carousel-dot[aria-current="true"] { background: var(--accent); transform: scale(1.25); }

/* ---------- Features ---------- */

.features { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature p { color: var(--text-muted); margin: 0; }

/* ---------- Donate / CTA ---------- */

.cta { text-align: center; }
.cta p { color: var(--text-muted); max-width: 560px; margin: 0 auto 28px; font-size: 1.1rem; }

/* ---------- Prose pages (privacy, support) ---------- */

.page-header { padding: 64px 0 24px; }
.page-header p { color: var(--text-muted); }
.prose { padding-bottom: 80px; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-alt); border-radius: var(--radius); padding: 28px; margin: 8px 0 24px;
}
.contact-card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.contact-card p { margin: 0; color: var(--text-muted); }

.faq details { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--text-muted); }

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

.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-muted); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
