
@font-face {
  font-family: "GreatsRaceItalic";                    
  src: url("file:///D:/Users/pc/Documents/GitHub/CaravelRacing-f1/fonts/greats-race-italic.woff2") format("woff2");
  font-weight: 400;                                    
}

:root{
  --brand-font: "GreatsRaceItalic", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --max-width:1100px;
  --accent:#c0182e;
  --muted:#444;
  --header-height:64px; 
}

*{box-sizing:border-box}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;
  line-height:1.45;
  color:var(--muted);
  margin:0;
}
.container{
  max-width:var(--max-width);
  margin:0 auto;
  padding:1rem;
}


.site-header{
  background:#111;
  color:#fff;
  min-height: var(--header-height);
}

.site-header .container{
  display:flex;
  align-items:center;
  gap:1rem;
}

.site-header .container{
  position: relative;
}

.site-logo{
  display:block;
  flex: 0 0 auto;
  height: calc(var(--header-height) - 12px); 
  width: auto;
  object-fit: contain;
}

.nav{
  display:flex;
  gap:0.75rem;
  align-items:center;
  flex: 0 1 auto;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.nav a{
  color:#fff;
  text-decoration:none;
  margin-left:0;     
  font-size:0.95rem;
  padding:0.25rem 0.4rem;
}



.brand{
  font-family: "GreatsRaceItalic";
  letter-spacing: 0.4px;
  margin:0;
  padding:0.5rem 0;
  font-size:2.2rem;
  color:inherit;
  margin-left: auto;     
  display:flex;
  align-items:center;
  gap:0;
  white-space:nowrap;
}

.brand span { display:inline; vertical-align:middle; }

.brand-red, .splash-car-part {
  color: #CC000E;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: inline-block; 
  margin: 0; 
  padding: 0;
}

.brand-avel, .splash-avel {
  color: #fff; 
  display: inline-block;
  margin: 0;
  padding: 0;
}

.brand-red + .brand-avel,
.splash-car-part + .splash-avel {
  white-space: nowrap;
}

.nav a{
  color:#fff;
  text-decoration:none;
  margin-left:1rem;
  font-size:0.95rem;
}

.hero{
  padding:3rem 0;
  text-align:center;
}
.hero h2{
  margin:0 0 0.5rem;
  font-size:1.8rem;
  color:var(--accent);
}
.btn{
  background:var(--accent);
  color:#fff;
  padding:0.5rem 0.9rem;
  border-radius:6px;
  text-decoration:none;
}

.kpis{display:flex;gap:1rem;margin:2rem 0}
.kpis .card{
  background:#f5f5f5;
  padding:1rem;
  border-radius:8px;
  flex:1;
  text-align:center;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:1rem;
}
.project-card{
  background:#fff;
  border-radius:8px;
  padding:0.5rem;
  box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.project-card img{
  width:100%;
  height:140px;
  object-fit:cover;
  border-radius:6px;
}
.small{padding:0.35rem 0.7rem;font-size:0.85rem}


.site-footer{
  background:#101010;
  color:#ddd;
  padding:1rem;
  margin-top:2rem;
  text-align:center;
}

table{width:100%;border-collapse:collapse;margin-top:1rem}
table th,table td{padding:0.4rem;border:1px solid #e6e6e6;text-align:left;font-size:0.95rem}

@media (max-width:600px){
  .site-header .container{
    flex-direction:column;
    align-items:flex-start;
  }
  .nav a{
    margin-left:0;
    margin-right:0.5rem;
  }
  .kpis{flex-direction:column}

  .site-logo{
    height: calc(var(--header-height) - 20px);
    max-height:48px;
  }

  .nav{
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }
}

.splash-overlay{
  position: fixed;
  inset: 0;
  background: #b0b0b0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 500ms ease, visibility 500ms ease;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.splash-overlay.hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner{
  text-align: center;
  color: #fff;
  padding: 0.9rem 1.5rem;
  width: 90%;
  max-width: 740px;
}

.splash-title{
  font-family: "GreatsRaceItalic";
  font-size: 1.0rem;
  margin: 0 0 0.6rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}

.splash-letters{display:inline-block;line-height:1;}
.splash-letter{
  display:inline-block;
  opacity:0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 220ms cubic-bezier(.2,.8,.2,1), transform 220ms cubic-bezier(.2,.8,.2,1);
  color: #fff;
  font-weight:800;
  letter-spacing: 1px;
  will-change: transform, opacity;
  font-size: 2.4rem;
}
.splash-letter.space{width:0.5rem;display:inline-block}

.splash-letter[data-index="0"],
.splash-letter[data-index="0"],
.splash-letter[data-index="1"],
.splash-letter[data-index="2"]{
  color: var(--accent);
}
.splash-overlay.hidden .splash-letter{opacity:1;transform:none}

.splash-bar{
  width: 100%;
  height: 14px;
  background: #3d3d3d; 
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.splash-fill{
  height: 100%;
  width: 0%;
  background: #fff; 
  transition: width 120ms linear;
}

.splash-percent{
  margin-top: 0.6rem;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}


body.splash-active{
  overflow: hidden;
}


.splash-inner{
  position: relative; 
  padding-top: 1.6rem; 
}






.splash-gif-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:0.6rem;
}
.splash-gif{
  max-width:220px;
  width:40%;
  height:auto;
  display:block;
  pointer-events:none;
}

.splash-car-wrap{
  position: absolute;
  left: 0;

  top: 9.0rem; 
  width: 100%;
  height: 48px;     
  pointer-events: none;
  overflow: visible;
}

.splash-car{
  position: absolute;
  top: 0;
  left: 0;
  width: 84px;      
  height: auto;
  transform: translateX(0);
  transition: left 120ms linear; 
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  pointer-events: none;
  display: block;
  object-fit: contain;
  background: transparent;
}

@media (max-width:600px){
  .splash-car{
    width: 60px;
  }
  .splash-car-wrap{ height: 40px; top: 2.2rem; }
  .splash-title{ font-size: 1.6rem; }
  .splash-letter{ font-size: 1.6rem; }
  .splash-gif{ max-width:140px; width:48%; }
}

.splash-gif-wrap{ position: relative; z-index: 3; }
.splash-car-wrap{ z-index: 2; }
.splash-bar{ position: relative; z-index: 1; margin-top: 0.6rem; }

@media (max-width: 430px) and (orientation: portrait) {
  .splash-gif {
    max-width: 80px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 0.4rem;
    pointer-events: none;
    z-index: 3; 
  }

  .splash-car-wrap {
    top: 5.2rem;   
    height: 48px;   
    z-index: 1;     
    overflow: visible;
  }

  .splash-car {
    width: 60px;
    top: 0;
    transition: left 120ms linear, top 120ms linear;
  }

  .splash-title { font-size: 1.6rem; }
  .splash-letter { font-size: 1.6rem; }
}


.nav-toggle{
  display: none; 
  border: 0;
  background: transparent;
  color: inherit;
  padding: .25rem;
  margin-left: .5rem;
  cursor: pointer;
  align-self: center;
}


.nav-toggle .hamburger{
  display:inline-block;
  width:28px;
  height:20px;
  position:relative;
}
.nav-toggle .hamburger span{
  display:block;
  height:2px;
  width:100%;
  background:#fff;
  border-radius:2px;
  position:absolute;
  left:0;
  transition: transform 160ms ease, opacity 160ms ease;
}
.nav-toggle .hamburger span:nth-child(1){ top:0; }
.nav-toggle .hamburger span:nth-child(2){ top:9px; }
.nav-toggle .hamburger span:nth-child(3){ top:18px; }


.mobile-nav{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1500;
  transition: opacity 220ms ease;
  opacity: 0;
}


.mobile-nav-panel{
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 280px;
  max-width: 85%;
  background: #0f0f0f;
  box-shadow: -8px 0 24px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1);
  padding: 1rem;
  color: #fff;
}


.mobile-nav::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 220ms ease;
}


html.mobile-menu-open .mobile-nav{
  pointer-events: auto;
  opacity: 1;
}
html.mobile-menu-open .mobile-nav-panel{
  transform: translateX(0);
}
html.mobile-menu-open .mobile-nav::before{
  opacity: 1;
}


.mobile-links{
  display:flex;
  flex-direction:column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.mobile-links a{
  color:#fff;
  text-decoration:none;
  padding:0.6rem 0.4rem;
  display:block;
  border-radius:6px;
}
.mobile-links a:hover,
.mobile-links a:focus{
  background: rgba(255,255,255,0.03);
  outline: none;
}


.nav-close{
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  cursor: pointer;
}




/* FIX: mobile portrait — keep brand left, logo always to the right of the name */
@media (max-width: 600px) and (orientation: portrait) {

  /* header container: keep items aligned to start so brand sits left */
  .site-header .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative; /* reference for absolute logo/hamburger */
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0;
  }

  /* brand stays in normal flow on the left and reserves space to the right */
  .brand {
    position: relative;      /* not absolute anymore — avoids overlap */
    left: 0;
    top: auto;
    transform: none;
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    z-index: 1100;
    /* reserve space on the right so long names don't touch the logo/hamburger */
    padding-right: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 7.5rem); /* prevents brand from growing into the logo area */
    display: inline-block;
  }

  /* place logo absolutely at the right of the header (to the right of the name) */
  .site-logo {
    position: absolute;
    right: 2.8rem; /* leaves room for the hamburger at extreme right */
    top: 50%;
    transform: translateY(-50%);
    height: calc(var(--header-height) - 18px);
    max-height: 48px;
    width: auto;
    z-index: 1110;
    display: block;
  }

  /* hamburger stays top-right; ensure it's above the logo */
  .nav-toggle {
    display: inline-flex;
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    background: transparent;
    border: none;
    padding: .25rem;
    align-items: center;
    justify-content: center;
  }

  /* hide desktop nav on phones (keeps previous behaviour) */
  .nav { display: none; }

  /* Slight tweak for very narrow screens to avoid collisions */
  @media (max-width: 360px) {
    .brand { padding-right: 4.5rem; max-width: calc(100% - 6.5rem); }
    .site-logo { right: 2.4rem; height: calc(var(--header-height) - 22px); }
    .nav-toggle { right: 0.5rem; }
  }
}




