/* The popups built by js/nudge.js (26 Nov 2026). Tokens only.

   The demo tip (.nudge) sits in the cookie panel's place: the bottom-right
   corner, standing on the cookie button, with the panel's console title row
   but filled mint. The two never show at once: while the cookie
   panel is open the tip is not shown, and it comes back, with its entrance,
   when the panel closes. Same layer as the cookie control (55): over the
   nav, under the phone menu.

   The "thanks for watching" and "thanks for visiting" forms (.nudge-ask)
   open in the middle of the screen as a modal dialog over a dimmed page
   (Joshua, 26 Nov), in the same card look. privacy.html loads no page.css,
   so the derived tints are defined here. */
.nudge, .nudge-ask {
  --nudge-shadow: color-mix(in srgb, var(--color-deep-carbon) 22%, transparent);
  --nudge-hover:  color-mix(in srgb, var(--text-primary) 8%, transparent);
  --nudge-error:  color-mix(in srgb, var(--color-critical) 75%, var(--color-pints-ink));
}
.nudge {
  --nudge-inset:  var(--space-6);

  position: fixed; z-index: 55;
  right: var(--nudge-inset);
  bottom: calc(var(--nudge-inset) + var(--target-min) + var(--space-2));
  width: min(360px, calc(100vw - 2 * var(--nudge-inset)));
  box-sizing: border-box; padding: var(--space-6);
  background: var(--bg-base); color: var(--text-primary);
  border: var(--border-width) solid var(--border-subtle);
  border-top: 2px solid var(--accent);
  box-shadow: 0 12px 40px var(--nudge-shadow);
}
body:has(#consent-panel:not([hidden])) .nudge { display: none; }

/* The tip is mint (Joshua, 26 Nov), which also sets it apart from the
   off-white cookie panel that opens in the same place. Everything on it is
   ink, about 8.6:1 on #00C18B, so the card redefines the text, border and
   focus tokens for its own contents rather than restyling each part. */
.nudge {
  --text-primary:   var(--accent-on);
  --text-secondary: var(--accent-on);
  --text-accent:    var(--accent-on);
  --focus-ring:     var(--accent-on);
  --nudge-hover:    color-mix(in srgb, var(--accent-on) 10%, transparent);
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-on) 18%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .nudge { animation: nudge-in var(--dur-ui) var(--ease-out) both; }
  .nudge.is-leaving { animation: nudge-out 200ms var(--ease-in) both; }
}
@keyframes nudge-in {
  from { opacity: 0; transform: translateY(12px); }
}
@keyframes nudge-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* The forms' dialog: the card in the middle, the page dimmed behind it.
   The card fills the dialog, so a click on the dialog itself is a click on
   the dimmed page (js/nudge.js closes it). */
.nudge-ask {
  width: min(440px, calc(100vw - 2 * var(--space-4)));
  max-width: none; max-height: calc(100dvh - 2 * var(--space-4));
  margin: auto; padding: 0; overflow: auto;
  background: var(--bg-base); color: var(--text-primary);
  border: var(--border-width) solid var(--border-subtle);
  border-top: 2px solid var(--accent);
  box-shadow: 0 24px 64px var(--nudge-shadow);
}
.nudge-ask:focus { outline: none; }
.nudge-ask::backdrop { background: color-mix(in srgb, var(--color-pints-ink) 55%, transparent); }
.nudge-ask__card { padding: var(--space-8); }
@media (max-width: 600px) { .nudge-ask__card { padding: var(--space-6); } }
@media (prefers-reduced-motion: no-preference) {
  .nudge-ask[open] { animation: nudge-pop var(--dur-ui) var(--ease-out) both; }
  .nudge-ask[open]::backdrop { animation: nudge-dim var(--dur-ui) var(--ease-out) both; }
}
@keyframes nudge-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}
@keyframes nudge-dim {
  from { opacity: 0; }
}

/* Title row and close, as on the cookie panel */
.nudge__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.nudge__title {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0; font: 500 15px/1.2 var(--font-sans); color: var(--text-primary);
}
.nudge-ask .nudge__title { font: 600 20px/1.25 var(--font-sans); letter-spacing: -0.2px; }
.nudge-ask .nudge__title svg { width: 20px; height: 20px; }
.nudge-ask .nudge__text { font-size: 15px; }
.nudge__title svg { width: 18px; height: 18px; flex: none; color: var(--text-accent); }
.nudge__close {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0;
  padding: 0; border: none; border-radius: var(--radius-button);
  background: none; color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.nudge__close svg { width: 16px; height: 16px; }
.nudge__close:hover { background: var(--nudge-hover); color: var(--text-primary); }
.nudge__close:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring); outline-offset: 0; }

.nudge__text {
  margin: var(--space-3) 0 0; font: 400 14px/1.55 var(--font-sans); color: var(--text-secondary);
}
.nudge__text strong { font-weight: 600; color: var(--text-primary); }

/* The form: two fields, then the two buttons at the cookie panel's size */
.nudge__form { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.nudge__field {
  display: grid; gap: var(--space-1);
  font: 500 13px/1.3 var(--font-sans); color: var(--text-secondary);
}
.nudge__field input {
  min-width: 0; height: var(--target-min); box-sizing: border-box;
  padding: 0 var(--space-3);
  font: 400 15px/1 var(--font-sans); color: var(--text-primary);
  background: var(--bg-base);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-button);
}
.nudge__field input:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring); outline-offset: 0; }
.nudge__field input[aria-invalid="true"] { border-color: var(--nudge-error); }
.nudge__error { margin: 0; font: 500 13px/1.45 var(--font-sans); color: var(--nudge-error); }
.nudge__error[hidden] { display: none; }

.nudge__actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2);
  margin-top: var(--space-1);
}
.nudge__btn {
  min-width: 0; height: var(--target-min);
  padding: 0 var(--space-4);
  font: 500 15px/1 var(--font-sans);
  border-radius: var(--radius-button);
  border: var(--border-width) solid var(--border-strong);
  background: transparent; color: var(--text-primary);
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.nudge__btn:hover { background: var(--nudge-hover); border-color: var(--text-secondary); }
.nudge__btn:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring); outline-offset: var(--focus-ring-offset); }
/* Send is the one filled button: unlike the cookie choice, the card has an
   answer it hopes for, and No thanks is still one equal-size click away */
.nudge__btn--send { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.nudge__btn--send:hover { background: var(--accent); border-color: var(--accent); filter: brightness(0.95); }
.nudge__btn:disabled { cursor: default; opacity: 0.7; }

.nudge__fine { margin: 0; font: 400 12px/1.5 var(--font-sans); color: var(--text-muted); }
.nudge__fine a { color: var(--text-secondary); text-underline-offset: 3px; }
.nudge__fine a:hover { color: var(--text-primary); }

/* Phones: the corner tightens to the page margin, as the cookie control's does */
@media (max-width: 600px) {
  .nudge { --nudge-inset: var(--space-4); }
}
