/* =========================================================
   Ezro — shared design system (site, watch page, admin)
   ========================================================= */
:root {
  --brand: #905abd;
  --brand-2: #b491dc;
  --brand-grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --good: #34c77b; --warn: #f0b24a; --bad: #ff5d6c; --info: #8f9bff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0b12;
  --bg-2: #13111a;
  --panel: #17151e;
  --panel-2: #1d1a26;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --hover: rgba(180, 145, 220, .10);
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(180, 145, 220, .22);
  --text: #f4f0fa;
  --text-2: #c9bfd6;
  --muted: #968aa6;
  --glass: rgba(22, 19, 30, .72);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .7);
  --shadow-brand: 0 12px 36px -12px color-mix(in srgb, var(--brand) 70%, transparent);
  --orb-opacity: .5;
}
:root[data-theme="light"] {
  /* Apple-like light: neutral paper, pure white cards, soft shadows, purple only as accent */
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-2: #ececf1;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --surface: rgba(255, 255, 255, .82);
  --surface-2: #ffffff;
  --hover: rgba(144, 90, 189, .07);
  --border: rgba(0, 0, 0, .08);
  --border-2: rgba(144, 90, 189, .32);
  --text: #1d1d1f;
  --text-2: #3a3a3f;
  --muted: #6e6e73;
  --glass: rgba(255, 255, 255, .62);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 16px 40px -18px rgba(40, 20, 70, .22);
  --shadow-brand: 0 10px 26px -12px color-mix(in srgb, var(--brand) 60%, transparent);
  --orb-opacity: .16;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.5;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- icons ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.fill { fill: currentColor; stroke: none; }
.i-img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; }

/* ---------- background ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx .orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: var(--orb-opacity); animation: orb 22s ease-in-out infinite alternate; }
.bg-fx .orb.a { width: 560px; height: 560px; background: var(--brand); top: -220px; left: -180px; }
.bg-fx .orb.b { width: 480px; height: 480px; background: var(--brand-2); bottom: -240px; right: -160px; animation-delay: -11s; }
.bg-fx .grid {
  position: absolute; inset: 0; opacity: .45;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 10%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 10%, #000 10%, transparent 70%);
}
body.no-orbs .bg-fx .orb, body.no-grid .bg-fx .grid { display: none; }
@keyframes orb { to { transform: translate(70px, 50px) scale(1.12); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .25s, opacity .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--border-2); background: var(--hover); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn.square { border-radius: var(--radius-sm); }
.btn .spinner { width: 16px; height: 16px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- form controls ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .textarea, select.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-wrap > .input { padding-left: 40px; }
.input-wrap .suffix { position: absolute; right: 14px; color: var(--muted); font-size: 13px; pointer-events: none; }
input[type="color"].input { padding: 4px; width: 52px; cursor: pointer; }
input[type="range"] { accent-color: var(--brand); width: 100%; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* iOS switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: background .3s var(--ease); }
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .35s var(--spring), width .2s;
}
.switch:active .track::after { width: 27px; }
.switch input:checked + .track { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch:active input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* checkbox */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { appearance: none; width: 22px; height: 22px; flex: none; margin: 0; border-radius: 7px; border: 1.5px solid var(--border-2); background: var(--surface); display: grid; place-items: center; transition: background .2s, transform .25s var(--spring); }
.check input:checked { background: var(--brand-grad); border-color: transparent; transform: scale(1.06); }
.check input:checked::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }

