/* Apple pass. Only transform/opacity-style properties, no new blur or filter layers, so it is safe on phones
   (mobile.css still removes every backdrop-filter there). Loaded after the page styles, before mobile.css. */

/* ---- Response: no tap delay, no grey flash, feedback on press-down ---- */
a, button, summary, [role="button"], label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Press feedback uses the individual `scale` property, so it adds to a hover lift (transform) instead of fighting it.
   In: instant (80ms). Out: a small spring, because the finger left with a little energy. */
.btn, .nav-login, .nav-join {
  transition-property: transform, scale, background, background-color, border-color, color, box-shadow;
  transition-duration: 180ms, 420ms, 200ms, 200ms, 180ms, 180ms, 200ms;
  transition-timing-function: var(--ease-out), var(--ease-spring), var(--ease-out), var(--ease-out), var(--ease-out), var(--ease-out), var(--ease-out);
}
.btn:active, .nav-login:active, .nav-join:active { transform: none; scale: 0.965; transition-duration: 180ms, 80ms, 200ms, 200ms, 180ms, 180ms, 200ms; }
.btn-ghost, .btn-quiet, .nav-links a, .faq summary, .cmp-details > summary { transition: color 180ms var(--ease-out), opacity 120ms var(--ease-out), scale 420ms var(--ease-spring); }
.btn-ghost:active, .btn-quiet:active, .nav-links a:active, .faq summary:active, .cmp-details > summary:active { opacity: 0.62; scale: 0.975; transition-duration: 180ms, 60ms, 80ms; }
.scard { transition-property: transform, scale, border-color, box-shadow; transition-duration: 300ms, 420ms, 300ms, 300ms; transition-timing-function: var(--ease-out), var(--ease-spring), ease, ease; }
.scard:active { scale: 0.975; transition-duration: 300ms, 80ms, 300ms, 300ms; }

/* ---- Keyboard focus: one clear ring everywhere ---- */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn:focus-visible, .nav-login:focus-visible, .nav-join:focus-visible { outline-offset: 4px; }

/* ---- Typography: tracking and leading follow the size ---- */
html { font-kerning: normal; text-rendering: optimizeLegibility; }
h3 { letter-spacing: -0.012em; line-height: 1.2; text-wrap: balance; }
small, figcaption, .tier-note, .tier-promise small { letter-spacing: 0.012em; }

