:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #16a34a;
  --soon: #F36C00;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-gap: 2px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: "Open Sans", sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.35;
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.hub {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000;
}

.hub__header {
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
}

.hub__logo {
  width: min(360px, 58vw);
  opacity: 0;
}

.hub__logo img {
  width: 100%;
  height: auto;
}

/* Promo */
a.promo-strip,
a.promo-strip:link,
a.promo-strip:visited {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

a.promo-strip:hover,
a.promo-strip:focus-visible {
  background: #f0f0f0;
}

.promo-strip__ev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2em;
  height: 1.4em;
  padding: 0 0.35em;
  border-radius: 0.28em;
  background: var(--accent);
  color: #fff;
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: promo-pulse 1.8s ease-in-out infinite;
}

.promo-strip__arrow {
  width: 1.2em;
  height: 1.2em;
  color: var(--accent);
  flex-shrink: 0;
  animation: promo-pulse 1.8s ease-in-out infinite;
  transition: transform 0.25s ease;
}

a.promo-strip:hover .promo-strip__arrow {
  transform: translateX(3px);
}

@keyframes promo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hub__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rail-gap);
  padding: var(--rail-gap);
  padding-top: 0;
}

.rail {
  display: flex;
  min-height: 0;
  gap: var(--rail-gap);
}

.rail--sales {
  flex: 1.75 1 0;
}

.rail--services {
  flex: 1 1 0;
}

.brand {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  position: relative;
  transition: flex-grow 0.7s var(--ease), flex-basis 0.7s var(--ease);
}

.brand__link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
}

.brand__media {
  position: absolute;
  inset: 0;
}

.brand__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform 6s linear;
}

.brand--fiat .brand__media img {
  object-position: 70% 40%;
}

.brand:hover .brand__media img,
.brand.is-active .brand__media img {
  transform: scale(1.12);
}

.brand__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.25) 42%, rgba(0, 0, 0, 0.35) 100%);
  transition: background 0.45s ease;
  pointer-events: none;
}

.rail:hover .brand:not(:hover) .brand__media::after {
  background: rgba(0, 0, 0, 0.55);
}

.brand:hover .brand__media::after,
.brand.is-active .brand__media::after {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0.28) 100%);
}

.brand__body {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(12px, 1.6vw, 28px);
  color: #fff;
}

.brand__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--soon);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 2px;
}

.brand__mark {
  width: auto;
  max-width: 78%;
  height: auto;
  margin-bottom: 8px;
  transform-origin: left bottom;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.45s var(--ease);
}

/* ~+30% vs previous sizes */
.brand__mark--ford { width: 36%; max-width: 143px; }
.brand__mark--oj { width: 75%; max-width: 234px; }
.brand__mark--fiat { width: 88%; max-width: 286px; }
.brand__mark--service { width: 72%; max-width: 221px; }
.brand__mark--eurorepar { width: 78%; max-width: 250px; }

.brand__copy {
  max-width: 28ch;
  font-size: clamp(0.78rem, 0.95vw, 0.95rem);
  font-weight: 400;
  color: var(--muted);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}

.brand__cta {
  display: inline-block;
  align-self: flex-start;
  margin-top: 14px;
  padding: 9px 18px;
  background: #fff;
  color: #000 !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
  isolation: isolate;
}

.brand__cta > span {
  position: relative;
  z-index: 1;
  color: #000;
}

.brand__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #111;
  transform: skewX(-45deg) scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
  z-index: 0;
}

.brand:hover .brand__cta::before,
.brand.is-active .brand__cta::before {
  transform: skewX(-45deg) scaleX(1);
}

.brand:hover .brand__cta > span,
.brand.is-active .brand__cta > span {
  color: #fff;
}

.brand__cta--muted {
  background: rgba(255, 255, 255, 0.14);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.brand__cta--muted > span {
  color: #fff;
}

.brand:hover .brand__cta--muted::before,
.brand.is-active .brand__cta--muted::before {
  background: rgba(255, 255, 255, 0.2);
}

.brand:hover .brand__cta--muted > span,
.brand.is-active .brand__cta--muted > span {
  color: #fff;
}

.brand--service:nth-child(2) .brand__media img {
  filter: brightness(1.15) contrast(1.05);
}

.brand--soon .brand__media img {
  filter: grayscale(0.35) saturate(0.85);
}

.brand--soon .brand__link {
  cursor: default;
}

/* Desktop expand */
@media (min-width: 992px) {
  .rail:hover .brand:hover,
  .rail .brand.is-active {
    flex-grow: 1.85;
  }

  .rail:hover .brand:not(:hover):not(.is-active) {
    flex-grow: 0.72;
  }

  .brand:hover .brand__copy,
  .brand:hover .brand__cta,
  .brand.is-active .brand__copy,
  .brand.is-active .brand__cta {
    opacity: 1;
    transform: translateY(0);
  }

  .brand:hover .brand__mark,
  .brand.is-active .brand__mark {
    transform: translateY(-6px) scale(1.12);
  }
}

/* Tablet / mobile — all brands in first viewport */
@media (max-width: 991px) {
  body {
    overflow: hidden;
  }

  .hub__header {
    height: 44px;
    padding: 6px 14px;
  }

  .hub__logo {
    width: min(240px, 52vw);
  }

  a.promo-strip,
  a.promo-strip:link,
  a.promo-strip:visited {
    min-height: 40px;
    font-size: 0.86rem;
    gap: 8px;
    padding: 7px 12px;
  }

  .hub__main {
    gap: 2px;
    padding: 2px;
    padding-top: 0;
  }

  .rail--sales {
    flex: 1.35 1 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
  }

  .rail--services {
    flex: 0.85 1 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2px;
  }

  .brand {
    flex: none;
    min-height: 0;
  }

  .brand__body {
    padding: 10px;
    justify-content: flex-end;
  }

  .brand__badge {
    top: 8px;
    right: 8px;
    font-size: 0.58rem;
    padding: 3px 6px;
  }

  .brand__mark--ford { width: 44%; max-width: 94px; }
  .brand__mark--oj { width: 86%; max-width: 156px; }
  .brand__mark--fiat { width: 92%; max-width: 182px; }
  .brand__mark--service { width: 88%; max-width: 143px; }
  .brand__mark--eurorepar { width: 92%; max-width: 160px; }

  .brand__copy,
  .brand__cta {
    display: none;
  }

  .brand__mark {
    margin-bottom: 0;
  }
}

@media (max-width: 479px) {
  a.promo-strip,
  a.promo-strip:link,
  a.promo-strip:visited {
    font-size: 0.78rem;
  }

  .promo-strip__text {
    line-height: 1.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .brand__media img {
    transform: none !important;
  }
}
