@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;
}

[hidden] { display: none !important; }
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; }
/* No ring after a tap or click; app.js sets .is-pointer and removes it again on keyboard navigation. */
.is-pointer :focus-visible { outline: none; }

.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-start;
  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, .78) 0%, rgba(0, 0, 0, .5) 28%, rgba(0, 0, 0, 0) 55%);
}

.hero__content {
  max-width: 1200px;
  padding: clamp(40px, 8vh, 96px) var(--gutter) 0;
  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); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Search and sort */
.controls { display: flex; gap: 12px; }

.controls input,
.controls select {
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
}

.controls input:focus,
.controls select:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink); }

.controls input { width: min(260px, 60vw); }
.controls input::placeholder { color: var(--ink-mute); }

.controls select {
  padding-right: 40px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23010205' stroke-width='2' d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.no-matches { margin-bottom: 20px; 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; cursor: zoom-in; }

/* Full-screen photo viewer */
body.no-scroll { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 48px);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, .96);
  cursor: zoom-out;
}

.lightbox__figure {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 0;
  width: min(1400px, 100%);
}

.lightbox__image {
  width: 100%;
  max-height: min(78vh, 900px);
  object-fit: contain;
  border-radius: 4px;
  background: #111;
}

.lightbox__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
  color: rgba(255, 255, 255, .85);
  font-size: 15px;
}

.lightbox__caption { margin: 0; }
.lightbox__count { flex: none; }

.lightbox__nav,
.lightbox__close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  cursor: pointer;
}

.lightbox__nav:hover,
.lightbox__close:hover { background: #fff; }

.lightbox__nav { top: 50%; translate: 0 -50%; }
.lightbox__nav--prev { left: clamp(8px, 2vw, 32px); }
.lightbox__nav--next { right: clamp(8px, 2vw, 32px); }
.lightbox__close { top: clamp(8px, 2vw, 24px); right: clamp(8px, 2vw, 24px); }
.lightbox__nav svg, .lightbox__close svg { width: 22px; height: 22px; }

@media (max-width: 640px) {
  .lightbox__nav { width: 40px; height: 40px; }
  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }
}

.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__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); }

/* "Voting has not started" pop-up */
.notice {
  width: min(440px, calc(100% - 32px));
  padding: 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}

.notice:focus { outline: none; }

.notice::backdrop { background: rgba(1, 2, 5, .6); }

.notice h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.notice p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.notice .btn { width: 100%; }

.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: 760px) {
  .grid { grid-template-columns: 1fr; }
  /* Search takes whatever width the sort menu leaves, keeping both on one line. */
  .controls { width: 100%; }
  .control:first-child { flex: 1; min-width: 0; }
  .controls input { width: 100%; }
  .card__head { flex-wrap: nowrap; }
  .card__actions { width: auto; }
  /* Stack text above the photo so the whole car stays in frame on narrow screens. */
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero::after { display: none; }
  .hero__content { padding: 40px var(--gutter) 4px; }
  .hero h1 { text-wrap: balance; }
  .hero__image {
    position: relative;
    z-index: auto;
    order: 2;
    height: auto;
    aspect-ratio: 4 / 3;
    object-position: 50% 50%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  }
}

@media (max-width: 520px) {
  .card__head { flex-wrap: wrap; }
  .card__actions { width: 100%; }
  .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; }
}