/* segmented control (sliding pill) */
.seg {
  position: relative; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; height: 34px; padding: 0 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .25s;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button.on { color: var(--text); }
.seg .pill {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: 999px;
  background: var(--panel-2); box-shadow: 0 3px 10px rgba(0, 0, 0, .18), 0 0 0 1px var(--border);
  transition: transform .45s var(--spring), width .45s var(--spring);
}
:root[data-theme="light"] .seg .pill { background: #fff; }
.seg.brand .pill { background: var(--brand-grad); box-shadow: var(--shadow-brand); }
.seg.brand button.on { color: #fff; }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; justify-content: center; }

/* Apple-style select */
.aselect { position: relative; min-width: 0; }
.aselect-btn {
  width: 100%; height: 44px; padding: 0 38px 0 14px; display: flex; align-items: center; gap: 9px; text-align: left;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.aselect-btn:hover { border-color: var(--border-2); }
.aselect-btn[aria-expanded="true"] { border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.aselect-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aselect-btn .chev { position: absolute; right: 12px; color: var(--muted); transition: transform .3s var(--spring); }
.aselect-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.aselect.sm .aselect-btn { height: 36px; font-size: 13px; }
.menu {
  position: fixed; z-index: 1000; min-width: 200px; max-height: min(360px, 60vh); overflow-y: auto; padding: 6px;
  border-radius: 14px; background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--shadow); transform-origin: top center;
  animation: menuIn .32s var(--spring);
}
.menu.up { transform-origin: bottom center; }
.menu.closing { animation: menuOut .16s var(--ease) forwards; }
@keyframes menuIn { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
@keyframes menuOut { to { opacity: 0; transform: scale(.96); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px;
  text-align: left; font-size: 14px; color: var(--text);
}
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item .tick { margin-left: auto; color: var(--brand-2); opacity: 0; }
.menu-item[aria-selected="true"] .tick { opacity: 1; }
.menu-item.danger { color: var(--bad); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }

/* ---------- cards / chips / badges ---------- */
.card { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.glass { background: var(--glass); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
body.no-glass .glass { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip.brand { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-2); border-color: transparent; }
:root[data-theme="light"] .chip.brand { color: var(--brand); }
.chip.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); border-color: transparent; }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #d99422; border-color: transparent; }
.chip.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); border-color: transparent; }
.chip.solid-warn { background: var(--warn); color: #2a1a00; border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-grad); overflow: hidden; }

/* ---------- sheets / dialogs ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 5, 14, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .3s var(--ease);
}
.overlay.closing { animation: fadeOut .25s var(--ease) forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: relative; width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  border-radius: 26px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .6);
  animation: sheetIn .5s var(--spring); overflow: hidden;
}
.sheet.wide { width: min(880px, 100%); }
.sheet.xl { width: min(1100px, 100%); }
.overlay.closing .sheet { animation: sheetOut .25s var(--ease) forwards; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(16px) scale(.97); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 12px; }
.sheet-head h3 { font-size: 19px; flex: 1; }
.sheet-body { padding: 8px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--panel-2); flex-wrap: wrap; }
.sheet-foot .spacer { flex: 1; }
.drawer-right { place-items: stretch end; padding: 12px; }
.drawer-right .sheet-body { flex: 1; }
.drawer-right .sheet { height: 100%; max-height: none; width: min(460px, 100%); animation-name: drawerIn; }
.overlay.drawer-right.closing .sheet { animation: drawerOut .28s var(--ease) forwards; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes drawerOut { to { transform: translateX(40px); opacity: 0; } }
@media (max-width: 640px) {
  .overlay { place-items: end stretch; padding: 0; }
  .overlay .sheet, .drawer-right .sheet { width: 100%; max-height: 92vh; height: auto; border-radius: 26px 26px 0 0; animation-name: sheetUp; }
  .overlay.closing .sheet { animation: sheetDown .28s var(--ease) forwards; }
  .sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 9px; background: var(--border-2); }
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }

.alert { width: min(340px, 100%); text-align: center; border-radius: 22px; }
.alert .sheet-body { padding: 26px 22px 18px; }
.alert h3 { font-size: 17px; margin-bottom: 6px; }
.alert p { color: var(--muted); font-size: 14px; }
.alert .sheet-foot { justify-content: stretch; background: none; padding: 0; gap: 0; }
.alert .sheet-foot .btn { flex: 1; border-radius: 0; height: 50px; border: 0; border-right: 1px solid var(--border); background: none; box-shadow: none; }
.alert .sheet-foot .btn:last-child { border-right: 0; }
.alert .sheet-foot .btn.primary { color: var(--brand-2); background: none; }
.alert .sheet-foot .btn.danger { color: var(--bad); }
@media (max-width: 640px) { .overlay .alert { margin: 0 16px 24px; width: auto; border-radius: 22px; } }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2000; display: grid; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  animation: toastIn .55s var(--spring); max-width: calc(100vw - 32px);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .i { color: var(--brand-2); }
.toast.error .i { color: var(--bad); }
.toast.success .i { color: var(--good); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.8); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.9); } }

/* ---------- misc ---------- */
.empty { display: grid; place-items: center; gap: 10px; padding: 36px 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border); border-radius: var(--radius); font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(22px) scale(.985); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.theme-btn .sun, :root[data-theme="light"] .theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* upload */
.upload-box { position: relative; display: grid; place-items: center; gap: 6px; padding: 18px; border-radius: var(--radius-sm); border: 1.5px dashed var(--border-2); background: var(--surface); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; }
.upload-box:hover, .upload-box.drag { border-color: var(--brand-2); background: var(--hover); color: var(--text); }
.upload-box img, .upload-box video { max-height: 160px; border-radius: 10px; }
.upload-box .up-hint { margin-top: 4px; font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 99px; background: var(--hover); }
.icon-picker { display: grid; gap: 12px; }
.icon-own { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.icon-own .prev { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--hover); border: 1.5px dashed var(--border-2); overflow: hidden; }
.icon-own.on .prev { border: 2px solid var(--brand); }
.icon-own .prev img { width: 30px; height: 30px; object-fit: contain; }
.icon-own .tt { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.icon-own .tt span { color: var(--muted); font-size: 12px; }
.dl-rows { display: grid; gap: 8px; }
.dl-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.dl-row .handle { cursor: grab; color: var(--muted); display: grid; }
.dl-row input { flex: 1; min-width: 0; }
.dl-row small { color: var(--muted); white-space: nowrap; }
.code-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; }
.code-row .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.code-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.progress { height: 6px; width: 100%; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--brand-grad); transition: width .2s; }

/* drag & drop */
.drag-ghost { position: fixed !important; z-index: 3000; pointer-events: none; margin: 0 !important; transform-origin: center; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .55) !important; transition: none !important; }
.drag-ghost.lifted { animation: lift .3s var(--spring) forwards; }
@keyframes lift { to { scale: 1.03; rotate: 1.2deg; } }
.drag-placeholder { border-radius: var(--radius-sm); border: 1.5px dashed var(--border-2); background: var(--hover); transition: height .2s; }
.handle { cursor: grab; color: var(--muted); touch-action: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- smooth theme switching ---------- */
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
  transition: background-color .6s var(--ease), color .6s var(--ease), border-color .6s var(--ease), fill .6s, box-shadow .6s !important;
}
/* the new theme spreads out from the button as a soft, feathered circle (no hard edge), while the old one gently dims */
@property --vt-r { syntax: '<length>'; inherits: true; initial-value: 0px; }
.theme-vt::view-transition-old(root) { animation: themeDim 1s cubic-bezier(.45, 0, .2, 1) both; mix-blend-mode: normal; }
.theme-vt::view-transition-new(root) {
  z-index: 2; mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(circle at var(--vt-x, 90%) var(--vt-y, 30px), #000 calc(var(--vt-r) - 220px), transparent var(--vt-r));
  mask-image: radial-gradient(circle at var(--vt-x, 90%) var(--vt-y, 30px), #000 calc(var(--vt-r) - 220px), transparent var(--vt-r));
  animation: themeReveal 1s cubic-bezier(.45, 0, .2, 1) both;
}
@keyframes themeReveal { from { --vt-r: 0px; } to { --vt-r: var(--vt-max, 2400px); } }
.theme-vt-fade::view-transition-old(root) { animation: vtFadeOut .7s cubic-bezier(.4, 0, .2, 1) both; }
.theme-vt-fade::view-transition-new(root) { animation: vtFadeIn .7s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } }
@keyframes themeDim { from { opacity: 1; filter: none; } to { opacity: .85; filter: saturate(.9); } }
.theme-btn .i { transition: transform .6s var(--spring); animation: themeIcon .7s var(--spring) both; }
@keyframes themeIcon { from { opacity: 0; transform: rotate(-90deg) scale(.4); } }
.theme-btn:active .i { transform: rotate(-40deg) scale(.8); }

/* ---------- page transitions (home ⇄ product) ---------- */
::view-transition-old(root) { animation: vtOut .35s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .5s var(--ease) both; }
::view-transition-group(product-hero) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
@keyframes vtOut { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vtIn { from { opacity: 0; transform: scale(1.01); filter: blur(4px); } }

/* ---------- scrollbars: transparent track, glossy purple thumb like the logo ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent; border-radius: 99px; background-clip: padding-box;
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 85%, #fff) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 80%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
::-webkit-scrollbar-thumb:hover { border-width: 2px; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--brand) 80%, transparent) transparent; }
}
