/* Paddock design system — red / black / white, yellow for points & premium.
   Loaded last on every page. Section 1-4: tokens, base, components (pd-*), shell.
   Section 5: legacy re-skin of components still rendered by site.js. */

/* ===================== 1. Tokens ===================== */

:root {
  --pd-bg: #0b0b0c;
  --pd-panel: #141415;
  --pd-panel-2: #1c1c1e;
  --pd-line: #2a2a2d;
  --pd-line-2: #222225;
  --pd-ink: #f4f4f1;
  --pd-soft: #c9c9ce;
  --pd-mute: #8c8c92;
  --pd-red: #e10a17;
  --pd-red-hi: #ff3d41;
  --pd-red-dark: #b5000d;
  --pd-yellow: #ffd100;
  --pd-display: "Archivo", "Arial Narrow", sans-serif;
  --pd-mono: "JetBrains Mono", ui-monospace, monospace;
  --pd-slant: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  --pd-slant-sm: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  --pd-cut: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  --pd-cut-sm: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  --pd-gutter: clamp(16px, 3vw, 32px);
  --pd-max: 1376px;
  --pd-header-h: 68px;

  --bg: var(--pd-bg);
  --panel: var(--pd-panel);
  --panel-strong: var(--pd-panel-2);
  --ink: var(--pd-ink);
  --ink-soft: var(--pd-soft);
  --muted: var(--pd-mute);
  --line: var(--pd-line);
  --line-dark: var(--pd-line);
  --line-soft: var(--pd-line);
  --blue: var(--pd-red);
  --red: var(--pd-red);
  --yellow: var(--pd-yellow);
  --dark: var(--pd-panel);
  color-scheme: dark;
}

/* ===================== 2. Base ===================== */

*,
*::before,
*::after {
  border-color: var(--pd-line) !important;
}

* {
  scrollbar-color: var(--pd-red) transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--pd-red);
  background-clip: padding-box;
}

html,
body,
.site-main {
  background: var(--pd-bg) !important;
}

body {
  color: var(--pd-ink);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-stretch: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--pd-red);
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: -0.01em !important;
}

h1 { line-height: 0.92 !important; }
h2 { line-height: 0.95; }
h3 { font-stretch: 112%; font-weight: 800 !important; line-height: 1.12; }

a { transition: color 0.15s ease; }

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pd-red) !important;
  outline-offset: 2px;
}

input[type="checkbox"],
input[type="radio"],
input[type="range"] {
  accent-color: var(--pd-red);
}

/* ===================== 3. Components (pd-*) ===================== */

.pd-container {
  width: 100%;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 0 var(--pd-gutter);
  box-sizing: border-box;
}

.pd-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pd-d {
  margin: 0;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900 !important;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.pd-m {
  font-family: var(--pd-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pd-mute);
}

.pd-kicker {
  font-family: var(--pd-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--pd-red-hi);
}

.pd-kicker--yellow { color: var(--pd-yellow); }
.pd-ink { color: var(--pd-ink) !important; }
.pd-red { color: var(--pd-red-hi) !important; }
.pd-yellow { color: var(--pd-yellow) !important; }

.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 30px;
  border: 0;
  cursor: pointer;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  clip-path: var(--pd-slant);
  background: var(--pd-red);
  color: #fff;
}

