@font-face {
  font-family: 'Porsche Next';
  src: url('https://cdn.ui.porsche.com/porsche-design-system/fonts/porsche-next-latin-regular.b8f1c20.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Porsche Next';
  src: url('https://cdn.ui.porsche.com/porsche-design-system/fonts/porsche-next-latin-semi-bold.b5f6fca.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: 'Porsche Next', 'Arial Narrow', Arial, sans-serif;
  --ink: #010205;
  --ink-soft: #535457;
  --ink-mute: #6b6d70;
  --canvas: #eeeff2;
  --surface: #ffffff;
  --line: #d8d8db;
  --footer-legal: #1a1b1e;
  --accent: #d5001c;
  --radius: 8px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1760px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid #1a44ea; outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding-inline: var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wordmark img { width: clamp(120px, 14vw, 160px); height: auto; }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(520px, 92vh, 980px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #000;
  color: #fff;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 50%;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 72%, #000 100%);
}

.hero__content {
  max-width: 1200px;
  padding: 0 var(--gutter) clamp(40px, 7vh, 72px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.hero__lede {
  margin-top: 20px;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.4;
  text-wrap: balance;
}

.hero__closes {
  margin-top: 14px;
  font-size: clamp(16px, 1.5vw, 22px);
  color: rgba(255, 255, 255, .85);
}

/* Section heads */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 600;
  line-height: 1.2;
}

.section-head__meta { color: var(--ink-soft); }

/* Top 3 */
.leaders { padding-block: clamp(40px, 6vw, 80px) 0; }

.leaders__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.leader {
  display: grid;
  grid-template-columns: auto 104px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  transition: box-shadow .2s ease;
}

a.leader:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }

.leader__rank {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  min-width: 28px;
}

.leader__thumb {
  width: 104px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: var(--canvas);
}

.leader__name { font-weight: 600; font-size: 18px; line-height: 1.25; }
.leader__votes { color: var(--ink-soft); font-size: 15px; }

.leader--empty {
  grid-column: 1 / -1;
  display: block;
  padding: 24px;
  color: var(--ink-soft);
  text-align: center;
}

/* Grid of configurations */
.entries { padding-block: clamp(48px, 7vw, 96px); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3.6vw, 72px) clamp(24px, 3.6vw, 72px);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 80px;
}

.card.is-voted { box-shadow: 0 0 0 2px var(--ink); }

.card__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 2vw, 32px);
}

.card__pub {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.card__logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 4px;
  object-fit: contain;
  background: var(--canvas);
}

.card__logo--initials {
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  color: #fff;
  background: var(--ink);
}

.card__names { min-width: 0; }

.card__name {
  display: block;
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__name:hover { text-decoration: underline; text-underline-offset: 3px; }

.card__insta {
  display: inline-block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 15px;
  text-decoration: none;
}

.card__insta:hover { color: var(--ink); text-decoration: underline; }

.card__actions {
  display: flex;
  flex: none;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #323639; border-color: #323639; }
.btn--secondary:hover { background: var(--canvas); }

.btn:disabled { cursor: default; }
.btn--primary:disabled { background: #b0b1b3; border-color: #b0b1b3; color: #fff; }
.btn--primary.is-mine:disabled { background: var(--ink); border-color: var(--ink); }
.btn.is-busy { cursor: progress; }

.btn svg { width: 16px; height: 16px; }

/* Gallery */
.gallery { position: relative; background: #ddd; }

.gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.gallery__track::-webkit-scrollbar { display: none; }

.gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 16 / 9;
}

.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  cursor: pointer;
  transition: opacity .2s ease;
}

.gallery__nav:disabled { opacity: 0; pointer-events: none; }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }
.gallery__nav svg { width: 20px; height: 20px; }

.gallery__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.gallery__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
}

.gallery__dot[aria-current='true'] { background: #fff; }

.gallery__count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
}

/* Results strip — only rendered once counts are revealed */
.card__result {
  display: grid;
  gap: 10px;
  padding: 16px clamp(16px, 2vw, 32px) 20px;
}

.card__result[hidden] { display: none; }

.card__result-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
}

.card__votes { font-size: 20px; font-weight: 600; }
.card__share { color: var(--ink-soft); }

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--canvas);
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width .6s ease;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  vertical-align: middle;
}

/* Footer */
.site-footer { background: var(--surface); }

.footer__top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 32px;
  padding-block: 64px;
}

.footer__col h3 {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
}

.footer__col ul { margin: 0; padding: 0; list-style: none; }
.footer__col li + li { margin-top: 14px; }

.footer__col a {
  font-size: 16px;
  text-decoration: none;
}

.footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; }

.share-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 36px;
  padding: 12px 16px;
  border: 0;
  background: #323639;
  color: #fff;
  cursor: pointer;
}

.share-button:hover { background: var(--ink); }

.footer__connect {
  margin-top: 28px;
  color: var(--ink-mute);
  font-size: 18px;
  font-weight: 600;
}

.social {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px !important;
}

.social li + li { margin-top: 0; }

.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #323639;
  color: #fff;
}

.social a:hover { background: var(--ink); }
.social svg { width: 22px; height: 22px; }

.footer__legal {
  padding-block: 32px 40px;
  background: var(--footer-legal);
  color: #fff;
  font-size: 14px;
  line-height: 1.8;
}

.footer__legal a { text-decoration: underline; text-underline-offset: 2px; margin-left: 2px; }

/* Turnstile + toast */
.turnstile-host {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 40;
  translate: -50% 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 14px 22px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  translate: -50% 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.toast.is-error { background: var(--accent); }

.noscript { padding: 24px; text-align: center; background: #fff; }

/* Skeleton while results load */
.is-loading .btn--primary { visibility: hidden; }

/* Responsive */
@media (max-width: 1180px) {
  .leaders__list { grid-template-columns: 1fr; }
  .card__head { flex-wrap: wrap; }
  .card__actions { width: 100%; }
  .card__actions .btn { flex: 1; }
}

@media (max-width: 1000px) {
  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .card__head { flex-wrap: nowrap; }
  .card__actions { width: auto; }
  .hero { min-height: 78vh; }
  .hero__image { object-position: 50% 50%; }
}

@media (max-width: 520px) {
  .card__head { flex-wrap: wrap; }
  .card__actions { width: 100%; }
  .footer__top { grid-template-columns: 1fr; padding-block: 48px; }
  .leader { grid-template-columns: auto 88px minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
  .leader__thumb { width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__track { scroll-behavior: auto; }
  .bar__fill { transition: none; }
}
