/* The shared Pixel Mini Apps palette. Keep these variable names — the Pixel
   Space panel and any future shared UI read them, which is what makes
   embedded surfaces feel native to your app's theme. */

:root {
  color-scheme: light;
  --paper: #f8f7f4;
  --panel: #f1efea;
  --card: #fff;
  --ink: #26231e;
  --on-ink: #fff;
  --soft-ink: #68645d;
  --muted: #8b877f;
  --line: #e9e6df;
  --line-strong: #d5d1c9;
  --accent: #d18b38;
  --danger: #bd514b;
  --hover-bg: rgba(240, 237, 231, .6);
  --danger-bg: rgba(189, 81, 75, .08);
  --shadow-sm: 0 1px 2px rgba(35, 32, 28, .06), 0 5px 18px rgba(35, 32, 28, .035);
  --shadow-drag: 0 3px 8px rgba(35, 32, 28, .1), 0 14px 38px rgba(35, 32, 28, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1a1917;
    --panel: #211f1d;
    --card: #2a2725;
    --ink: #e8e5e0;
    --on-ink: #1a1917;
    --soft-ink: #b3ada4;
    --muted: #8f8a81;
    --line: #33302c;
    --line-strong: #3d3934;
    --danger: #e07570;
    --hover-bg: rgba(255, 255, 255, .05);
    --danger-bg: rgba(224, 117, 112, .1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 5px 18px rgba(0, 0, 0, .25);
    --shadow-drag: 0 3px 8px rgba(0, 0, 0, .45), 0 14px 38px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1a1917;
  --panel: #211f1d;
  --card: #2a2725;
  --ink: #e8e5e0;
  --on-ink: #1a1917;
  --soft-ink: #b3ada4;
  --muted: #8f8a81;
  --line: #33302c;
  --line-strong: #3d3934;
  --danger: #e07570;
  --hover-bg: rgba(255, 255, 255, .05);
  --danger-bg: rgba(224, 117, 112, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 5px 18px rgba(0, 0, 0, .25);
  --shadow-drag: 0 3px 8px rgba(0, 0, 0, .45), 0 14px 38px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

/* Back-home chip: every mini app links back to the launcher, upper left. */
.home-chip {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.home-chip:hover { color: var(--ink); background: var(--hover-bg); }

/* ---------- PodcastObserver landing ----------
   A product page on its own domain: one dark look regardless of the
   mini-apps theme cookie. */

body { margin: 0; background: #0e0d1a; }

.landing {
  --po-bg: #0e0d1a;
  --po-ink: #f4f3ff;
  --po-soft: #b8b5d6;
  --po-muted: #8784a8;
  --po-accent: #8e8cff;
  --po-card: rgba(255, 255, 255, .045);
  --po-line: rgba(255, 255, 255, .09);
  min-height: 100vh;
  color: var(--po-ink);
  background:
    radial-gradient(60rem 36rem at 50% -8rem, rgba(110, 92, 255, .38), transparent 70%),
    radial-gradient(40rem 30rem at 85% 30rem, rgba(191, 90, 242, .16), transparent 70%),
    var(--po-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
}

.landing-footer {
  display: flex;
  justify-content: center;
  gap: .6rem;
  padding: 2rem 1rem 3rem;
  color: var(--po-muted);
  font-size: .85rem;
}

/* ---------- Privacy (and future legal pages) ---------- */
.legal {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem 4rem;
  line-height: 1.6;
  color: var(--po-soft);
}
.legal h1 { color: var(--po-ink); font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -.03em; margin: 1.5rem 0 .25rem; }
.legal h2 { color: var(--po-ink); font-size: 1.15rem; margin: 2rem 0 .5rem; }
.legal strong { color: var(--po-ink); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: .5rem 0; }
.legal a { color: var(--po-accent); }
.legal-updated { color: var(--po-muted); font-size: .9rem; margin: 0 0 1.5rem; }
.legal-back { display: inline-flex; align-items: center; gap: .6rem; color: var(--po-ink) !important; text-decoration: none; font-weight: 700; }
.legal-back img { border-radius: 9px; }
.landing-footer a { color: var(--po-muted); }

/* ---------- Share pages: /show, /episode, /c ----------
   The landing's dark look, lit by the artwork's own colors (--wash-*). */
.share {
  background:
    radial-gradient(52rem 34rem at 12% -6rem, color-mix(in srgb, var(--wash-a) 82%, transparent), transparent 72%),
    radial-gradient(44rem 30rem at 96% 8rem, color-mix(in srgb, var(--wash-b) 62%, transparent), transparent 70%),
    radial-gradient(40rem 28rem at 50% 44rem, color-mix(in srgb, var(--wash-c) 26%, transparent), transparent 72%),
    var(--po-bg);
  background-repeat: no-repeat;
}
.share a { color: inherit; }

.share-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.share-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.share-brand img { border-radius: 8px; }
.share-get {
  padding: .45rem .9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.share-get:hover { background: rgba(255, 255, 255, .22); }

.share-card {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
  text-align: center;
}
.share-art {
  display: block;
  width: min(68vw, 300px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1);
}
.share-art.placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--wash-a) 70%, #fff 8%), color-mix(in srgb, var(--wash-b) 80%, #000 20%));
}
.share-art.placeholder img { width: 38%; height: auto; border-radius: 22%; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.share-art.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: none; box-shadow: none; }
.share-art.mosaic img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }

.share-head { min-width: 0; max-width: 40rem; }
.share-eyebrow {
  margin: 0 0 .5rem;
  color: rgba(255, 255, 255, .72);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.share-eyebrow a { text-decoration: none; }
.share-eyebrow a:hover { text-decoration: underline; }
.share-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 6.4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.share-byline { margin: .6rem 0 0; color: rgba(255, 255, 255, .86); font-size: 1.08rem; font-weight: 600; }
.share-facts { margin: .45rem 0 0; color: rgba(255, 255, 255, .64); font-size: .95rem; }
.share-moment {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: .9rem 0 0;
  padding: .35rem .8rem .35rem .65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin-top: 1.4rem; }
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14) inset;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .12s ease, background-color .12s ease;
}
.share-button.primary { background: #fff; color: #111118; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.share-button:active { transform: scale(.97); }
@media (hover: hover) {
  .share-button:hover { background: rgba(255, 255, 255, .2); }
  .share-button.primary:hover { background: #ecebff; }
}

.share-body { max-width: 42rem; margin: 0 auto; padding: .5rem 1.25rem 2rem; }
.share-body h2 { margin: 2.2rem 0 .7rem; font-size: 1.2rem; letter-spacing: -.01em; }
.share-description { margin: 1rem 0 0; color: var(--po-soft); font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.share-description p { margin: 0; }
.share-description summary { list-style: none; cursor: pointer; }
.share-description summary::-webkit-details-marker { display: none; }
.share-more { display: inline-block; margin-left: .35rem; color: var(--po-ink); font-weight: 700; }
.share-description details[open] summary { display: none; }
.share-crumb { margin: 1.5rem 0 0; color: var(--po-muted); font-size: .92rem; }

.share-player { margin-top: 1rem; padding: .9rem 1rem 1rem; border-radius: 18px; background: var(--po-card); border: 1px solid var(--po-line); }
.share-player-label { margin: 0 0 .6rem; color: var(--po-soft); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.share-player audio { display: block; width: 100%; height: 44px; color-scheme: dark; }

.share-episodes { list-style: none; margin: 0; padding: 0; border-radius: 18px; background: var(--po-card); border: 1px solid var(--po-line); overflow: hidden; }
.share-episodes li + li { border-top: 1px solid var(--po-line); }
.share-episodes a { display: grid; gap: .2rem; padding: .85rem 1rem; text-decoration: none; }
.share-episode-title { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.share-episode-meta { color: var(--po-muted); font-size: .86rem; }
@media (hover: hover) { .share-episodes a:hover { background: rgba(255, 255, 255, .05); } }

.share-shows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: 1rem .9rem; }
.share-shows a { display: grid; gap: .3rem; text-decoration: none; }
.share-art.small { width: 100%; border-radius: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .08); margin-bottom: .25rem; }
.share-show-title { font-weight: 650; font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-show-author { color: var(--po-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.share .landing-footer { flex-wrap: wrap; text-align: center; }

/* Wider screens: artwork beside the words, like the link-preview card. */
@media (min-width: 760px) {
  .share-card { grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 2.5rem; padding: 2.5rem 1.25rem 2rem; text-align: left; }
  .share-art { width: 300px; }
  .share-actions { justify-content: flex-start; }
  .share-body { max-width: 60rem; }
  .share-body > * { max-width: 44rem; }
  .share-body > .share-shows { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .share-button { transition: none; } }
