/* Consent panel chrome.
 *
 * The panel is site chrome, not a third-party bar, so it is built from the
 * floating-glass recipe the rest of the site already uses — the same hairline,
 * radius, gradient, blur and shadow carried by the download CTA once it floats
 * (overlook-desktop.html), the sign-in panel on app.playhead.fm, and the team
 * cards on /about. Values are repeated literally rather than shared because this
 * stylesheet is injected into two page families that load different token
 * sheets; every var() below therefore carries a fallback.
 *
 * Corner-anchored rather than a full-width bar for the same reason: every other
 * floating surface on this site is a compact panel in a corner, and the download
 * CTA already owns the bottom-right one.
 */

.ph-consent {
  position: fixed;
  z-index: 2147483000;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  width: min(420px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 240, 210, 0.07);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 22, 19, 0.3) 0%, rgba(15, 13, 11, 0.22) 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 210, 0.05);
  color: var(--fg, #f2f0eb);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  animation: ph-consent-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ph-consent[hidden] {
  display: none;
}

@keyframes ph-consent-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.ph-consent__copy {
  min-width: 0;
}

/* The link trails the title on its baseline rather than being pushed to the far
   edge, so the two read as one phrase and its aside instead of as a split row. */
.ph-consent__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

/* Display serif at this size is the site's floater headline — the download CTA
   sets "Join the public beta" the same way. */
.ph-consent__title {
  margin: 0;
  color: var(--gold-2, #f7eddd);
  font-family: var(--f-display, "PP Museum", "Cormorant Garamond", "Times New Roman", serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

.ph-consent__title:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 4px;
}

.ph-consent__text {
  margin: 0;
  color: var(--fg-2, #b5b0a6);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.ph-consent__learn {
  flex: none;
  color: var(--gold-hot, #d5b484);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease;
}

.ph-consent__learn:hover {
  color: var(--gold-3, #eedbbc);
}

.ph-consent__learn:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Equal columns, one treatment: accepting and rejecting have to read as equally
   available, so neither control gets the filled ember pill the site gives a
   primary action. Both are the site's quiet glass pill (the walkthrough's step
   nav), which puts the emphasis on the pair rather than on one answer. */
.ph-consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ph-consent__choice {
  appearance: none;
  margin: 0;
  min-height: 38px;
  padding: 8px 12px;
  line-height: 1.4;
  border: 1px solid rgba(255, 240, 210, 0.14);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.5);
  color: var(--fg-2, #b5b0a6);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease,
    transform 120ms ease;
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
}

.ph-consent__choice:hover {
  border-color: rgba(214, 168, 96, 0.4);
  color: var(--fg, #f2f0eb);
}

.ph-consent__choice:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 2px;
}

.ph-consent__choice:active {
  background: rgba(214, 168, 96, 0.08);
  transform: scale(0.96);
}

/* The reopen control. It used to be planted in every footer and was sized to match the
   footer's own links; it now lives in the privacy policy's Cookies section, where the
   policy tells the reader to find it. So it is sized to that page's prose and wears the
   same underlined-link treatment the legal pages give their other links — at 11px and
   --fg-3 it read as footer chrome that had wandered into a paragraph. */
.ph-cookie-settings {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-2, #b5b0a6);
  font-family: var(--f-sans, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.75;
  text-decoration: underline;
  text-decoration-color: #2b2825;
  text-underline-offset: 0.18em;
  cursor: pointer;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.ph-cookie-settings:hover {
  color: var(--fg, #f2f0eb);
  text-decoration-color: currentColor;
}

.ph-cookie-settings:focus-visible {
  outline: 2px solid rgba(221, 183, 123, 0.8);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Narrow: the panel takes the full gutter width. The choices keep their two
   columns and wrap to two lines only where they no longer fit on one — together,
   per the verb rule above. */
@media (max-width: 520px) {
  .ph-consent {
    right: max(18px, env(safe-area-inset-right));
    width: auto;
    gap: 16px;
    padding: 18px;
  }

  .ph-consent__choice {
    min-height: 44px;
    padding: 8px 10px;
  }

  /* The labels differ by only a few pixels, so their verbs share an intrinsic
     width to keep both controls wrapping at the same point on narrow screens. */
  .ph-consent__choice-verb {
    display: inline-block;
    min-width: 5.5em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-consent {
    animation: none;
  }

  .ph-consent__choice,
  .ph-consent__learn,
  .ph-cookie-settings {
    transition: none;
  }

  .ph-consent__choice:active {
    transform: none;
  }
}
