/* ============================================================
   P21 Motorsport — style.css
   Background image URLs use ../img/ (one level up from css/)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:  #78C241;
  --black:  #0a0a0a;
  --dark:   #111111;
  --dark2:  #181818;
  --white:  #ffffff;
  --grey:   #aaaaaa;
  --nav-h:  72px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Barlow', sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 3px; }

/* ── Language ──────────────────────────────────────────────── */
.pt-only, .en-only                { display: none  !important; }
body.lang-pt .pt-only             { display: block !important; }
body.lang-pt span.pt-only,
body.lang-pt label.pt-only        { display: inline !important; }
body.lang-en .en-only             { display: block !important; }
body.lang-en span.en-only,
body.lang-en label.en-only        { display: inline !important; }

/* ── Navbar ────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  transition: background .4s, box-shadow .4s;
}
#navbar::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent);
  pointer-events: none; transition: opacity .4s;
}
#navbar.scrolled {
  background: rgba(10,10,10,.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
#navbar.scrolled::before { opacity: 0; }

.nav-logo             { position: relative; z-index: 1; }
.nav-logo img         { height: 46px; width: auto; display: block; }

.nav-links {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 40px; list-style: none;
}
.nav-links a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 12px;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--white); text-decoration: none;
  position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--green); transition: width .3s;
}
.nav-links a:hover         { color: var(--green); }
.nav-links a:hover::after  { width: 100%; }

.nav-right {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 20px;
}

/* Social icons — shared by navbar, contact block, footer */
.social-icons        { display: flex; gap: 14px; align-items: center; }
.social-icons a      { color: rgba(255,255,255,.5); transition: color .25s, transform .2s; display: flex; }
.social-icons a:hover { color: var(--green); transform: translateY(-2px); }
.social-icons svg    { width: 19px; height: 19px; fill: currentColor; }

/* Language toggle */
.lang-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px; overflow: hidden;
}
.lang-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 11px; letter-spacing: 1.5px;
  padding: 5px 11px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.45); border: none;
  transition: background .2s, color .2s;
}
.lang-btn.active             { background: var(--green); color: var(--black); }
.lang-btn:hover:not(.active) { color: var(--white); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--white); transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; position: fixed; inset: 0;
  background: rgba(10,10,10,.99); z-index: 999;
  flex-direction: column; align-items: center; justify-content: center; gap: 28px;
}
.mobile-menu.open  { display: flex; }
.mobile-menu a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--white); text-decoration: none; text-align: center;
  transition: color .2s;
}
.mobile-menu a:hover   { color: var(--green); }
.mobile-social         { display: flex; gap: 24px; margin-top: 12px; }
.mobile-social a       { color: rgba(255,255,255,.5); transition: color .2s; }
.mobile-social a:hover { color: var(--green); }
.mobile-social svg     { width: 26px; height: 26px; fill: currentColor; }

/* ── Hero ──────────────────────────────────────────────────── */
#hero {
  position: relative; height: 100vh; min-height: 620px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; overflow: hidden;
}
.hero-parallax {
  position: absolute; inset: -100px;
  background-image: url('../img/hero-bg.jpg');
  background-size: cover; background-position: center 35%;
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.25) 0%, rgba(0,0,0,.5) 50%, rgba(10,10,10,1) 100%);
}
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 24px; }

.hero-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 5px; text-transform: uppercase;
  color: var(--green); margin-bottom: 20px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .8s .3s forwards;
}
.hero-logo-img {
  height: 88px; width: auto;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .9s .5s forwards;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.6));
}
.hero-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(13px, 2vw, 17px); font-weight: 400;
  letter-spacing: 5px; text-transform: uppercase;
  color: rgba(255,255,255,.65); margin-top: 14px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .9s .7s forwards;
}
.hero-divider {
  width: 48px; height: 2px; background: var(--green);
  margin: 28px auto;
  opacity: 0; animation: fadeIn .8s .9s forwards;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--white); text-decoration: none;
  border: 2px solid var(--green); padding: 13px 34px;
  transition: background .3s, color .3s;
  opacity: 0; animation: fadeIn .8s 1.1s forwards;
}
.hero-cta:hover  { background: var(--green); color: var(--black); }
.hero-cta svg    { width: 13px; height: 13px; fill: currentColor; }

