/*
 * public/assets/css/app-promo.css — the PotatoPlayer promo look.
 *
 * One stylesheet powers two surfaces that share one layout:
 *
 *   • views/app-download.ejs        — the landing page (`body.pp-page`)
 *   • views/site/tool.ejs           — the promo dialog (`.pp-modal`, managed
 *                                     by public/assets/js/app-promo.js)
 *
 * The layout is a single vertical column on every screen — mobile and PC see
 * the same thing — and is compact enough that the dialog fits one viewport
 * without an internal scrollbar on normal screens. If a very short window
 * cannot fit it, the scroll area degrades gracefully to a slim scrollbar.
 *
 * Card order (views/partials/potatoplayer-promo.ejs):
 *   pitch → Play button → one-line feature points → assurances → (modal) actions.
 *
 * Theme wiring: the site sets data-theme on <html> (see potato.css), so the
 * dialog follows the site's own light/dark choice; the standalone landing has
 * no data-theme and follows the system preference instead.
 *
 * Everything is scoped under `pp-` class names (or `.gp-btn`, the shared Play
 * button partial) so this file can never collide with potato.css.
 */

:root {
  --pp-bg: #f2f9f5;
  --pp-surface: #ffffff;
  --pp-ink: #0c2a23;        /* 14:1 on --pp-bg */
  --pp-body: #3a5850;       /* 9:1  on --pp-bg */
  --pp-meta: #5e7c73;       /* 5.4:1 on --pp-bg */
  --pp-brand: #0f766e;
  --pp-brand-deep: #074b40;
  --pp-mint: #34d399;
  --pp-teal: #14b8a6;
  --pp-lime: #a3e635;
  --pp-sky: #38bdf8;
  --pp-hair: rgba(13, 92, 78, 0.16);
  --pp-ring: rgba(13, 148, 136, 0.34);
  --pp-soft: #ddf3ea;
  --pp-shadow: 0 10px 28px rgba(7, 66, 54, 0.12);
  --pp-shadow-lg: 0 26px 70px rgba(6, 50, 40, 0.32);
  --pp-btn-inner: rgba(255, 255, 255, 0.65);
  --pp-btn-halo: rgba(13, 148, 136, 0.08);
  --pp-scroll-thumb: rgba(13, 148, 136, 0.42);
  --pp-scroll-thumb-hover: rgba(13, 148, 136, 0.62);
}

/* System dark mode — but only when the site has not explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pp-bg: #0b1714;
    --pp-surface: #122420;
    --pp-ink: #e9f5f0;
    --pp-body: #b9d2c9;
    --pp-meta: #8fada3;
    --pp-brand: #5eead4;
    --pp-brand-deep: #99f6e4;
    --pp-hair: rgba(153, 246, 228, 0.14);
    --pp-ring: rgba(94, 234, 212, 0.36);
    --pp-soft: rgba(45, 212, 191, 0.12);
    --pp-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    --pp-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.6);
    --pp-btn-inner: rgba(255, 255, 255, 0.12);
    --pp-btn-halo: rgba(94, 234, 212, 0.10);
    --pp-scroll-thumb: rgba(94, 234, 212, 0.32);
    --pp-scroll-thumb-hover: rgba(94, 234, 212, 0.50);
  }
}

/* The site's own toggle (data-theme="dark") always wins over the system. */
html[data-theme="dark"] {
  --pp-bg: #0b1714;
  --pp-surface: #122420;
  --pp-ink: #e9f5f0;
  --pp-body: #b9d2c9;
  --pp-meta: #8fada3;
  --pp-brand: #5eead4;
  --pp-brand-deep: #99f6e4;
  --pp-hair: rgba(153, 246, 228, 0.14);
  --pp-ring: rgba(94, 234, 212, 0.36);
  --pp-soft: rgba(45, 212, 191, 0.12);
  --pp-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  --pp-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.6);
  --pp-btn-inner: rgba(255, 255, 255, 0.12);
  --pp-btn-halo: rgba(94, 234, 212, 0.10);
  --pp-scroll-thumb: rgba(94, 234, 212, 0.32);
  --pp-scroll-thumb-hover: rgba(94, 234, 212, 0.50);
}

/* ── landing page base ─────────────────────────────────────────────────── */

