:root {
    --dark-blue: #195b87;
    --dark-blue-hover: #2980b9;
    --font-black: #2c3e50;
    --gray-border: #dee2e6;
}

body {
    font-family: "Comfortaa", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    color: var(--font-black);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}
.header {
    font-family: "Oxanium", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    line-height: 1;
    padding: 2rem 0;
    background-color: var(--dark-blue);
    color: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}
.logo {
    width: 300px;
}
.header h1 {
    font-size: 3rem;
    letter-spacing: .25em;
}
p, ul {
    line-height: 1.6;
}
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}
.car-card {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.car-card:hover {
    transform: translateY(-5px);
}
.car-card img {
    width: 100%;
    height: 200px;
   /* object-fit: cover; */
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 15px;
}
.car-card h2 {
    color: #2c3e50;
    margin: 10px 0;
}
.view-button {
    display: inline-block;
    margin-top: auto;
    padding: 10px 20px;
    background-color: var(--dark-blue);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.view-button:hover {
    background-color: var(--dark-blue-hover);
}
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*padding: 10px 0;
    margin-bottom: 20px;*/
}
.nav a {
    color: var(--dark-blue);
    text-decoration: none;
}
.nav a:hover {
    text-decoration: underline;
}
.nav .logo {
    width: 150px;
    filter: brightness(0) saturate(100%) invert(30%) sepia(10%) saturate(5077%) hue-rotate(166deg) brightness(92%) contrast(89%);
}
.nav div { 
    font-family: "Oxanium", sans-serif;
    font-optical-sizing: auto;
    font-size: 1.3rem;
    letter-spacing: 0.25em;
    color: var(--dark-blue);
    display: flex; 
    gap: 2rem;
}
.car-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.car-header {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}
@media (min-width: 768px) {
    .car-header {
        flex-direction: row;
        align-items: flex-start;
    }
}
.car-header img {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: contain;
    border-radius: 8px;
}
.car-info {
    flex: 1;
}
.car-info h1 {
    margin: 0 0 10px 0;
}
.specs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}
@media (min-width: 768px) {
    .specs {
        grid-template-columns: repeat(2, 1fr);
    }
}
.spec-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}
.spec-group h2 {
    margin-top: 0;
}
.spec-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid var(--gray-border);
}
.race-results {
    margin-top: 40px;
}
.race-results h2 {
    margin-bottom: 20px;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-border);
}
.results-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}
.results-table tr:hover {
    background-color: #f8f9fa;
}
.result-position {
    font-weight: bold;
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
}
.position {
    background-color: #000;
    color: #fff;
}
.position-1 {
    background-color: #ffd700;
    color: #000;
}
.position-2 {
    background-color: #c0c0c0;
    color: #000;
}
.position-3 {
    background-color: #cd7f32;
    color: #fff;
}
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.stat-card h3 {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9em;
    text-transform: uppercase;
}
.stat-card p {
    margin: 10px 0 0 0;
    font-size: 1.5em;
    color: #2c3e50;
    font-weight: bold;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s;
}
.gallery img:hover {
    transform: scale(1.05);
}