.hero-scroll {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; animation: fadeIn 1s 1.6s forwards;
}
.hero-scroll span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--green), transparent);
  animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }

/* ── PSCI / About ──────────────────────────────────────────── */
#psci { background: var(--dark); padding: 100px 0 0; }

.about-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 48px 80px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start;
}

/* Shared typography helpers */
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 5px; text-transform: uppercase;
  color: var(--green); margin-bottom: 10px;
}
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; text-transform: uppercase; line-height: .9;
}
.green-line { width: 40px; height: 3px; background: var(--green); margin: 16px 0 28px; }

.about-left .section-title { font-size: clamp(44px, 6vw, 74px); margin-bottom: 28px; }
.about-left .section-title em { font-style: italic; color: var(--green); }

.psci-badge      { margin-bottom: 28px; }
.psci-badge img  { max-width: 260px; height: auto; border-radius: 2px; }

.psci-link-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--green); text-decoration: none;
  border-bottom: 1px solid rgba(120,194,65,.5); padding-bottom: 3px;
  transition: color .25s, border-color .25s;
}
.psci-link-btn:hover      { color: var(--white); border-color: var(--white); }
.psci-link-btn svg        { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

.about-text { font-size: 14.5px; line-height: 1.8; color: rgba(255,255,255,.72); font-weight: 300; }
.about-text + .about-text { margin-top: 14px; }

.signature-block {
  margin-top: 32px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 16px;
}
.sig-accent { width: 3px; height: 44px; background: var(--green); flex-shrink: 0; }
.sig-name   { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; }
.sig-role   { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--grey); margin-top: 2px; }

/* ── Stats strip ───────────────────────────────────────────── */
.stats-strip   { background: var(--green); padding: 28px 48px; }
.stats-inner   { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-around; align-items: center; gap: 20px; }
.stat-item     { text-align: center; }
.stat-num      { font-family: 'Barlow Condensed', sans-serif; font-size: 46px; font-weight: 900; color: var(--black); line-height: 1; }
.stat-label    { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: rgba(0,0,0,.65); margin-top: 3px; }
.stat-divider  { width: 1px; height: 44px; background: rgba(0,0,0,.18); }

/* ── Circuits strip ────────────────────────────────────────── */
.circuits-strip  { background: var(--dark2); padding: 22px 48px; }
.circuits-label  { font-family: 'Barlow Condensed', sans-serif; font-size: 9px; letter-spacing: 4px; text-transform: uppercase; color: rgba(255,255,255,.3); text-align: center; margin-bottom: 14px; }
.circuits-row    { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; }
.circuit-pill    {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,.45); padding: 3px 0;
  border-bottom: 1px solid rgba(120,194,65,.25); transition: color .2s, border-color .2s;
}
.circuit-pill:hover { color: var(--green); border-color: var(--green); }

/* ── Gallery ───────────────────────────────────────────────── */
.gallery-section { background: #0e0e0e; }
.gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 260px 260px;
  gap: 4px;
}
.gallery-item              { position: relative; overflow: hidden; cursor: pointer; }
.gallery-item:first-child  { grid-row: span 2; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.25,.46,.45,.94), filter .4s;
  filter: brightness(.8) saturate(.85);
}
.gallery-item:hover img    { transform: scale(1.06); filter: brightness(1) saturate(1.15); }
.gallery-item::after {
  content: ''; position: absolute; inset: 0;
  border: 0px solid var(--green); transition: border-width .3s;
  pointer-events: none; z-index: 1;
}
.gallery-item:hover::after { border-width: 3px; }
.gallery-item .overlay-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,.55);
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s, transform .3s; z-index: 2;
}
.gallery-item:hover .overlay-caption { opacity: 1; transform: none; }

/* ── Contact ───────────────────────────────────────────────── */
#contact { position: relative; overflow: hidden; }
.contact-parallax {
  position: absolute; inset: -100px;
  background-image: url('../img/contact-bg.jpg');
  background-size: cover; background-position: center top;
  will-change: transform;
}
.contact-overlay { position: absolute; inset: 0; background: rgba(10,10,10,.90); }
.contact-inner {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto;
  padding: 100px 48px;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px;
}
.contact-left .section-title { font-size: clamp(40px, 5vw, 62px); margin-bottom: 8px; }

