/* ==========================================================================
   Play Ball — landing page
   The palette is the app's own Classic scorecard theme, the value set the
   Main Grid paints (src/theme/scorecardTheme.ts, THEMES.classic in
   src/theme/themes.ts): paper, paper shade, box paper, ink, ink soft,
   grid lines and the gold diamond accent. No other palette is used.
   ========================================================================== */

@font-face {
  font-family: 'Permanent Marker';
  src: url('assets/fonts/PermanentMarker_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('assets/fonts/Caveat_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F8F3E3;
  --paper-shade: #EFE6CC;
  --box-paper: #FFFDF4;
  --ink: #33302A;
  --ink-soft: #726751;
  --grid: #C9BC9C;
  --grid-strong: #8A7D5E;
  --gold: #E8B84B;
  --gold-glow: rgba(232, 184, 75, 0.3);
  --walk: #2E5E8C;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius-panel: 10px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--box-paper);
  color: var(--ink);
  border: 1.5px solid var(--grid-strong);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.92rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--walk);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Masthead — paper with a paper-shade header strip and a heavy pencil rule
   -------------------------------------------------------------------------- */

.masthead {
  display: flex;
  flex-direction: column;
  min-height: min(78svh, 720px);
  background: var(--paper);
  border-bottom: 3px solid var(--grid-strong);
}

.masthead__band {
  position: relative;
  flex: 0 0 auto;
  padding: clamp(30px, 5vw, 56px) 16px clamp(20px, 3vw, 28px);
  background: var(--paper-shade);
  border-bottom: 1px solid var(--grid);
  text-align: center;
}

.masthead__titleRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vw, 26px);
}

.masthead__title {
  margin: 0;
  font-family: 'Permanent Marker', 'Marker Felt', cursive;
  font-weight: 400;
  font-size: clamp(2.05rem, 6.1vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0.03em;
  color: var(--ink);
  animation: titleIn 0.6s ease both;
}

.lamp {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.lamp::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold-glow);
  animation: lampBlink 4.6s ease-in-out infinite;
}

.lamp::after {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1.5px var(--grid-strong) inset;
}

.lamp--b::before {
  animation-delay: 2.3s;
}

.lamp--small {
  width: 16px;
  height: 16px;
}

.lamp--small::after {
  width: 7px;
  height: 7px;
}

.masthead__underline {
  width: min(68%, 460px);
  height: 3px;
  margin: clamp(10px, 1.6vw, 16px) auto 0;
  background: var(--grid-strong);
  opacity: 0.55;
  transform: rotate(-1.2deg);
  transform-origin: center;
  animation: underlineDraw 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}

.masthead__tagline {
  margin: clamp(12px, 2vw, 18px) 0 0;
  font-family: 'Caveat', 'Bradley Hand', cursive;
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
  color: var(--ink-soft);
}

.masthead__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 26px);
  padding: clamp(26px, 4.5vw, 44px) 16px clamp(20px, 3.5vw, 34px);
  text-align: center;
}

.masthead__copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 44rem;
  animation: fadeUp 0.7s ease 0.1s both;
}

.masthead__copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 1.35vw, 1.06rem);
  line-height: 1.62;
}

.status-plate {
  margin: clamp(2px, 0.8vw, 8px) 0 0;
  font-family: 'Permanent Marker', 'Marker Felt', cursive;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  animation: fadeUp 0.7s ease 0.2s both;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--ink-soft);
  text-decoration: none;
  animation: fadeUp 0.7s ease 0.3s both;
}

.scroll-cue__label {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.scroll-cue__chevron {
  width: 15px;
  height: 15px;
  border-right: 2px solid var(--grid-strong);
  border-bottom: 2px solid var(--grid-strong);
  transform: rotate(45deg);
  animation: cueBob 2.8s ease-in-out infinite;
}

.scroll-cue:hover .scroll-cue__label {
  color: var(--ink);
}

@keyframes titleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes underlineDraw {
  from { transform: rotate(-1.2deg) scaleX(0.2); opacity: 0; }
  to { transform: rotate(-1.2deg) scaleX(1); opacity: 0.55; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cueBob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(4px, 4px); }
}

@keyframes lampBlink {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Showcase — the fan is a real flex row; every card keeps its full shape
   -------------------------------------------------------------------------- */

.showcase {
  padding: clamp(46px, 7vw, 82px) clamp(16px, 4vw, 32px) clamp(34px, 5vw, 54px);
  background: var(--paper);
}

.fan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 4.5% 32px;
  list-style: none;
  overflow: visible;
}

.slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  z-index: 1;
}