/* ---- Material: light catching the top edge of the floating layers ---- */
.nav { box-shadow: 0 20px 50px -30px #000, inset 0 1px 0 rgba(255, 255, 255, 0.13); }
.hero-chip { box-shadow: 0 16px 36px -16px #000, inset 0 1px 0 rgba(255, 255, 255, 0.14); }

/* ---- Wayfinding: jumping to a section lands below the floating bar ---- */
html { scroll-padding-top: 96px; }

/* ---- Open / close the FAQ and the full list with a real height animation (Chrome / Edge; others just toggle) ---- */
@media (prefers-reduced-motion: no-preference) {
  @supports selector(::details-content) {
    :root { interpolate-size: allow-keywords; }
    .faq details::details-content, .cmp-details::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 420ms var(--ease-out), content-visibility 420ms allow-discrete;
    }
    .faq details[open]::details-content, .cmp-details[open]::details-content { block-size: auto; }
    .faq details:not([open]) p { display: block; }
    .faq summary::after { transition: transform 420ms var(--ease-spring); }
  }
}

/* ---- Reduced motion: no endless loops, no slides ---- */
@media (prefers-reduced-motion: reduce) {
  .nav-join::before, .nav-join .nj-dot, .hero-chip, .spotlight::before, .hero-ring { animation: none !important; }
  .btn:active, .nav-login:active, .nav-join:active, .scard:active { scale: none; }
}

/* ---- Reduced transparency: frosted glass becomes solid ---- */
@media (prefers-reduced-transparency: reduce) {
  .nav { background: rgb(12, 12, 18); backdrop-filter: none; }
  .hero-chip, .how-stage, .g-sec, .kicker { backdrop-filter: none; }
  .hero-chip { background: rgb(14, 14, 22); }
  .how-stage { background: rgb(8, 8, 14); }
}

/* ---- Higher contrast: defined edges ---- */
@media (prefers-contrast: more) {
  .nav, .hero-chip, .how-stage, .tier, .cmp-details > summary { border-color: rgba(255, 255, 255, 0.55); }
  .nav-links a, .sub, .lede { color: var(--ink); }
}

/* ---- Live demo, tidied ----
   Two even columns that read top to bottom: the player over the in-app view on the left, the sound control over the
   Discord card on the right. One rhythm (14px) between rows, panes the same height with their tag in the same place. */
.demo { gap: 14px 24px; align-items: stretch; }
@media (min-width: 901px) { .demo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 900px) { .demo { grid-template-columns: minmax(0, 1fr); } }
.demo > * { margin: 0 !important; }
.demo > .search { order: 1; }
.demo > .results { order: 2; }
.demo > .demo-note { order: 3; padding-left: 22px; font-size: 0.82rem; color: var(--dim); }
.demo > .player { order: 4; grid-column: 1; }
.demo > .listen { order: 5; grid-column: 2; }
.demo > .app-stage { order: 6; }
.demo > .demo-card-wrap { order: 7; }

/* the two cards of controls: same height, same material */
.demo .player, .demo .sound {
  min-height: 76px; height: 100%; padding: 12px 18px 12px 14px; border-radius: 20px; gap: 14px; align-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.demo .listen { display: flex; }
.demo .listen[hidden] { display: none; }
.demo .listen .sound { width: 100%; flex-wrap: nowrap; }
.demo .sound-body { min-width: 0; }
.demo .sound-body small { line-height: 1.35; }
.demo .nudge { margin-left: auto; flex-shrink: 0; }
.demo .player-meta b { font-size: 1rem; }
.demo .playbtn, .demo .sound-btn { flex-shrink: 0; }

/* the two panes: equal, with the tag in the same corner and the content centred */
.demo .app-stage, .demo .demo-card-wrap { min-height: 430px; align-self: stretch; border-radius: 26px; }
.demo .app-stage { padding: 56px 28px 26px; justify-content: center; gap: 0; }
.demo .demo-card-wrap { padding: 56px 18px 22px; justify-content: center; }
.demo .demo-card-wrap .dcard { margin-bottom: 0; max-width: 380px; }
.demo .app-stage .stage-art { width: 112px; height: 112px; }
.demo .app-stage .stage-track { margin-top: 14px; }
.demo .app-stage .stage-lyrics { margin-top: 22px; min-height: 7.4rem; }
.demo .app-stage .stage-bar { margin-top: 20px; width: min(360px, 100%); }
.demo .app-stage .stage-times { width: min(360px, 100%); }
.demo .app-stage::after, .demo .demo-card-wrap::before { top: 16px; left: 18px; }

@media (max-width: 900px) {
  .demo > .player, .demo > .listen, .demo > .app-stage, .demo > .demo-card-wrap { grid-column: 1; }
  .demo .app-stage, .demo .demo-card-wrap { min-height: 0; }
  .demo .listen .sound { flex-wrap: wrap; }
  .demo > .demo-note { padding-left: 4px; }
}

/* ---- Smooth scrolling: the floating bar no longer blurs what passes under it ----
   A live blur on a sticky bar is re-computed on every scrolled frame (the biggest single cost in the scroll measurements:
   about 32 ms a frame down to 18-21 ms with it off). Same look, a little more solid. */
.nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(12, 12, 18, 0.86); }


/* ---- Under the pay button: three promises and PayPal's own row of accepted cards ---- */
.pay-trust { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 16px auto 4px; max-width: 680px; }
.pt-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; color: #d5def0; background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.03)); border: 1px solid rgba(255,255,255,0.13); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); }
.pt-chip svg { width: 15px; height: 15px; color: #5af0a0; flex-shrink: 0; }
.pt-cards { position: relative; flex-basis: 100%; display: flex; justify-content: center; margin-top: 4px; }
.pt-cards img { display: block; width: 220px; max-width: 70%; height: auto; padding: 7px 12px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px -14px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.4) inset; }
/* a soft light that slides over the cards every few seconds (transform only, off on phones and for reduced motion) */
@media (min-width: 821px) and (prefers-reduced-motion: no-preference) {
  .pt-cards::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 110px); width: 220px; border-radius: 14px; overflow: hidden; background: linear-gradient(105deg, transparent 38%, rgba(90, 240, 160, 0.34) 50%, transparent 62%); background-size: 260% 100%; background-position: 130% 0; animation: ptSweep 5.5s ease-in-out 1.2s infinite; pointer-events: none; mix-blend-mode: normal; }
  .pt-chip svg { animation: ptLock 4.2s ease-in-out infinite; }
  .pt-chip:nth-child(2) svg { animation-delay: .5s; } .pt-chip:nth-child(3) svg { animation-delay: 1s; }
  @keyframes ptSweep { 0%, 55% { background-position: 130% 0; } 85%, 100% { background-position: -30% 0; } }
  @keyframes ptLock { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.22); } 90% { transform: scale(1); } }
}

/* ---- Paying inside the site: a plain window, no blur or filters (they blanked boxes on iPhone Safari) ---- */
body.pm-open { overflow: hidden; }
.pay-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.78); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.pm-card { position: relative; width: 100%; max-width: 440px; margin: auto; background: #12141a; border: 1px solid #2a2e38; border-radius: 20px; padding: 28px 24px 22px; color: #f2f4f8; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.pm-card h3 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.pm-sub { margin: 0 0 18px; color: #aab0be; font-size: 0.95rem; line-height: 1.5; }
.pm-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #1d2029; color: #cfd3dc; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.pm-x:hover { background: #272b36; }
.pm-lab { display: block; margin: 0 0 6px; font-size: 0.85rem; font-weight: 600; color: #cfd3dc; }
.pm-in { width: 100%; box-sizing: border-box; padding: 13px 14px; border-radius: 12px; border: 1px solid #343846; background: #0b0c10; color: #f2f4f8; font-size: 1rem; }
.pm-in:focus { outline: 2px solid #4ff08a; outline-offset: 1px; border-color: transparent; }
.pm-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #3a1d1d; color: #ffb4b4; font-size: 0.9rem; line-height: 1.4; }
.pm-btns { margin: 16px 0 4px; min-height: 52px; }
.pm-note { margin: 6px 0 0; text-align: center; color: #aab0be; font-size: 0.88rem; }
.pm-foot { margin: 14px 0 0; text-align: center; color: #8a90a0; font-size: 0.8rem; line-height: 1.45; }
.pm-key { margin: 4px 0 14px; padding: 14px; border-radius: 12px; background: #0b0c10; border: 1px solid #343846; font-family: Consolas, "Courier New", monospace; font-size: 0.78rem; line-height: 1.5; word-break: break-all; user-select: all; max-height: 150px; overflow-y: auto; }
.pm-copy { width: 100%; justify-content: center; }