.pp-page {
  margin: 0;
  background: var(--pp-bg);
  color: var(--pp-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.pp-page a { color: var(--pp-brand); }

.pp-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px calc(64px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* Soft background wash: four drifting blobs + a dotted grid fading out. */
.pp-mesh { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.pp-mesh i { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.pp-mesh i:nth-child(1) { width: 44vmax; height: 44vmax; top: -16vmax; left: -14vmax;
                          background: var(--pp-mint); opacity: 0.30; animation: pp-drift-a 30s ease-in-out infinite; }
.pp-mesh i:nth-child(2) { width: 34vmax; height: 34vmax; top: -10vmax; right: -14vmax;
                          background: var(--pp-teal); opacity: 0.24; animation: pp-drift-b 36s ease-in-out infinite; }
.pp-mesh i:nth-child(3) { width: 30vmax; height: 30vmax; top: 48vmax; left: -14vmax;
                          background: var(--pp-lime); opacity: 0.22; animation: pp-drift-c 33s ease-in-out infinite; }
.pp-mesh i:nth-child(4) { width: 26vmax; height: 26vmax; top: 74vmax; right: -12vmax;
                          background: var(--pp-sky); opacity: 0.18; animation: pp-drift-a 39s ease-in-out infinite reverse; }

@keyframes pp-drift-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); }        50% { transform: translate3d(5vmax, 3vmax, 0) scale(1.1); } }
@keyframes pp-drift-b { 0%, 100% { transform: translate3d(0, 0, 0) scale(1.04); }     50% { transform: translate3d(-4vmax, 5vmax, 0) scale(0.95); } }
@keyframes pp-drift-c { 0%, 100% { transform: translate3d(0, 0, 0) scale(0.97); }     50% { transform: translate3d(4vmax, -4vmax, 0) scale(1.08); } }

.pp-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(13, 148, 136, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 58%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 58%);
}

/* Entrance: subtle, and fully disabled for reduced-motion users. */
.pp-rise { opacity: 0; animation: pp-rise 0.66s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.pp-d1 { animation-delay: 0.04s } .pp-d2 { animation-delay: 0.11s }
.pp-d3 { animation-delay: 0.18s } .pp-d4 { animation-delay: 0.25s }
@keyframes pp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── hero (shared by page + modal) ─────────────────────────────────────── */

.pp-hero { text-align: center; padding: 36px 0 0; }
.pp--modal .pp-hero { padding: 4px 0 0; }

.pp-icon { position: relative; display: block; width: 125px; margin: 0 auto 12px; }
.pp-icon img {
  display: block; width: 125px; height: 125px;
  border-radius: 31px; border: 3px solid var(--pp-surface);
  background: var(--pp-surface);
  box-shadow: 0 10px 30px rgba(7, 66, 54, 0.16);
}
.pp-icon::after {
  content: ""; position: absolute; inset: -17px; border-radius: 46px; z-index: -1;
  background: linear-gradient(135deg, var(--pp-mint), var(--pp-teal));
  filter: blur(24px); opacity: 0.28;
  animation: pp-pulse 6s ease-in-out infinite;
}
@keyframes pp-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.97); }
  50%      { opacity: 0.36; transform: scale(1.04); }
}

.pp--modal .pp-icon,
.pp--modal .pp-icon img { width: 86px; height: 86px; }
.pp--modal .pp-icon img { border-radius: 22px; border-width: 2px; }
.pp--modal .pp-icon { margin-bottom: 10px; }

