/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: 
      linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), /* Darken overlay */
      url('../images/background5.jpg'); /* Background image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* Keeps background fixed */
  min-height: 100vh; /* Ensures it spans at least the full viewport */
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
}

/* Main Container */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 30px;
}

.series-section {
    width: 100%;
    max-width: 1700px;
    margin: 20px 0;
    padding: 20px;
    background-color: #00000073;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.series-section:hover {
    transform: translateY(-5px);
}

.series-section h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 20px;
}

/* Model Links */
.model-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.model-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #0000005b;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 340px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
}

.model-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    background-color: #4b4a4a8c;

}

.model-item img {
    width: 300px; /* Slightly larger image size */
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.model-item span {
    font-size: 1rem;
    color: #ffffff;
    font-weight: bold;
}

.model-item:hover span {
    color: #68a5ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .model-item {
        width: 100%;
        max-width: 180px;
    }
}

/*  */
/*  */
/* BASE STYLING */
:root {
    --col-bg: 20,20,20;
    --col-fg-p: 0,102,177;
    --col-fg-p2: 0,61,120;
    --col-fg-p3: 226,39,24;
    --col-fg-s: 184,171,143;
    --col-text: 120,120,120;
  }
  
  /* width */
  body::-webkit-scrollbar {
    width: 13px;
    background: rgb(var(--col-bg));
  }
  /* Track */
  body::-webkit-scrollbar-track {
    background: rgb(var(--col-bg));
    background-clip: padding-box;
    width: 8px;
    margin-top: 30px;
    margin-bottom: 5px;
  }
  /* Handle */
  body::-webkit-scrollbar-thumb {
    background-color: rgb(60, 70, 100);
    border-radius: 100px;
    border: 3px solid rgba(0,0,0,0); 
    background-clip: padding-box;
    margin-top: 30px;
    margin-bottom: 5px;
  }
  
  .bname {
    position: absolute;
    top: 1%;
    right: 1%;
    font-variant: all-small-caps;
    letter-spacing: 2px;
    color: rgb(var(--col-fg-p));
    font-weight: 600;
    font-size: 13px;
    margin: 0;
    font-style: italic;
  }
  
  .bname .darkblue {
    color: rgb(var(--col-fg-p2));
  }
  
  .bname .red {
    color: rgb(var(--col-fg-p3));
  }
  
 /* PEN CONTENT STYLING */

.content {
  text-align: center;
}

.content-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 1400px;
  place-items: center;
  margin-top: 40px;
  gap: -100px;
}

@media screen and (max-width:1600px) {
  .content-row {
    grid-template-columns: repeat(3,1fr);
  }
}

@media screen and (max-width:1000px) {
  .content-row {
    grid-template-columns: repeat(1,1fr);
  }
}

.card {
  max-height: 500px;
  min-height: 500px;
  aspect-ratio: 10 / 16;
  position: relative;
  border-radius: 2px;
  transform-style: preserve-3d;
  transition: rotate ease 400ms;
  margin-bottom: 6vh;

}

.card::before {
  content: "";
  border-radius: 2px;
  position: absolute;
  inset: 0;
  z-index: 100;
  background-image: radial-gradient(circle, transparent 10px, black);
  opacity: 0;
  transition: opacity 400ms;
}

.card:hover::before {
  opacity: 1;
}

.card::after {
  content: "";
  border-radius: 2px;
  position: absolute;
  inset: 80% 0.5rem 0.5rem;
  translate: 0;
  transform: translateZ(-100px);
  background: black;
  filter: blur(1rem);
  z-index: 1;
  transition: rotate 300ms, translate 300ms;
}

.card:hover::after {
  rotate: x calc(35deg * -1);
  translate: 0 60px;
}

.card:hover {
  rotate: x 35deg;
}

.card:hover .content-row {
  transform: perspective(900px);
}

.background {
  position: absolute;
  z-index: 10;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: -350px center;
}

.logo, .car, .title {
  position: absolute;
}

.car {
  opacity: 0;
  background-position: center;
  transform-origin: bottom;
  z-index: 100;
  transition: 600ms;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.card:hover .car {
  opacity: 1;
  rotate: x calc(35deg * -1);
  top: 60%;
  left: 50%;
  transform: translate(-50%, -55%) translateZ(-10px);
}

.m3 {
  background-image: url("https://cdn.bmwblog.com/wp-content/uploads/2022/07/bmw-m3-touring-frozen-black-2022-15.jpg");
  background-size: cover;
  background-position: -220px center;
}

.m4 {
  background-image: url("https://www.autovisie.nl/wp-content/uploads/2022/05/P90461724_highRes_the-new-bmw-m4-csl-o.jpg");
  background-size: cover;
  background-position: -250px center;
}

.m5 {
  background-image: url("https://g90.bimmerpost.com/forums/attachment.php?attachmentid=3587969&stc=1&d=1730220532");
  background-size: cover;
  background-position: -350px center;
}

.m3 .car {
  height: 380px;
  aspect-ratio: 16 / 10;
  background-image: url("https://www.bmw.be/content/dam/bmw/common/all-models/m-series/m3-touring/2022/navigation/bmw-m3-competition-touring-modelfinder.png");
    background-size: cover;
}

.m4 .car {
  height: 400px;
  aspect-ratio: 16 / 10;
  background-image: url("https://www.bmw.nl/content/dam/bmw/common/all-models/m-series/m4-coupe/2022/Navigation/bmw-4-series-coupe-m-csl-modelfinder.png");
    background-size: cover;
}

.m5 .car {
  height: 370px;
  aspect-ratio: 16 / 10;
  background-image: url("../images/Mseries/g90/bmwm5g90.png");
  background-size: cover;
}

.card:hover .spec-container {
  opacity: 1;
  transition: 300ms;
  transition-delay: 300ms;
}

.card:hover .logo {
  transform: translateY(-2.5rem) translateZ(20px);
  rotate: x calc(35deg * -1);
  transition: 300ms;
  transition-delay: 400ms;
}

.title {
  z-index: 1000;
  width: 65%;
  margin-inline: auto;
  inset: auto 0 1rem;
  transform: translateY(0rem) translateZ(20px);
  transition: 600ms;
}

.card:hover .title {
  transform: translateY(-1.5rem) translateZ(20px);
  rotate: x calc(35deg * -1);
}

.title h1 {
  font-weight: 400;
  letter-spacing: 4px;
  font-size: 30px;
  transition: 200ms ease;
}

.card:hover .title h1 {
  font-size: 33px;
}

.title p, .title h1 {
  margin: 0;
  padding: 0;
  color: white;
}

.spec-container {
  position: absolute;
  z-index: 1000;
  bottom: -15%;
  right: -120%;
  transform: translate(-50%, -50%);
  rotate: x calc(35deg * -1);
  transition: 100ms;
  transition-delay: 0;
  opacity: 0;
}

.spec-container div svg path {
  fill: rgb(255, 255, 255);
}

.spec-container div svg {
  height: 40px;
  width: min-content;
}

.transmission, .acceleration, .gasoline {
  display: flex;
  align-items: center;
}

.transmission p, .acceleration p, .gasoline p {
  width: 100px;
  text-align: left;
  color: rgb(255, 255, 255);
  margin: 0;
  font-weight: 100;
}