.slot + .slot {
  margin-left: -3.2%;
}

.slot[data-pos='center'] {
  z-index: 2;
}

.slot[data-selected='true'] {
  z-index: 4;
}

.card {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 1432;
  padding: 0;
  background: var(--box-paper);
  border: 1.5px solid var(--grid-strong);
  border-radius: var(--radius-panel);
  box-shadow:
    0 10px 22px rgba(51, 48, 42, 0.14),
    0 2px 4px rgba(51, 48, 42, 0.08);
  cursor: pointer;
  overflow: hidden;
  transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
  transform-origin: 50% 100%;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
  animation: deal 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  -webkit-tap-highlight-color: transparent;
}

.slot[data-pos='left'] .card {
  --rot: -4deg;
}

.slot[data-pos='center'] .card {
  --rot: -1deg;
}

.slot[data-pos='right'] .card {
  --rot: 3.5deg;
}

.slot:nth-child(2) .card {
  animation-delay: 0.08s;
}

.slot:nth-child(3) .card {
  animation-delay: 0.16s;
}

.card__shot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
  border-radius: 8px;
  pointer-events: none;
  -webkit-user-drag: none;
}

.card[aria-selected='true'] {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px var(--gold),
    0 16px 30px rgba(51, 48, 42, 0.2),
    0 3px 6px rgba(51, 48, 42, 0.1);
}

.card:focus-visible {
  outline: 3px solid var(--walk);
  outline-offset: 4px;
}

@keyframes deal {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (hover: hover) {
  .slot:hover {
    z-index: 3;
  }

  .slot[data-selected='true']:hover {
    z-index: 5;
  }

  .card:hover {
    --lift: -2px;
    box-shadow:
      0 18px 30px rgba(51, 48, 42, 0.22),
      0 3px 6px rgba(51, 48, 42, 0.1);
  }

  .card[aria-selected='true']:hover {
    box-shadow:
      0 0 0 1px var(--gold),
      0 20px 34px rgba(51, 48, 42, 0.24),
      0 4px 8px rgba(51, 48, 42, 0.12);
  }
}

.description {
  max-width: 780px;
  margin: clamp(26px, 4vw, 38px) auto 0;
}

.description__panel {
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3.4vw, 30px);
  background: var(--box-paper);
  border: 1.5px solid var(--grid-strong);
  border-radius: var(--radius-panel);
  box-shadow: 0 2px 0 rgba(51, 48, 42, 0.05);
  text-align: left;
}

.description__panel[hidden] {
  display: none;
}

.description__title {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.description__body {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.01rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Philosophy — the paper-scoring promise on a shade band
   -------------------------------------------------------------------------- */

.philosophy {
  padding: clamp(48px, 7vw, 86px) 16px;
  background: var(--paper-shade);
  border-top: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  text-align: center;
}

.philosophy__inner {
  max-width: 44rem;
  margin: 0 auto;
}

.philosophy__title {
  margin: 0 0 18px;
  font-family: 'Caveat', 'Bradley Hand', cursive;
  font-weight: 700;
  font-size: clamp(1.75rem, 3.8vw, 2.7rem);
  line-height: 1.1;
  color: var(--ink);
}

.philosophy__body {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   The captured "record a double" demonstration, inside the paper section
   -------------------------------------------------------------------------- */

.double-demo {
  width: min(100%, 1100px);
  margin: clamp(28px, 4vw, 44px) auto 0;
  pointer-events: none;
}

.double-demo__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--box-paper);
  border: 1.5px solid var(--grid-strong);
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow:
    0 10px 22px rgba(51, 48, 42, 0.12),
    0 2px 4px rgba(51, 48, 42, 0.06);
}

.double-demo__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  opacity: 0;
  transition: opacity 240ms ease;
}

.double-demo__frame.is-previous {
  z-index: 1;
  opacity: 1;
  transition: none;
}

.double-demo__frame.is-active {
  z-index: 2;
  opacity: 1;
}

.double-demo__frame.is-settled {
  opacity: 1;
  transition: none;
}

.double-demo__finger {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--paper);
  background: var(--ink);
  box-shadow: 0 1px 3px rgba(51, 48, 42, 0.35);
  opacity: 0;
  transition: opacity 200ms ease;
  will-change: transform;
}