.pd-btn:hover { background: #ff2a33; color: #fff; }
.pd-btn--lg { min-height: 56px; padding: 0 36px; font-size: 16px; }
.pd-btn--sm { min-height: 40px; padding: 0 20px; font-size: 12px; }
.pd-btn--ghost { background: #1f1f22; color: var(--pd-ink); }
.pd-btn--ghost:hover { background: #2c2c30; color: #fff; }
.pd-btn--white { background: var(--pd-ink); color: var(--pd-bg); }
.pd-btn--white:hover { background: #fff; color: var(--pd-red); }
.pd-btn--yellow { background: var(--pd-yellow); color: var(--pd-bg); }
.pd-btn--yellow:hover { background: #ffe14d; color: var(--pd-bg); }
.pd-btn--black { background: var(--pd-bg); color: var(--pd-yellow); }
.pd-btn--black:hover { background: #1f1f22; color: var(--pd-yellow); }
.pd-btn[disabled],
.pd-btn.is-disabled { background: #1f1f22; color: #6e6e74; cursor: not-allowed; }

.pd-ib {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--pd-line);
  background: transparent;
  color: var(--pd-ink);
  cursor: pointer;
  flex: none;
}

.pd-ib:hover { border-color: var(--pd-ink) !important; color: #fff; }
.pd-ib svg { width: 20px; height: 20px; }

.pd-meter {
  position: relative;
  height: 12px;
  background: repeating-linear-gradient(110deg, #2a2a2d 0 5px, transparent 5px 9px);
}

.pd-meter > i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, var(--pd-ink) 55%, var(--pd-red-hi));
  -webkit-mask: repeating-linear-gradient(110deg, #000 0 5px, transparent 5px 9px);
  mask: repeating-linear-gradient(110deg, #000 0 5px, transparent 5px 9px);
}

.pd-meter--yellow > i { background: linear-gradient(90deg, var(--pd-ink) 45%, var(--pd-yellow)); }
.pd-meter--thin { height: 8px; }
.pd-meter--lg { height: 18px; }

.pd-pos {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  background: var(--pd-ink);
  color: var(--pd-bg);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 14px;
  clip-path: var(--pd-slant-sm);
}

.pd-pos.is-p1 { background: var(--pd-red); color: #fff; }
.pd-pos.is-gold { background: var(--pd-yellow); color: var(--pd-bg); }

.pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--pd-line);
  background: transparent;
  color: var(--pd-soft);
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.pd-chip:hover { border-color: var(--pd-ink) !important; color: #fff; }
.pd-chip.is-on,
.pd-chip[aria-pressed="true"] { background: var(--pd-ink); color: var(--pd-bg); border-color: var(--pd-ink) !important; }

.pd-slanttab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  background: var(--pd-panel);
  color: var(--pd-soft);
  cursor: pointer;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.pd-slanttab:hover { background: #232326; color: #fff; }
.pd-slanttab.is-on,
.pd-slanttab[aria-selected="true"],
.pd-slanttab[aria-pressed="true"] { background: var(--pd-ink); color: var(--pd-bg); }
.pd-slanttab small { font-family: var(--pd-mono); font-style: normal; font-weight: 500; font-size: 10px; letter-spacing: 0.08em; opacity: 0.7; }

.pd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  border-bottom: 1px solid var(--pd-line);
}

.pd-tab {
  padding: 16px 4px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #b4b4ba;
  cursor: pointer;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
}

.pd-tab:hover { color: #fff; }
.pd-tab.is-on,
.pd-tab[aria-selected="true"] { color: var(--pd-ink); border-bottom-color: var(--pd-red) !important; }

.pd-panel {
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
}

.pd-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
}

.pd-panel-head h2,
.pd-panel-head h3 { margin: 0; font-size: 22px; }

.pd-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-top: 1px solid var(--pd-line-2) !important;
  color: var(--pd-ink);
  text-decoration: none;
}

a.pd-row:hover { background: #18181a; color: #fff; }

.pd-cover {
  position: relative;
  overflow: hidden;
  clip-path: var(--pd-cut);
  background-color: var(--pd-panel-2);
  background-size: cover;
  background-position: center;
}

.pd-cover--sm { clip-path: var(--pd-cut-sm); }

.pd-cover-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 5px 8px;
  background: var(--pd-bg);
  color: var(--pd-ink);
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pd-cover-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  padding: 6px 10px;
  background: var(--pd-ink);
  color: var(--pd-bg);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

.pd-cover-num {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
}

.pd-cover-title {
  position: absolute;
  right: 14px;
  bottom: 22px;
  left: 14px;
  z-index: 2;
  margin: 0;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 28px;
  line-height: 1.12;
  text-transform: uppercase;
}

.pd-tt {
  display: inline;
  padding: 2px 8px;
  background: var(--pd-bg);
  color: var(--pd-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Poster patterns: used when a list has no image, or as decoration */
.pd-pat-a { background: #f4f4f1 linear-gradient(90deg, #0b0b0c 0 7%, transparent 7% 12%, #e10a17 12% 19%, transparent 19% 23%, #0b0b0c 23% 25%, transparent 25% 33%, #e10a17 33% 46%, transparent 46% 50%, #0b0b0c 50% 58%, transparent 58% 61%, #e10a17 61% 63%, transparent 63% 70%, #0b0b0c 70% 72%, transparent 72% 78%, #e10a17 78% 90%, transparent 90% 93%, #0b0b0c 93%); }
.pd-pat-b { background: linear-gradient(160deg, transparent 0 58%, #0b0b0c 58%), linear-gradient(90deg, #e10a17 0 18%, #0b0b0c 18% 22%, #e10a17 22% 40%, #ffd100 40% 42%, #e10a17 42% 66%, #0b0b0c 66% 74%, #e10a17 74%); }
.pd-pat-c { background: linear-gradient(90deg, #0b0b0c 10%, transparent 80%), repeating-linear-gradient(180deg, #0b0b0c 0 13px, #e10a17 13px 16px); }
.pd-pat-d { background: repeating-linear-gradient(135deg, #ffd100 0 18px, #0b0b0c 18px 36px); }
.pd-pat-e { background: linear-gradient(115deg, #f4f4f1 0 42%, #e10a17 42% 60%, #0b0b0c 60% 64%, #f4f4f1 64%); }
.pd-pat-f { background: #e10a17 linear-gradient(90deg, transparent 0 50%, #0b0b0c 50% 55%, transparent 55% 59%, #0b0b0c 59% 70%, transparent 70% 72%, #f4f4f1 72% 73.5%, transparent 73.5% 80%, #0b0b0c 80% 88%, transparent 88% 91%, #0b0b0c 91%); }
.pd-pat-hatch { background: #1c1c1e repeating-linear-gradient(135deg, transparent 0 10px, #222225 10px 11px); }

.pd-stripe {
  height: 10px;
  background: #f4f4f1 linear-gradient(90deg, #0b0b0c 0 7%, transparent 7% 12%, #e10a17 12% 19%, transparent 19% 23%, #0b0b0c 23% 25%, transparent 25% 33%, #e10a17 33% 46%, transparent 46% 50%, #0b0b0c 50% 58%, transparent 58% 61%, #ffd100 61% 63%, transparent 63% 70%, #0b0b0c 70% 72%, transparent 72% 78%, #e10a17 78% 90%, transparent 90% 93%, #0b0b0c 93%);
}

.pd-ghost {
  color: transparent !important;
  -webkit-text-stroke: 1.5px #26262a;
  pointer-events: none;
  user-select: none;
}

.pd-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.pd-stat strong,
.pd-stat .pd-stat-value {
  display: block;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 44px;
  line-height: 0.95;
  text-transform: uppercase;
}

.pd-stat span,
.pd-stat .pd-stat-label {
  display: block;
  margin-top: 6px;
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pd-mute);
}

.pd-slash {
  width: 2px;
  height: 56px;
  background: var(--pd-red);
  transform: skewX(-18deg);
  flex: none;
}

.pd-section {
  padding-bottom: 72px;
}

.pd-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.pd-section-head h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 3vw, 40px);
}

.pd-section-head .pd-kicker { letter-spacing: 0.5em; }

.pd-link {
  color: var(--pd-ink);
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.pd-link:hover { color: var(--pd-red-hi); }

.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.pd-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  background: #2a2a2d;
  background-size: cover;
  background-position: center;
  color: var(--pd-ink);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.pd-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 48px 28px;
  border: 1px dashed #3a3a3e !important;
  color: var(--pd-soft);
}

.pd-skel {
  background: linear-gradient(90deg, #141415 0, #1f1f22 40%, #141415 80%);
  background-size: 200% 100%;
  animation: pd-skel 1.2s linear infinite;
}

@keyframes pd-skel { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .pd-skel { animation: none; }
}

/* ===================== 4. Shell ===================== */

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: flex !important;
  align-items: center;
  gap: 16px;
  height: var(--pd-header-h) !important;
  min-height: var(--pd-header-h);
  padding: 0 var(--pd-gutter) 0 0 !important;
  background: var(--pd-bg) !important;
  border-bottom: 1px solid var(--pd-line) !important;
  grid-template-columns: none !important;
}

body .topbar,
body.site-dark-mode .topbar {
  background: var(--pd-bg) !important;
}

.topbar::after {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 380px;
  max-width: 70%;
  height: 3px;
  background: linear-gradient(90deg, var(--pd-red) 0 56%, transparent 56% 60%, var(--pd-ink) 60% 64%, transparent 64% 70%, var(--pd-yellow) 70% 74%, transparent 74%);
  content: "";
  pointer-events: none;
}

.topbar-left {
  display: flex !important;
  align-self: stretch;
  align-items: center;
  gap: 12px;
  padding: 0 28px 0 var(--pd-gutter);
  border-right: 1px solid var(--pd-line);
}

.brand {
  display: flex !important;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark,
.footer-mark {
  display: block !important;
  width: 18px !important;
  min-width: 18px;
  height: 26px !important;
  padding: 0 !important;
  border: 0 !important;
  background: linear-gradient(90deg, var(--pd-red) 0 58%, transparent 58% 74%, var(--pd-yellow) 74%) !important;
  color: transparent !important;
  font-size: 0 !important;
  clip-path: none !important;
  transform: skewX(-18deg);
  box-shadow: none !important;
}

.brand-name,
.footer-brand h2 {
  display: inline !important;
  color: var(--pd-ink) !important;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900 !important;
  font-size: 22px !important;
  letter-spacing: -0.01em !important;
  line-height: 1 !important;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-name b,
.pd-versus {
  color: var(--pd-red-hi);
  font-weight: inherit;
}

.pd-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  min-width: 0;
  margin-left: -4px;
}

.pd-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: -8px;
  padding: 0 24px;
  color: #a9a9af;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}

.pd-nav-link i {
  color: var(--pd-red-hi);
  font-family: var(--pd-mono);
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.pd-nav-link:hover { background: var(--pd-panel-2); color: #fff; }
.pd-nav-link.is-active,
.pd-nav-link.is-active:hover { background: var(--pd-red); color: #fff; }
.pd-nav-link.is-active i { color: var(--pd-yellow); }
.pd-nav-link[hidden] { display: none !important; }

.topbar .search-form::before,
.topbar .search-form::after {
  display: none !important;
}

.topbar .search-form {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 44px;
  max-width: 640px;
  height: 44px;
  margin-left: auto;
  padding: 0 14px;
  background: var(--pd-panel) !important;
  border: 1px solid var(--pd-line) !important;
  border-left: 3px solid var(--pd-red) !important;
  clip-path: none !important;
}

.topbar .search-form input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--pd-ink);
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.topbar .search-form input::placeholder { color: var(--pd-mute); }
.topbar .search-form .ui-icon { width: 18px; height: 18px; color: var(--pd-mute); }

.topbar-actions {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

.pd-create {
  min-height: 44px !important;
  padding: 0 22px !important;
}

.pd-create.is-active { background: var(--pd-ink); color: var(--pd-bg); }

.auth-header-button {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px !important;
  background: var(--pd-panel) !important;
  border: 1px solid var(--pd-line) !important;
  color: var(--pd-ink) !important;
  clip-path: var(--pd-slant) !important;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
}

.auth-header-button[data-auth-signed-in="true"] {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  clip-path: none !important;
}

.auth-header-button[data-auth-signed-in="true"]::before {
  background-color: var(--pd-ink) !important;
  color: var(--pd-bg) !important;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
}

.notification-header-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  background: transparent !important;
  border: 1px solid var(--pd-line) !important;
  color: var(--pd-ink) !important;
  clip-path: none !important;
}

.notification-count {
  background: var(--pd-red) !important;
  color: #fff !important;
  border-radius: 0 !important;
  font-family: var(--pd-mono);
  font-weight: 700;
}

.site-main {
  margin-left: 0 !important;
  padding-top: var(--pd-header-h) !important;
}

.menu-button {
  display: none !important;
}

/* Drawer (mobile) — the legacy sidebar is kept for site.js hooks */
.sidebar {
  background: var(--pd-bg) !important;
  clip-path: none !important;
  border-right: 1px solid var(--pd-line) !important;
}

.sidebar .nav-link {
  border-left: 4px solid transparent !important;
  color: #a9a9af !important;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  clip-path: none !important;
}

.sidebar .nav-link:hover { background: var(--pd-panel-2) !important; color: #fff !important; }
.sidebar .nav-link.active { background: var(--pd-red) !important; border-left-color: var(--pd-yellow) !important; color: #fff !important; }
.sidebar .nav-link::after { display: none !important; }
.subscription-panel,
.subscription-user { background: var(--pd-panel) !important; }
.mini-avatar { background: var(--pd-red) !important; clip-path: none !important; }

.topbar-left,
.pd-nav,
.topbar-actions {
  flex: none;
}

.brand-name {
  overflow: visible !important;
  text-overflow: clip !important;
}

/* The search fills the free space of the header. When that space gets too tight (site.js adds
   .is-compact) it becomes an icon, and on focus its field drops below the header instead of
   covering the other header items. */
@media (min-width: 761px) {
  .topbar .search-form.is-compact {
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
    justify-content: center;
    border-left-width: 1px !important;
  }

  .topbar .search-form.is-compact input {
    position: absolute;
    inset: 0;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
    padding: 0 !important;
    opacity: 0;
    cursor: pointer;
  }

  .topbar .search-form.is-compact .ui-icon { pointer-events: none; }

  .topbar .search-form.is-compact:focus-within { border-left-width: 3px !important; }

  html body .topbar .search-form.is-compact:focus-within input {
    inset: calc(100% + 10px) 0 auto auto;
    width: min(360px, calc(100vw - 32px)) !important;
    height: 46px;
    padding: 0 14px !important;
    opacity: 1;
    cursor: text;
    background: var(--pd-panel) !important;
    border: 1px solid var(--pd-line) !important;
    border-left: 3px solid var(--pd-red) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 1320px) and (min-width: 1121px) {
  .pd-nav-link { padding: 0 16px; font-size: 12.5px; }
  .topbar-left { padding-right: 18px; }
  .brand-name { font-size: 19px !important; }
}

@media (min-width: 1121px) {
  .sidebar,
  .sidebar-backdrop {
    display: none !important;
  }

  :root,
  body.sidebar-collapsed {
    --sidebar-width: 0px;
    --topbar-height: 68px;
  }
}

@media (max-width: 1120px) {
  :root { --topbar-height: 64px; --pd-header-h: 64px; }

  .pd-nav,
  .pd-create { display: none !important; }

  .topbar-left { border-right: 0; padding-right: 8px; }

  .menu-button {
    display: grid !important;
    place-content: center;
    gap: 4px;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    background: var(--pd-panel) !important;
    border: 1px solid var(--pd-line) !important;
    clip-path: none !important;
  }

  .menu-button span {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    margin: 0 !important;
    background: var(--pd-ink) !important;
  }

  .topbar .search-form { max-width: none; }
}

@media (max-width: 760px) {
  .topbar .brand,
  .topbar .brand-name { display: flex !important; }
  .topbar .brand-name { display: inline !important; font-size: 18px !important; }
  .topbar .search-form { flex: 0 0 44px; width: 44px; padding: 0; justify-content: center; border-left-width: 1px !important; }
  .topbar .search-form input { display: none; }
  .auth-header-button:not([data-auth-signed-in="true"]) { padding: 0 14px !important; }
}

/* Footer */
.footer {
  position: relative;
  margin-top: 0 !important;
  background: var(--pd-bg) !important;
  border-top: 1px solid var(--pd-line) !important;
  clip-path: none !important;
}

.footer::before {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 8px;
  background: #f4f4f1 linear-gradient(90deg, #0b0b0c 0 7%, transparent 7% 12%, #e10a17 12% 19%, transparent 19% 23%, #0b0b0c 23% 25%, transparent 25% 33%, #e10a17 33% 46%, transparent 46% 50%, #0b0b0c 50% 58%, transparent 58% 61%, #ffd100 61% 63%, transparent 63% 70%, #0b0b0c 70% 72%, transparent 72% 78%, #e10a17 78% 90%, transparent 90% 93%, #0b0b0c 93%);
  content: "";
}

.footer-brand p { color: #a9a9af !important; }
.footer-brand a,
.footer-links a { color: var(--pd-ink) !important; text-decoration: none; }
.footer-links a:hover { color: var(--pd-red-hi) !important; }

.footer-links h3 {
  color: var(--pd-mute) !important;
  font-family: var(--pd-mono) !important;
  font-size: 11px !important;
  font-style: normal;
  font-weight: 500 !important;
  letter-spacing: 0.16em !important;
  font-stretch: 100%;
}

.footer-bottom,
.footer-bottom p {
  color: var(--pd-mute) !important;
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ===================== 5. Legacy re-skin ===================== */

.eyebrow,
[class*="eyebrow"] {
  color: var(--pd-red-hi) !important;
  font-family: var(--pd-mono);
  font-size: 11px !important;
  font-style: normal;
  font-weight: 500 !important;
  letter-spacing: 0.32em !important;
  text-transform: uppercase;
}

label,
small,
em,
.card-meta,
.list-card-stat,
.metric-top {
  font-family: var(--pd-mono);
  font-style: normal;
}

.list-card-stat,
.card-meta,
.metric-top {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

em { color: var(--pd-mute) !important; }

.text-action,
.premium-banner-link,
.auth-modal-submit,
.auth-submit,
.premium-plan-button,
.primary-button,
.button-primary,
[class*="-primary"]:is(a, button),
[class*="play-button"] {
  background: var(--pd-red) !important;
  color: #fff !important;
  border: 0 !important;
  clip-path: var(--pd-slant) !important;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.text-action:hover,
.premium-banner-link:hover,
.auth-modal-submit:hover,
[class*="-primary"]:is(a, button):hover {
  background: #ff2a33 !important;
}

.save-button,
.list-finish-later-button,
.grid-arrow,
.rail-button {
  background: var(--pd-panel) !important;
  border: 1px solid var(--pd-line) !important;
  color: var(--pd-ink) !important;
  clip-path: none !important;
}

.save-button:hover,
.list-finish-later-button:hover,
.grid-arrow:hover,
.rail-button:hover {
  border-color: var(--pd-ink) !important;
}

.section-dot {
  width: 7px !important;
  height: 26px !important;
  background: var(--pd-red) !important;
  border-radius: 0 !important;
  clip-path: none !important;
  transform: skewX(-18deg);
}

.versus-card,
.mini-card {
  background: var(--pd-panel) !important;
  border: 1px solid var(--pd-line) !important;
  clip-path: var(--pd-cut) !important;
}

.versus-card:hover,
.mini-card:hover { border-color: var(--pd-ink) !important; }

.card-media,
.mini-media { background-color: var(--pd-panel-2) !important; }
.card-body,
.mini-card-body { background: var(--pd-panel) !important; }

.creator-link {
  color: var(--pd-red-hi) !important;
  font-family: var(--pd-mono);
  font-size: 12px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select {
  border-color: var(--pd-line) !important;
  border-radius: 0;
  clip-path: none !important;
}

/* Auth modal */
.auth-modal-panel {
  background: var(--pd-bg) !important;
  border: 1px solid var(--pd-line) !important;
  border-top: 4px solid var(--pd-red) !important;
  clip-path: var(--pd-cut) !important;
}

.auth-modal-logo,
.auth-logo {
  width: 22px !important;
  height: 32px !important;
  padding: 0 !important;
  background: linear-gradient(90deg, var(--pd-red) 0 58%, transparent 58% 74%, var(--pd-yellow) 74%) !important;
  color: transparent !important;
  font-size: 0 !important;
  clip-path: none !important;
  transform: skewX(-18deg);
}

.auth-modal-tabs,
.auth-tabs {
  background: var(--pd-panel) !important;
  clip-path: none !important;
  gap: 0 !important;
}

.auth-modal-tabs button,
.auth-tabs button {
  color: var(--pd-mute) !important;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800 !important;
  text-transform: uppercase;
}

.auth-modal-tabs .is-active,
.auth-tabs button.is-active {
  background: var(--pd-red) !important;
  color: #fff !important;
}

.auth-tabs button.is-active::after { display: none !important; }

.auth-modal-control,
.auth-control,
.google-auth-button,
.social-auth button {
  background: var(--pd-panel) !important;
  color: var(--pd-ink) !important;
  clip-path: none !important;
}

.auth-control input { background: transparent !important; color: var(--pd-ink) !important; }
.auth-modal-forgot,
.forgot-link,
.auth-legal a { color: var(--pd-red-hi) !important; }

@media (max-width: 440px) {
  .topbar { gap: 8px; padding-right: 12px !important; }
  .topbar-left { gap: 8px; padding-left: 12px; padding-right: 0; }
  .topbar-actions { gap: 6px; }
  .brand { gap: 8px; }
  .topbar .brand-name { font-size: 15px !important; }
  .brand-mark { width: 12px !important; min-width: 12px; height: 20px !important; }
  .menu-button,
  .notification-header-button,
  .auth-header-button[data-auth-signed-in="true"] { width: 40px !important; min-width: 40px !important; height: 40px !important; }
  .topbar .search-form { flex: 0 0 40px; width: 40px; height: 40px; }
}

/* ===================== 6. Font override (legacy home.css forces Chakra Petch with !important) ===================== */

body,
button,
input,
textarea,
select {
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif !important;
}

.pd-m,
.pd-kicker,
.pd-chip,
.pd-link,
.pd-cover-tag,
.pd-stat span,
.pd-stat .pd-stat-label,
.pd-slanttab small,
.pd-nav-link i,
.eyebrow,
.footer-links h3,
.footer-bottom,
.footer-bottom p {
  font-family: var(--pd-mono) !important;
}

.pd-d,
.pd-btn,
.pd-pos,
.pd-slanttab,
.pd-tab,
.pd-cover-badge,
.pd-cover-num,
.pd-cover-title,
.pd-stat strong,
.pd-stat .pd-stat-value,
.pd-avatar,
.pd-nav-link,
.brand-name,
.auth-header-button,
h1,
h2,
h3 {
  font-family: var(--pd-display) !important;
}

/* ===================== 7. Auth gate (full-screen sign in / sign up, markup in site.js, behaviour in pd/gate.js) =====================
   A tilted poster wall of official list covers behind one cream card. */

html body .pd-gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0b0b0c;
  color: var(--pd-ink);
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  --gate-px: 0;
  --gate-py: 0;
  --gate-charge: 0;
  --gate-card: #f4f4f1;
  --gate-field: #e8e8e3;
  --gate-text: #0b0b0c;
  --gate-muted: #45454b;
  --gate-red: #b8000f;
}

html body.auth-modal-open .pd-gate {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.28s ease;
}

html body.auth-modal-open { overflow: hidden !important; }
html body.pd-gate-page .pd-gate { transition: none; }

.pd-gate-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  isolation: isolate;
}

/* ---------- poster wall: columns drift up and down forever, the wall tilts towards the pointer,
   a spotlight follows it and the posters under it come forward (pd/gate.js sets --near per tile) ---------- */
.pd-gate-wall {
  position: fixed;
  inset: -160px -160px auto;
  z-index: -2;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transform:
    perspective(1600px)
    rotateX(calc(var(--gate-py) * -7deg))
    rotateY(calc(var(--gate-px) * 7deg))
    rotate(-6deg)
    translate3d(calc(var(--gate-px) * -48px), calc(var(--gate-py) * -48px), 0);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
  pointer-events: none;
  will-change: transform;
}

/* Typing in the card: the wall steps back. */
html body .pd-gate:has(.pd-gate-panel:focus-within) .pd-gate-wall { filter: brightness(0.62) saturate(0.85); }

.pd-gate-lane {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: gate-lane var(--dur, 80s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}

.pd-gate-lane.is-down { animation-direction: reverse; }
html body:not(.auth-modal-open) .pd-gate-lane { animation-play-state: paused; }

@keyframes gate-lane { from { transform: translateY(0); } to { transform: translateY(-50%); } }

.pd-gate-tile {
  position: relative;
  display: block;
  flex: none;
  aspect-ratio: 3 / 4;
  margin-bottom: 18px;
  overflow: hidden;
  background: #1c1c1e;
  transform: rotate(calc(var(--tilt, 0deg) * (1 - var(--near, 0)))) scale(calc(1 + var(--near, 0) * 0.12));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s ease;
  z-index: calc(1 + var(--near, 0) * 10);
}

.pd-gate-tile.is-near { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 3px var(--pd-red); }

.pd-gate-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(calc(1.06 - var(--near, 0) * 0.06));
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.pd-gate-tile.has-image img { opacity: 1; }

/* Real title of what the image shows, and its list. */
.pd-gate-tile-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 11px;
  background: #0b0b0c;
  color: #f4f4f1;
  transition: background 0.3s ease, color 0.3s ease;
}

.pd-gate-tile-caption strong {
  overflow: hidden;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pd-gate-tile-caption small {
  overflow: hidden;
  color: #b4b4ba;
  font-family: var(--pd-mono) !important;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pd-gate-tile.is-red .pd-gate-tile-caption,
.pd-gate-tile.is-near .pd-gate-tile-caption { background: var(--pd-red); color: #fff; }
.pd-gate-tile.is-red .pd-gate-tile-caption small,
.pd-gate-tile.is-near .pd-gate-tile-caption small { color: #fff; }
.pd-gate-tile.is-cream:not(.is-near) .pd-gate-tile-caption { background: #f4f4f1; color: #0b0b0c; }
.pd-gate-tile.is-cream:not(.is-near) .pd-gate-tile-caption small { color: #45454b; }

/* Spotlight on the pointer (centre of the screen without one). */
.pd-gate-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(560px circle at var(--gate-mx, 50%) var(--gate-my, 46%), rgba(11, 11, 12, 0.08), rgba(11, 11, 12, 0.5) 55%, rgba(11, 11, 12, 0.78));
  pointer-events: none;
}

/* ---------- top bar ---------- */
.pd-gate-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px var(--pd-gutter);
  background: rgba(11, 11, 12, 0.88);
  border-bottom: 1px solid var(--pd-line);
}

html body .pd-gate .pd-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--pd-ink) !important;
  text-decoration: none;
}

.pd-gate-brand-name {
  color: var(--pd-ink);
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.pd-gate-brand-name b { color: var(--pd-red); font-weight: 900; }

html body .pd-gate .pd-gate-close {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--pd-line) !important;
  background: #0b0b0c !important;
  color: var(--pd-ink) !important;
  cursor: pointer;
}

html body .pd-gate .pd-gate-close:hover { background: var(--pd-red) !important; border-color: var(--pd-red) !important; }
.pd-gate-close .pd-m { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.pd-gate-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- card ---------- */
.pd-gate-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 64px;
}

.pd-gate-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--gate-card);
  color: var(--gate-text);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  transform: rotate(-1.5deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pd-gate-panel:focus-within { transform: rotate(0deg); }

.pd-gate-pin {
  position: absolute;
  top: -18px;
  right: 28px;
  z-index: 1;
  padding: 8px 14px;
  background: var(--pd-red);
  color: #fff !important;
  font-size: 18px !important;
  line-height: 1;
}

.pd-gate-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 40px 30px;
}

.pd-gate-kicker {
  color: var(--gate-red);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html body .pd-gate .pd-gate-title {
  margin: 0;
  color: var(--gate-text) !important;
  font-size: 46px !important;
  line-height: 0.92 !important;
}

.pd-gate-title.is-flip { animation: gate-flip 0.42s cubic-bezier(0.7, 0, 0.2, 1); }
.pd-gate-copy { margin: -4px 0 4px; color: var(--gate-muted); font-size: 15px; line-height: 1.5; }

/* tabs */
.pd-gate-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid var(--gate-text);
}

html body .pd-gate .pd-gate-tabs button {
  min-height: 48px;
  padding: 0 12px;
  border: 0 !important;
  background: transparent !important;
  color: var(--gate-text) !important;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

html body .pd-gate .pd-gate-tabs button:hover { background: var(--gate-field) !important; }
html body .pd-gate .pd-gate-tabs button.is-active { background: var(--gate-text) !important; color: var(--gate-card) !important; }
html body .pd-gate .pd-gate-tabs button:focus-visible { outline: 2px solid var(--pd-red) !important; outline-offset: 2px; }

/* google */
html body .pd-gate .pd-gate-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid var(--gate-text) !important;
  background: #fff !important;
  color: var(--gate-text) !important;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}

html body .pd-gate .pd-gate-google:hover { transform: translateY(-2px); }
.pd-gate-google .google-logo { display: grid; place-items: center; width: 22px; height: 22px; }
.pd-gate-google .google-logo svg { width: 20px; height: 20px; }

.pd-gate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gate-muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pd-gate-divider::before,
.pd-gate-divider::after { content: ""; flex: 1; height: 1px; background: rgba(11, 11, 12, 0.2); }

.pd-gate-error {
  margin: 0;
  padding: 12px 14px;
  background: var(--gate-red);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
}

.pd-gate-error.is-shake { animation: gate-shake 0.42s ease; }

/* forms */
.pd-gate-form { display: flex; flex-direction: column; gap: 28px; }
.pd-gate-form[hidden] { display: none !important; }
.pd-gate-form.is-enter { animation: gate-enter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }

.pd-gate-field {
  position: relative;
  height: 58px;
  background: var(--gate-field);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pd-gate-field:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--gate-text); }
.pd-gate-field.is-invalid { box-shadow: inset 0 0 0 2px var(--gate-red); }
.pd-gate-field.is-reject { animation: gate-shake 0.32s ease; }

html body .pd-gate .pd-gate-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px 92px 6px 16px !important;
  border: 0 !important;
  border-radius: 0;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--gate-text) !important;
  font-size: 16px !important;
  caret-color: var(--pd-red);
}

/* Beats the legacy dark-mode input colour (home.css: body.site-dark-mode input:not(...)). */
html body .pd-gate .pd-gate-panel .pd-gate-field .pd-gate-input:not([type="checkbox"]) {
  color: var(--gate-text) !important;
  -webkit-text-fill-color: var(--gate-text);
}

html body .pd-gate .pd-gate-input::-ms-reveal,
html body .pd-gate .pd-gate-input::-ms-clear { display: none; }

html body .pd-gate .pd-gate-input:-webkit-autofill {
  -webkit-text-fill-color: var(--gate-text);
  -webkit-box-shadow: 0 0 0 60px #fff inset !important;
}

.pd-gate-label {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--gate-muted);
  font-family: "Archivo", "Arial Narrow", sans-serif !important;
  font-size: 15px;
  transform: translateY(-50%);
  transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease, letter-spacing 0.18s ease;
  pointer-events: none;
}

.pd-gate-input:focus + .pd-gate-label,
.pd-gate-input:not(:placeholder-shown) + .pd-gate-label,
.pd-gate-input:-webkit-autofill + .pd-gate-label {
  top: 16px;
  font-family: var(--pd-mono) !important;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pd-gate-input:focus + .pd-gate-label { color: var(--gate-text); }
.pd-gate-field.is-invalid .pd-gate-label { color: var(--gate-red) !important; }

.pd-gate-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--pd-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pd-gate-field:focus-within .pd-gate-line,
.pd-gate-field.is-valid .pd-gate-line { transform: scaleX(1); }
.pd-gate-field.is-valid .pd-gate-line { background: var(--gate-text); }
.pd-gate-field.is-invalid .pd-gate-line { transform: scaleX(1); background: var(--gate-red); }

.pd-gate-ok {
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  background: var(--gate-text);
  transform: scale(0);
  transition: transform 0.28s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.pd-gate-ok svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; }
.pd-gate-field.is-valid .pd-gate-ok { transform: scale(1); }
.pd-gate-field:has(.pd-gate-eye) .pd-gate-ok { right: 56px; }

html body .pd-gate .pd-gate-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--gate-muted) !important;
  cursor: pointer;
}

html body .pd-gate .pd-gate-eye:hover,
html body .pd-gate .pd-gate-eye.is-on { color: var(--gate-text) !important; }
.pd-gate-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.pd-gate-eye.is-on svg path:first-child { stroke: var(--pd-red); }

.pd-gate-hint {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--gate-muted);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pd-gate-hint:empty { display: none; }
.pd-gate-hint[data-tone="ok"],
.pd-gate-hint[data-tone="max"] { color: var(--gate-text); font-weight: 700; }
.pd-gate-hint[data-tone="warn"] { color: #7a4f00; font-weight: 700; }
.pd-gate-field.is-invalid .pd-gate-hint { color: var(--gate-red); }

.pd-gate-row { display: flex; justify-content: flex-end; margin-top: -14px; }

html body .pd-gate .pd-gate-forgot {
  color: var(--gate-muted) !important;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

html body .pd-gate .pd-gate-forgot:hover { color: var(--gate-red) !important; }

/* submit: fills red as the form completes */
html body .pd-gate .pd-gate-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 22px 0 24px;
  overflow: hidden;
  border: 0 !important;
  background: var(--gate-text) !important;
  color: #fff !important;
  cursor: pointer;
}

.pd-gate-submit-fill {
  position: absolute;
  inset: 0;
  background: var(--pd-red);
  transform: scaleX(var(--gate-charge));
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html body .pd-gate.is-busy .pd-gate-submit-fill {
  transform: scaleX(1);
  background: repeating-linear-gradient(-60deg, var(--pd-red) 0 18px, var(--gate-red) 18px 36px);
  background-size: 200% 100%;
  animation: gate-stripes 0.6s linear infinite;
}

.pd-gate-submit-label {
  position: relative;
  font-family: var(--pd-display) !important;
  font-stretch: 125%;
  font-style: italic;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pd-gate-submit-arrow {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  transition: transform 0.2s ease;
}

.pd-gate-submit-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; }
html body .pd-gate .pd-gate-submit:hover .pd-gate-submit-arrow { transform: translateX(5px); }
html body .pd-gate.is-ready .pd-gate-submit-arrow { animation: gate-nudge 1s ease-in-out infinite; }
html body .pd-gate .pd-gate-submit[aria-busy] { cursor: progress; }
html body .pd-gate .pd-gate-submit:focus-visible { outline: 3px solid var(--pd-red) !important; outline-offset: 3px; }

.pd-gate-switch { margin: 2px 0 0; color: var(--gate-muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

html body .pd-gate .pd-gate-switch button {
  margin-left: 10px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--gate-text) !important;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--pd-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-transform: uppercase;
  cursor: pointer;
}

.pd-gate-legal { margin: 0; color: var(--gate-muted); font-size: 12px; line-height: 1.5; }
html body .pd-gate .pd-gate-legal a { color: var(--gate-text) !important; }

/* ---------- success wipe ---------- */
.pd-gate-wipe {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.pd-gate-wipe i {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 190vw;
  transform: translateX(calc(-100% - 80vh)) skewX(-16deg);
}

.pd-gate-wipe i:nth-child(1) { background: #f4f4f1; }
.pd-gate-wipe i:nth-child(2) { background: var(--pd-yellow); }
.pd-gate-wipe i:nth-child(3) { background: #0b0b0c; }
.pd-gate-wipe i:nth-child(4) { background: var(--pd-red); }

html body .pd-gate.is-go .pd-gate-wipe i { animation: gate-wipe 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
html body .pd-gate.is-go .pd-gate-wipe i:nth-child(2) { animation-delay: 0.05s; }
html body .pd-gate.is-go .pd-gate-wipe i:nth-child(3) { animation-delay: 0.1s; }
html body .pd-gate.is-go .pd-gate-wipe i:nth-child(4) { animation-delay: 0.16s; }

.pd-gate-wipe [data-gate-go] {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 92vw;
  overflow: hidden;
  color: #fff !important;
  font-size: clamp(56px, 11vw, 180px) !important;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

html body .pd-gate.is-go .pd-gate-wipe [data-gate-go] { animation: gate-go 0.5s 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* ---------- intro / fail ---------- */
html body .pd-gate.is-intro .pd-gate-wall { animation: gate-wall 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html body .pd-gate.is-intro .pd-gate-panel { animation: gate-drop 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html body .pd-gate.is-fail .pd-gate-panel { animation: gate-shake 0.42s ease; }
html body .pd-gate.is-out .pd-gate-panel { transform: rotate(0deg) scale(0.97); transition-duration: 0.18s; }

@keyframes gate-wall { 0% { opacity: 0; transform: rotate(-9deg) scale(1.08); } 100% { opacity: 1; } }
@keyframes gate-drop { 0% { opacity: 0; transform: translateY(40px) rotate(-6deg); } 100% { opacity: 1; transform: rotate(-1.5deg); } }
@keyframes gate-flip { 0% { clip-path: inset(0 100% 0 0); transform: translateX(-12px); } 100% { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes gate-enter { 0% { opacity: 0; transform: translateX(26px); } 100% { opacity: 1; transform: none; } }
@keyframes gate-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes gate-stripes { to { background-position: -72px 0; } }
@keyframes gate-nudge { 50% { transform: translateX(6px); } }
@keyframes gate-wipe { to { transform: translateX(-30vw) skewX(-16deg); } }
@keyframes gate-go { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
}

@media (max-width: 640px) {
  .pd-gate-top { gap: 12px; padding: 14px 16px; }
  .pd-gate-close .pd-m { display: none; }
  html body .pd-gate .pd-gate-close { padding: 0 12px; }
  .pd-gate-wall { gap: 12px; }
  .pd-gate-tile { margin-bottom: 12px; }
  .pd-gate-stage { align-items: flex-start; padding: 22px 12px 40px; }
  .pd-gate-panel,
  .pd-gate-panel:focus-within { transform: none; }
  .pd-gate-col { gap: 14px; padding: 32px 22px 24px; }
  .pd-gate-pin { right: 18px; }
  html body .pd-gate .pd-gate-title { font-size: 38px !important; }
  html body .pd-gate.is-intro .pd-gate-panel { animation-name: gate-rise; }
  @keyframes gate-rise { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .pd-gate *,
  .pd-gate *::before,
  .pd-gate *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
  .pd-gate-wall { transform: rotate(-6deg) !important; }
  /* Reduced motion: the wall still drifts, three times slower, without zoom or 3D tilt. */
  html body .pd-gate .pd-gate-lane {
    animation-duration: calc(var(--dur, 80s) * 3) !important;
    animation-iteration-count: infinite !important;
    animation-delay: var(--delay, 0s) !important;
  }
  .pd-gate-tile { transform: rotate(var(--tilt, 0deg)) !important; }
}

/* ===================== 8. Guards against legacy `body.site-dark-mode button/*` overrides ===================== */

html body .pd-btn { color: #fff !important; }
html body .pd-btn--ghost { color: var(--pd-ink) !important; }
html body .pd-btn--white,
html body .pd-btn--yellow { color: var(--pd-bg) !important; }
html body .pd-btn--white:hover { color: var(--pd-red) !important; }
html body .pd-btn--black { color: var(--pd-yellow) !important; }
html body .pd-btn[disabled],
html body .pd-btn.is-disabled { color: #6e6e74 !important; }

html body .pd-chip { color: var(--pd-soft) !important; }
html body .pd-chip:hover { color: #fff !important; }
html body .pd-chip.is-on,
html body .pd-chip[aria-pressed="true"] { color: var(--pd-bg) !important; background: var(--pd-ink) !important; }

html body .pd-slanttab { color: var(--pd-soft) !important; }
html body .pd-slanttab:hover { color: #fff !important; }
html body .pd-slanttab.is-on,
html body .pd-slanttab[aria-selected="true"],
html body .pd-slanttab[aria-pressed="true"] { color: var(--pd-bg) !important; background: var(--pd-ink) !important; }

html body .pd-tab {
  color: #b4b4ba !important;
  border-width: 0 0 3px !important;
  border-style: solid !important;
  border-color: transparent !important;
}
html body .pd-tab:hover { color: #fff !important; }
html body .pd-tab.is-on,
html body .pd-tab[aria-selected="true"] { color: var(--pd-ink) !important; border-bottom-color: var(--pd-red) !important; }

html body .pd-pos:not(.pd-list-num) { color: var(--pd-bg) !important; }
html body .pd-pos.is-p1 { color: #fff !important; }
html body .pd-ib { color: var(--pd-ink) !important; }
html body .pd-nav-link { color: #a9a9af !important; }
html body .pd-nav-link:hover,
html body .pd-nav-link.is-active { color: #fff !important; }
html body .pd-create.is-active { color: var(--pd-bg) !important; }

/* ===================== 9. Long real-world titles ===================== */

/* Poster titles scale with the poster width and never spill out of it. */
.pd-cover { container-type: inline-size; }

html body .pd-cover .pd-cover-title {
  font-size: clamp(14px, 9.5cqw, 30px) !important;
  line-height: 1.16 !important;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.pd-disc-pick-title,
.pd-profile-poster-title { overflow-wrap: anywhere; }

/* Hero and page titles step down when the text is long (classes set by the page scripts). */
html body .pd-home-hero-title.pd-len-l { font-size: clamp(40px, 4.8vw, 72px); }
html body .pd-home-hero-title.pd-len-xl { font-size: clamp(34px, 3.8vw, 56px); }
html body .pd-list-title.pd-len-l { font-size: clamp(36px, 4vw, 60px) !important; }
html body .pd-list-title.pd-len-xl { font-size: clamp(30px, 3.2vw, 46px) !important; }

@media (max-width: 760px) {
  html body .pd-home-hero-title.pd-len-l { font-size: 34px; }
  html body .pd-home-hero-title.pd-len-xl { font-size: 28px; }
  html body .pd-list-title.pd-len-l { font-size: 28px !important; }
  html body .pd-list-title.pd-len-xl { font-size: 24px !important; }
}

/* Subscriptions are only mentioned to signed-in members. */
body:not(.site-authenticated) .subscription-panel { display: none !important; }
/* ---------- results: position chart ---------- */
.pd-results-laps { min-width: 0; }
.pd-lap-chart { display: block; width: 100%; height: auto; padding: 4px 20px 24px; overflow: visible; }
.pd-lap polyline { fill: none; stroke: #3a3a3e; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: stroke 0.15s ease; }
.pd-lap.is-p1 polyline,
.pd-lap.is-p2 polyline,
.pd-lap.is-p3 polyline { stroke-width: 4; }
.pd-lap:hover polyline { stroke: var(--pd-red-hi) !important; stroke-width: 4; }
.pd-lap-label { fill: var(--pd-soft); font: 500 13px var(--pd-mono); }
.pd-lap-label.is-p1 { fill: var(--pd-red-hi); font-weight: 700; }
.pd-lap-label.is-p2 { fill: var(--pd-ink); font-weight: 700; }
.pd-lap:hover .pd-lap-label { fill: #fff; }

@media (max-width: 760px) {
  .pd-lap-chart { padding: 4px 10px 16px; }
  .pd-lap-label { font-size: 18px; }
}


/* ===================== Shared: position charts, favourite item tiles (results, list, taste, profile) ===================== */
.pd-taste-favs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.pd-taste-fav,
.pd-profile-p1 {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--pd-ink);
  text-decoration: none;
}

.pd-taste-fav-img,
.pd-profile-p1-img {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #1a1a1d;
  isolation: isolate;
}

.pd-taste-fav-img::before,
.pd-profile-p1-img::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -1;
  background: var(--pd-img) center / cover no-repeat;
  filter: blur(16px) brightness(0.55);
}

.pd-taste-fav-img img,
.pd-profile-p1-img img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease; }
.pd-taste-fav:hover img,
.pd-profile-p1:hover img { transform: scale(1.04); }
.pd-taste-fav > .pd-pos,
.pd-profile-p1 > .pd-pos { position: absolute; top: 8px; left: 8px; }
.pd-taste-fav strong,
.pd-profile-p1 strong { font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.pd-taste-fav .pd-m,
.pd-profile-p1 .pd-m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-taste-fav:hover strong,
.pd-profile-p1:hover strong { color: var(--pd-red-hi); }

/* ===================== 10. Motion & hover (site-wide; pointer tilt + scroll reveal set by site.js initMotion) ===================== */
.pd-home-poster,
.pd-home-off-card,
.pd-home-resume-card,
.pd-disc-card,
.pd-create-grid .versus-card,
.pd-taste-fav,
.pd-profile-p1,
.pd-results-next-card,
.pd-rivals-card {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, filter 0.35s ease;
  will-change: transform;
}

.pd-home-poster:hover,
.pd-home-off-card:hover,
.pd-home-resume-card:hover,
.pd-disc-card:hover,
.pd-create-grid .versus-card:hover,
.pd-taste-fav:hover,
.pd-profile-p1:hover,
.pd-results-next-card:hover,
.pd-rivals-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
  filter: brightness(1.06);
}

/* Pointer tilt (site.js sets --rx / --ry on the hovered card). */
.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) !important;
  z-index: 2;
}

/* Cards fade up one after the other when a grid is (re)painted. */
.pd-home-poster,
.pd-home-off-card,
.pd-disc-card,
.pd-create-grid .versus-card,
.pd-taste-fav,
.pd-profile-p1 { animation: pd-card-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }

:is(.pd-home-poster, .pd-home-off-card, .pd-disc-card, .pd-create-grid .versus-card, .pd-taste-fav, .pd-profile-p1):nth-child(2) { animation-delay: 0.05s; }
:is(.pd-home-poster, .pd-home-off-card, .pd-disc-card, .pd-create-grid .versus-card, .pd-taste-fav, .pd-profile-p1):nth-child(3) { animation-delay: 0.1s; }
:is(.pd-home-poster, .pd-home-off-card, .pd-disc-card, .pd-create-grid .versus-card, .pd-taste-fav, .pd-profile-p1):nth-child(4) { animation-delay: 0.15s; }
:is(.pd-home-poster, .pd-home-off-card, .pd-disc-card, .pd-create-grid .versus-card, .pd-taste-fav, .pd-profile-p1):nth-child(5) { animation-delay: 0.2s; }
:is(.pd-home-poster, .pd-home-off-card, .pd-disc-card, .pd-create-grid .versus-card, .pd-taste-fav, .pd-profile-p1):nth-child(n+6) { animation-delay: 0.25s; }
@keyframes pd-card-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Sections fade in when they scroll into view. */
.pd-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pd-reveal.is-in { opacity: 1; transform: none; }

/* Buttons: a light sweep on hover, a press on click. */
.pd-btn { position: relative; overflow: hidden; transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease; }
.pd-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.pd-btn:hover::after { transform: translateX(120%); transition: transform 0.6s ease; }
.pd-btn:active { transform: scale(0.97); }

/* Ranking rows: the position chip slides in. */
a.pd-row { transition: background 0.2s ease, color 0.2s ease; }
a.pd-row .pd-pos { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease; }
a.pd-row:hover .pd-pos { transform: translateX(4px) scale(1.08); }

/* Chips and tabs light up. */
.pd-chip { transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease; }
.pd-chip:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  /* Keep the fades, drop the travel. */
  @keyframes pd-card-in { from { opacity: 0; } to { opacity: 1; } }
  .pd-reveal { transform: none; }
  .is-tilting { transform: perspective(900px) rotateX(calc(var(--rx, 0deg) / 2)) rotateY(calc(var(--ry, 0deg) / 2)) translateY(-4px) !important; }
}
