/* The cookie preferences growing out of the bar: one dark shell at the bottom of a black page. Three layers live in
   it (the bar, the preferences card, the confirmation pill), each laid out at its own fixed width so nothing reflows
   while the shell changes size; the script measures them and tweens the shell between their sizes. */
:root {
  --page: #000000;          /* the page */
  --shell: #111113;         /* the body of the shell */
  --shell-top: #18181b;     /* the top of its gradient */
  --edge: rgba(255, 255, 255, 0.09); /* its 1px edge */
  --ink: #f1f0ee;           /* the words */
  --muted: #8b8a90;         /* the small words */
  --faint: rgba(255, 255, 255, 0.06); /* the lines between rows */
  --accent: #ffb547;        /* the switches that are on, the check */
  --accent-deep: color-mix(in srgb, var(--accent) 78%, #a8401c); /* the darker end of the switch */
  --button: #f4f3f0;        /* the solid button */
  --button-ink: #0b0b0c;    /* the words on it */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* a warm light under the shell, drawn with a gradient, not a blur */
.glow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(620px, 120vw);
  height: min(320px, 60vh);
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 55%, rgba(255, 181, 71, 0.13) 0%, rgba(255, 181, 71, 0.04) 45%, rgba(255, 181, 71, 0) 72%);
  pointer-events: none;
  opacity: 0;
}

/* an empty box where the open card stands: the poster and the video frame it */
.frame { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; visibility: hidden; }

.shell {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 5vh, 40px);
  width: 320px;
  height: 64px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--shell-top) 0%, var(--shell) 46%),
    var(--shell);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 18px 40px -16px rgba(0, 0, 0, 0.9),
    0 40px 90px -40px rgba(255, 181, 71, 0.18);
  opacity: 0;
}
/* a fine grain over the body, very faint */
.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* the light that runs along the top edge while the shell changes shape */
.shell__sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 214, 150, 0), rgba(255, 214, 150, 0.95) 50%, rgba(255, 214, 150, 0));
  opacity: 0;
  z-index: 3;
  pointer-events: none;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: var(--w, 320px);
  z-index: 2;
}

.tile {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 181, 71, 0.2), rgba(255, 181, 71, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.22), inset 0 1px 0 rgba(255, 220, 170, 0.18);
  color: var(--accent);
}
.tile svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile svg circle { fill: currentColor; stroke: none; }

/* ---------- the bar ---------- */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 12px 12px 14px;
}
.bar__text {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.38;
  color: var(--muted);
}
.bar__text b { color: var(--ink); font-weight: 600; }
.bar__acts { display: flex; gap: 6px; margin-left: auto; }
.bar.is-narrow .bar__acts { width: 100%; }
.bar.is-narrow .bar__acts .btn { flex: 1; }

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: var(--ink);
}
.btn--solid {
  background: var(--button);
  color: var(--button-ink);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 14px -8px rgba(255, 255, 255, 0.35);
}
.btn--ghost.is-hover { background: rgba(255, 255, 255, 0.09); }
.btn--solid.is-hover { background: #ffffff; }
@media (hover: hover) {
  .btn--ghost:hover { background: rgba(255, 255, 255, 0.09); }
  .btn--solid:hover { background: #ffffff; }
}
.btn:focus-visible, .icon-btn:focus-visible, .cat__open:focus-visible, .switch:focus-visible, .pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- the preferences card ---------- */
.panel { padding: clamp(12px, 3.2vh, 16px) clamp(12px, 3.6vw, 16px) clamp(10px, 2.8vh, 14px); }
.panel__head { display: flex; gap: 11px; align-items: flex-start; }
.panel__titles { flex: 1; min-width: 0; }
.panel__title {
  font-size: clamp(14.5px, 4.2vmin, 16px);
  font-weight: 640;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.panel__sub { margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.tile__tick { stroke-width: 1.8; }

.icon-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (hover: hover) { .icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); } }

.cats { list-style: none; margin-top: clamp(8px, 2.4vh, 12px); border-top: 1px solid var(--faint); }
.cat { border-bottom: 1px solid var(--faint); }
.cat__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: clamp(38px, 9.4vh, 46px);
}
.cat__name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.3s;
}
.cat__name small {
  font-size: 11px;
  font-weight: 450;
  color: var(--muted);
  margin-top: 1px;
}
.cat__open {
  position: relative;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 6px;
  text-align: left;
  background: none;
  border: 0;
  padding: 3px 6px 3px 0;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cat__open small { grid-column: 1 / -1; }
.chev {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cat.is-locked .cat__name { color: rgba(241, 240, 238, 0.72); }
.lock { width: 14px; height: 14px; color: var(--muted); }
.lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

.cat__more { height: 0; overflow: hidden; }
.more__text { font-size: 11.5px; line-height: 1.45; color: var(--muted); max-width: 40ch; padding-top: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 0 11px; }
.chip {
  font-size: 10.5px;
  font-weight: 520;
  color: rgba(241, 240, 238, 0.78);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

/* the switch: a track, a fill that grows from the knob, the knob */
.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 22px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.switch[disabled] { cursor: default; filter: saturate(0.35) brightness(0.72); }
.switch__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.55);
  transform-origin: 0% 50%;
  transform: scaleX(0);
}
.switch.is-on .switch__fill { transform: scaleX(1); }
.switch i {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #e9e7e3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 5px -1px rgba(0, 0, 0, 0.35);
}

.panel__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: clamp(10px, 2.6vh, 14px);
}
.count { flex: 1; font-size: 12px; color: var(--muted); white-space: nowrap; }
.count__num {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  height: 1.25em;
  min-width: 0.62em;
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
}
.count__num span { display: block; line-height: 1.25em; text-align: center; }
.count__num span + span { position: absolute; left: 0; right: 0; top: 0; }

/* ---------- the confirmation pill ---------- */
.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  border-radius: 22px;
}
.pill__check { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill__check circle { stroke: rgba(255, 181, 71, 0.28); }
.pill__text { font-size: 13px; font-weight: 600; font-variation-settings: "wdth" 102; }
.pill__meta { font-size: 12px; color: var(--muted); padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.12); }

.panel, .pill { visibility: hidden; }

/* the drawn pointer of the autopilot */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