.pp-wordmark {
  margin: 0 0 4px;
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(21px, 6.4vw, 27px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  background: linear-gradient(105deg, var(--pp-brand-deep), var(--pp-brand) 55%, #15803d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--pp-brand-deep);
}
.pp--modal .pp-wordmark { font-size: 21px; }

.pp-title {
  margin: 0 0 8px;
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(19px, 5.4vw, 25px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--pp-ink);
}
.pp--modal .pp-title { font-size: 20px; margin-bottom: 6px; }

.pp-tag { margin: 0 auto; max-width: 46ch; color: var(--pp-body); font-size: 15.5px; }
.pp--modal .pp-tag { font-size: 14px; }

/* ── CTA — right under the tagline (shared) ────────────────────────────── */

.pp-cta { margin: 20px 0 0; display: flex; justify-content: center; }
.pp--modal .pp-cta { margin-top: 16px; }

/* The shared Google Play partial, in full: a teal ring for the border, a soft
   permanent halo outside it, and an all-around inner sheen. The only ring
   that must not appear is the focus ring (handled by focusing the dialog). */
.gp-btn {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 12px 22px;
  border-radius: 16px;
  background: var(--pp-surface);
  border: 1px solid var(--pp-ring);
  box-shadow:
    0 8px 22px rgba(7, 66, 54, 0.12),
    0 0 0 4px var(--pp-btn-halo),
    inset 0 0 0 1px var(--pp-btn-inner);
  color: var(--pp-ink); text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.gp-btn:hover {
  transform: translateY(-1px);
  border-color: var(--pp-brand);
  box-shadow:
    0 12px 28px rgba(7, 66, 54, 0.16),
    0 0 0 5px var(--pp-btn-halo),
    inset 0 0 0 1px var(--pp-btn-inner);
}
.gp-btn:active { transform: none; }
.gp-icon { width: 30px; height: 30px; display: block; flex: none; }
.gp-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.gp-top  { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pp-meta); }
.gp-main { font-size: 16.5px; font-weight: 750; color: var(--pp-ink); }

/* ── feature points — one-line bullets with a glowing outlined arrow ───── */
/*
   Small one-liners (max five), each prefixed by a small outlined pink arrow
   (hollow inside) with a soft glow, vertically centred on the first line.
   The type matches the tagline above the button so the card reads as one
   voice. No cards, no icons.
*/

.pp-points {
  list-style: none;
  width: fit-content;
  margin: 16px auto 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.pp-points li {
  position: relative;
  padding-left: 27px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--pp-body);
  text-align: left;
}
/*
 * The arrow is a stroke-only SVG (so its inside stays hollow) drawn as a
 * background image, which lets drop-shadow paint the pink glow around the
 * outline. `top` centres it on the first text line for any inherited font
 * size: (line-height - arrow) / 2.
 */
.pp-points li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: calc((1.5em - 18px) / 2);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ec4899' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9h9V6l9 6-9 6v-3H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 0 3px rgba(244, 114, 182, 0.85)) drop-shadow(0 0 7px rgba(244, 114, 182, 0.45));
}

/* Modal: the same list, a hair smaller. */
.pp--modal .pp-points { margin-top: 14px; gap: 6px; }
.pp--modal .pp-points li { font-size: 14px; }

/* ── assurances (shared) ───────────────────────────────────────────────── */

.pp-assure {
  list-style: none; margin: 18px 0 0; padding: 14px 0 0;
  border-top: 1px solid var(--pp-hair);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  font-size: 13.5px; font-weight: 600; color: var(--pp-body);
}
.pp-assure li { display: inline-flex; align-items: center; gap: 6px; }
.pp-assure svg { width: 14px; height: 14px; color: var(--pp-brand); flex: none; }

/* ── page-only blocks ──────────────────────────────────────────────────── */

.pp-block { padding: 30px 0 0; margin: 30px 0 0; border-top: 1px solid var(--pp-hair); }

.pp-h2 {
  margin: 0 0 14px;
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-size: 19px; font-weight: 750; letter-spacing: -0.02em; color: var(--pp-ink);
}

.pp-steps { display: grid; gap: 14px; }
.pp-step { display: flex; gap: 13px; align-items: flex-start; }
.pp-step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pp-soft); border: 1px solid var(--pp-ring);
  color: var(--pp-brand-deep); font-size: 12.5px; font-weight: 700;
}
.pp-step p { margin: 0; font-size: 15px; }
.pp-step strong { color: var(--pp-ink); }

.pp-note {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 30px 0 0; padding: 18px 0 0; border-top: 1px solid var(--pp-hair);
  font-size: 13.5px; color: var(--pp-meta);
}
.pp-note svg { flex: none; width: 17px; height: 17px; color: var(--pp-brand); margin-top: 3px; }
.pp-note p { margin: 0; }
.pp-note strong { color: var(--pp-body); font-weight: 650; }