.contact-details         { display: flex; flex-direction: column; gap: 22px; margin-top: 12px; }
.contact-detail-item     { display: flex; align-items: center; gap: 16px; }
.contact-icon            { width: 46px; height: 46px; border: 1px solid rgba(120,194,65,.35); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .3s, border-color .3s; }
.contact-icon svg        { width: 19px; height: 19px; fill: var(--green); }
.contact-detail-item:hover .contact-icon     { background: var(--green); border-color: var(--green); }
.contact-detail-item:hover .contact-icon svg { fill: var(--black); }
.contact-detail-label    { font-family: 'Barlow Condensed', sans-serif; font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--grey); margin-bottom: 2px; }
.contact-detail-value    { font-size: 14px; color: var(--white); text-decoration: none; font-weight: 500; transition: color .2s; }
.contact-detail-value:hover { color: var(--green); }

.contact-social-row      { display: flex; gap: 12px; margin-top: 28px; }
.contact-social-btn      { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.13); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.45); text-decoration: none; transition: background .25s, border-color .25s, color .25s; }
.contact-social-btn:hover { background: var(--green); border-color: var(--green); color: var(--black); }
.contact-social-btn svg  { width: 17px; height: 17px; fill: currentColor; }

/* ── Contact form ──────────────────────────────────────────── */
.contact-form   { display: flex; flex-direction: column; gap: 14px; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group     { display: flex; flex-direction: column; gap: 6px; }
.form-label     { font-family: 'Barlow Condensed', sans-serif; font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--grey); }
.form-input,
.form-textarea  {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: var(--white); font-family: 'Barlow', sans-serif; font-size: 14px;
  padding: 13px 15px; outline: none; width: 100%;
  border-radius: 0; -webkit-appearance: none;
  transition: border-color .25s, background .25s;
}
.form-input::placeholder,
.form-textarea::placeholder { color: rgba(255,255,255,.2); }
.form-input:focus,
.form-textarea:focus { border-color: var(--green); background: rgba(120,194,65,.04); }
.form-textarea  { height: 110px; resize: vertical; }

.form-submit {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  background: var(--green); color: var(--black);
  border: none; padding: 15px 38px;
  cursor: pointer; align-self: flex-start;
  transition: background .25s, transform .2s;
}
.form-submit:hover:not(:disabled) { background: #8bd455; transform: translateX(4px); }
.form-submit:disabled             { opacity: .6; cursor: not-allowed; transform: none; }

.form-msg         { display: none; padding: 14px 16px; font-family: 'Barlow Condensed', sans-serif; font-size: 14px; letter-spacing: .5px; }
.form-msg.success { border: 1px solid var(--green); color: var(--green);  background: rgba(120,194,65,.07); }
.form-msg.error   { border: 1px solid #e05555;      color: #e05555;       background: rgba(224,85,85,.07); }
.form-msg.show    { display: block; }

/* ── Footer ────────────────────────────────────────────────── */
footer           { background: #050505; border-top: 1px solid rgba(255,255,255,.05); padding: 36px 48px; }
.footer-inner    { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-logo img { height: 34px; width: auto; opacity: .75; }
.footer-copy     { font-size: 11px; color: rgba(255,255,255,.28); letter-spacing: .5px; }
.footer-social   { display: flex; gap: 14px; }
.footer-social a { color: rgba(255,255,255,.28); transition: color .25s; }
.footer-social a:hover { color: var(--green); }
.footer-social svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal         { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .12s; }
.reveal-delay-2 { transition-delay: .22s; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 920px) {
  #navbar        { padding: 0 20px; }
  .nav-links     { display: none; }
  .hamburger     { display: flex; }
  .about-inner   { grid-template-columns: 1fr; gap: 48px; padding: 0 20px 60px; }
  .contact-inner { grid-template-columns: 1fr; gap: 48px; padding: 60px 20px; }
  .form-row      { grid-template-columns: 1fr; }
  .stats-inner   { flex-wrap: wrap; gap: 20px; }
  .stat-divider  { display: none; }
  .stats-strip, .circuits-strip { padding: 24px 20px; }
  #psci          { padding-top: 70px; }
  .gallery-grid  {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 200px 200px;
  }
  .gallery-item:first-child { grid-row: span 2; }
}
@media (max-width: 500px) {
  .hero-logo-img { height: 58px; }
  .gallery-grid  {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 220px);
  }
  .gallery-item:first-child { grid-row: span 1; }
}