.double-demo.is-running .double-demo__finger {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   The closing sign-off — the masthead's gesture as the last content band
   -------------------------------------------------------------------------- */

.signoff {
  padding: clamp(42px, 6vw, 74px) 16px;
  background: var(--paper-shade);
  border-top: 2px solid var(--grid-strong);
  text-align: center;
}

.signoff__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vw, 26px);
  max-width: 44rem;
  margin: 0 auto;
}

.signoff__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: 'Permanent Marker', 'Marker Felt', cursive;
  font-weight: 400;
  font-size: clamp(1.6rem, 4.2vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.signoff__rule {
  width: min(62%, 420px);
  height: 3px;
  margin: clamp(12px, 2vw, 18px) auto 0;
  background: var(--grid-strong);
  opacity: 0.5;
  transform: rotate(-1.2deg);
}

/* --------------------------------------------------------------------------
   Footer — paper with the heavy pencil rule closing the page
   -------------------------------------------------------------------------- */

.footer {
  padding: 26px 16px 30px;
  background: var(--paper);
  border-top: 2px solid var(--grid-strong);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  max-width: 1320px;
  margin: 0 auto;
}

.footer__name {
  margin: 0;
  font-family: 'Permanent Marker', 'Marker Felt', cursive;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.footer__legal {
  flex-basis: 100%;
  order: 3;
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Scroll reveals
   -------------------------------------------------------------------------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.is-revealed {
  opacity: 1;
  transform: none;
}

html.js .fan {
  opacity: 0;
  transition: opacity 0.3s ease;
}

html.js .fan.is-revealed {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .fan {
    padding: 24px 3% 30px;
  }

  .slot + .slot {
    margin-left: -2%;
  }

  .slot[data-pos='left'] .card {
    --rot: -2.6deg;
  }

  .slot[data-pos='center'] .card {
    --rot: -0.8deg;
  }

  .slot[data-pos='right'] .card {
    --rot: 2.4deg;
  }
}

/* Phones: three complete cards in a flat row, no tilt, no overlap. */
@media (max-width: 760px) {
  .showcase {
    padding-left: 0;
    padding-right: 0;
  }

  .fan {
    align-items: stretch;
    gap: clamp(6px, 2vw, 10px);
    padding: 6px clamp(6px, 2vw, 12px) 8px;
  }

  .slot + .slot {
    margin-left: 0;
  }

  .slot[data-pos] .card {
    --rot: 0deg;
  }

  .card {
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(51, 48, 42, 0.16);
  }

  .description {
    margin-left: 16px;
    margin-right: 16px;
  }

  .double-demo {
    margin-top: 22px;
  }

  .double-demo__screen {
    border-radius: 8px;
  }

  .double-demo__finger {
    width: 16px;
    height: 16px;
    border-width: 2.5px;
  }

  /* The fan's side padding is narrow here: keep the keyboard ring inside it. */
  .card:focus-visible {
    outline-offset: 2px;
  }
}

@media (max-width: 480px) {
  .masthead__title {
    font-size: clamp(1.7rem, 8.4vw, 2.4rem);
  }

  .masthead__titleRow {
    gap: 10px;
  }

  .lamp {
    width: 18px;
    height: 18px;
  }

  .lamp::after {
    width: 9px;
    height: 9px;
  }

  .lamp--small {
    width: 14px;
    height: 14px;
  }

  .lamp--small::after {
    width: 6px;
    height: 6px;
  }

  .status-plate {
    font-size: clamp(1.15rem, 5.2vw, 1.5rem);
  }

  .signoff__title {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }

  .scroll-cue__label {
    font-size: 0.76rem;
  }

  .description__panel {
    padding: 18px 16px;
  }

  .footer {
    padding: 22px 16px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .masthead__title,
  .masthead__underline,
  .masthead__copy,
  .status-plate,
  .scroll-cue,
  .card {
    animation: none;
  }

  .scroll-cue__chevron,
  .lamp::before {
    animation: none;
  }

  .card {
    transition: none;
  }

  .double-demo__frame {
    transition: none;
  }

  .double-demo__finger {
    display: none;
  }

  html.js .reveal,
  html.js .reveal.is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.js .fan,
  html.js .fan.is-revealed {
    opacity: 1;
    transition: none;
  }
}