.pp-foot { margin: 26px 0 0; text-align: center; color: var(--pp-meta); font-size: 12.5px; }
.pp-foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 10px; }
.pp-foot a { color: var(--pp-brand); text-decoration: none; font-weight: 600; }
.pp-foot a:hover { text-decoration: underline; }
.pp-foot p { margin: 0 0 6px; }

/* ── the promo dialog (tool pages) ─────────────────────────────────────── */

.pp-modal {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  /* Generous block padding keeps the dialog's rounded border clearly visible
     against the top and bottom of the screen. */
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
}
.pp-modal[hidden] { display: none !important; }

.pp-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 30, 25, 0.5);
  opacity: 0; transition: opacity 0.22s ease;
}

.pp-dialog {
  position: relative;
  width: min(420px, 100%);
  background: var(--pp-surface);
  border: 1px solid var(--pp-hair);
  border-radius: 28px;
  box-shadow: var(--pp-shadow-lg);
  overflow: hidden;              /* clips the scroll container to the radius */
  opacity: 0; transform: translateY(12px) scale(0.97);
}

/* The dialog itself takes programmatic focus when it opens (so no focus ring
   lands on the Play button); its own outline is suppressed. Keyboard users
   still get a visible ring on Tab, from the shared :focus-visible rule. */
.pp-dialog:focus { outline: none; }

/* The card is compact enough to fit without scrolling on normal screens; the
   max-height (88vh) and slim scrollbar below are the graceful fallback for
   short windows. The track's vertical margin keeps its ends away from the
   rounded corners. */
.pp-dialog-scroll {
  max-height: min(88vh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px 20px;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: var(--pp-scroll-thumb) transparent;
}
.pp-dialog-scroll::-webkit-scrollbar { width: 8px; }
.pp-dialog-scroll::-webkit-scrollbar-track { background: transparent; margin-block: 18px; }
.pp-dialog-scroll::-webkit-scrollbar-thumb {
  background: var(--pp-scroll-thumb);
  border: 2px solid transparent;   /* slims the thumb inside its lane */
  background-clip: padding-box;
  border-radius: 999px;
}
.pp-dialog-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--pp-scroll-thumb-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.pp-modal.is-open .pp-backdrop { opacity: 1; }
.pp-modal.is-open .pp-dialog {
  opacity: 1; transform: none;
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.pp-modal.is-closing .pp-backdrop { opacity: 0; }
.pp-modal.is-closing .pp-dialog { opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 0.2s ease, transform 0.2s ease; }

html.pp-lock, html.pp-lock body { overflow: hidden; }

.pp-x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--pp-hair); background: var(--pp-soft); color: var(--pp-brand-deep);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.pp-x svg { width: 15px; height: 15px; }
.pp-x:hover { border-color: var(--pp-ring); }

/* Dismiss controls — one row on every screen, centred under the card. */
.pp-modal-actions {
  margin: 14px 0 0;
  display: flex; flex-direction: row; justify-content: center; align-items: center;
  gap: 10px 14px;
}

.pp-later {
  min-height: 42px; padding: 0 22px;
  border: 1px solid var(--pp-ring); border-radius: 999px;
  background: var(--pp-soft); color: var(--pp-brand-deep);
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.pp-later:hover { border-color: var(--pp-brand); }

.pp-never {
  padding: 8px 10px; border: 0; background: none;
  color: var(--pp-meta); font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.pp-never:hover { color: var(--pp-brand-deep); }

/* ── focus + motion + small screens ────────────────────────────────────── */

.pp-page :focus-visible,
.pp-modal :focus-visible { outline: 2px solid var(--pp-ring); outline-offset: 3px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .pp-rise { opacity: 1; animation: none; }
  .pp-mesh i, .pp-icon::after { animation: none; }
  .pp-backdrop, .pp-dialog, .pp-modal.is-open .pp-dialog,
  .pp-modal.is-closing .pp-backdrop, .pp-modal.is-closing .pp-dialog { transition: none; opacity: 1; transform: none; }
  .gp-btn, .pp-later { transition: none; }
}

@media (max-width: 380px) {
  .pp-wrap { padding-left: 16px; padding-right: 16px; }
  .pp-hero { padding-top: 30px; }
  .gp-btn { padding: 11px 18px; }
}

@media (min-width: 600px) {
  .pp-wrap { padding-left: 24px; padding-right: 24px; }
}
