/* ==========================================================================
   BaseballPips — shared stylesheet
   Glass card system ported from alexanderwin37.github.io
   ========================================================================== */

:root {
  /* Glass recipe */
  --glass-tint: 16, 35, 73;
  --glass-bg: rgba(var(--glass-tint), 0.08);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-blur: 10px;
  --rule: rgba(255, 255, 255, 0.14);

  /* Text hierarchy */
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.78);
  --faint: rgba(255, 255, 255, 0.58);

  /* Shape */
  --radius-card: 2rem;
  --radius-pill: 9999px;

  /* Reading measure */
  --measure: 32rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background: #102349 linear-gradient(to bottom, #6299a4, #102349) fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding:
    calc(4rem + env(safe-area-inset-top))
    calc(1.5rem + env(safe-area-inset-right))
    calc(4rem + env(safe-area-inset-bottom))
    calc(1.5rem + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

/* Long-form document pages get a wider measure than the 32rem default */
.page--wide {
  --measure: 40rem;
}

/* Tighter grouping inside a .page cell */
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

hr.rule {
  width: 100%;
  height: 1px;
  margin: 1rem 0;
  border: 0;
  background: var(--rule);
}


/* --------------------------------------------------------------------------
   Glass
   -------------------------------------------------------------------------- */

.glass {
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.20);
}


/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.card {
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.card__heading {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__meta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--faint);
}


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

.hero__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero__tagline {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Capsule (pill-shaped link button)
   -------------------------------------------------------------------------- */

.capsule {
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.75rem;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.capsule:hover,
.capsule:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.40);
  transform: translateY(-1px);
}

.capsule--cta {
  align-self: flex-start;
  margin-top: 1.25rem;
}

.capsule__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--muted);
}

.capsule__label {
  flex: 1 1 auto;
  font-weight: 700;
}

.capsule__chevron {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--faint);
}



/* --------------------------------------------------------------------------
   Screenshot gallery
   -------------------------------------------------------------------------- */

.screens {
  --screens-pad: 0.75rem;
  border-radius: var(--radius-card);
  padding: var(--screens-pad);
}

/* Tiles are sized so the third is partly visible — the scroll affordance. */
.screens__row {
  display: flex;
  gap: 0.75rem;
  border-radius: calc(var(--radius-card) - var(--screens-pad));
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.screens__row::-webkit-scrollbar {
  display: none;
}

.screen {
  flex: none;
  display: block;
  width: 12rem;
  scroll-snap-align: start;
  border-radius: calc(var(--radius-card) - var(--screens-pad));
  cursor: zoom-in;
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-card) - var(--screens-pad));
}

/* Segmented pill. Radii are concentric by construction: each segment is a
   true pill at --seg-h/2, and the shell adds exactly its padding + border on
   top of that, so both arcs share a centre. */
.screens__nav {
  --seg-h: 2.125rem;
  --seg-pad: 0.1875rem;

  display: flex;
  gap: var(--seg-pad);
  width: fit-content;
  margin-top: 0.625rem;
  padding: var(--seg-pad);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--seg-h) / 2 + var(--seg-pad) + 1px);
  background-color: transparent;
}

.screens__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: var(--seg-h);
  padding: 0;
  border: 0;
  border-radius: calc(var(--seg-h) / 2);
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease;
}

.screens__arrow:hover:not(:disabled),
.screens__arrow:focus-visible {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.16);
}

/* Dimmed rather than hidden, so the control row never changes height */
.screens__arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.screens__arrow svg {
  width: 1rem;
  height: 1rem;
}


/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 1.5rem;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.lightbox:not([open]) {
  display: none;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: #000;
}

.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.40);
}

.lightbox__close svg {
  width: 1.125rem;
  height: 1.125rem;
}


/* --------------------------------------------------------------------------
   App Store badge
   -------------------------------------------------------------------------- */

/* line-height: 0 collapses the inline text box the anchor would otherwise
   generate around the image, which is what produced an I-beam cursor. */
.appstore {
  display: block;
  line-height: 0;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.appstore:hover,
.appstore:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.40);
}

.appstore img {
  display: block;
  height: 3rem;
  width: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.18s ease;
}

.appstore:hover img,
.appstore:focus-visible img {
  opacity: 0.88;
}


/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

/* Hugs its content, so it reads as a control rather than a full-width row
   like the nav capsules on the home page. */
.backlink {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  gap: 0.375rem;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.9375rem 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.backlink:hover,
.backlink:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.40);
  transform: translateY(-1px);
  color: var(--text);
}

.backlink__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--faint);
}


/* --------------------------------------------------------------------------
   Prose (long-form body copy inside a card)
   -------------------------------------------------------------------------- */

.prose {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
}

.prose h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.prose h3 {
  margin: 1.25rem 0 0.375rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.prose p {
  margin: 0 0 0.875rem;
}

.prose ul {
  margin: 0 0 0.875rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.375rem;
}

.prose a {
  color: var(--faint);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .page {
    padding:
      calc(2.5rem + env(safe-area-inset-top))
      calc(2rem + env(safe-area-inset-right))
      calc(2.5rem + env(safe-area-inset-bottom))
      calc(2rem + env(safe-area-inset-left));
    gap: 0.75rem;
  }

  hr.rule {
    margin: 0.75rem 0;
  }

  .card {
    padding: 1.25rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .card__heading {
    font-size: 1.5rem;
  }
}


/* --------------------------------------------------------------------------
   Accessibility preferences
   -------------------------------------------------------------------------- */

/* Users who ask for more contrast get a much denser pane and full-strength
   text, without changing the default clear look. */
@media (prefers-contrast: more) {
  :root {
    --glass-bg: rgba(var(--glass-tint), 0.55);
    --glass-border: rgba(255, 255, 255, 0.55);
    --rule: rgba(255, 255, 255, 0.35);
    --muted: #fff;
    --faint: rgba(255, 255, 255, 0.85);
  }
}

@media (prefers-reduced-transparency: reduce) {
  /* Solid stand-in for 8% navy over the gradient's midpoint */
  :root {
    --glass-bg: #365972;
  }

  .glass {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capsule,
  .backlink,
  .lightbox__close,
  .screens__arrow,
  .appstore,
  .appstore img {
    transition: none;
  }

  .capsule:hover,
  .capsule:focus-visible,
  .backlink:hover,
  .backlink:focus-visible {
    transform: none;
  }
}


/* --------------------------------------------------------------------------
   Compositional spacing
   -------------------------------------------------------------------------- */

.card__heading + .prose,
.card__meta + .prose {
  margin-top: 1.25rem;
}
