/* =========================================================
   GERARDINO ATELIER — FASE 1
   Design system extracted from Figma
   Fonts: Archivo (titulares) · Inter (cuerpo/nav) · Plus Jakarta Sans (footer)
   ========================================================= */

:root {
  /* Color */
  --bg:            #141414;   /* fondo de secciones */
  --bg-footer:     #141313;
  --white:         #fffefc;
  --white-pure:    #ffffff;
  --muted:         rgba(255, 255, 255, 0.7);
  --neutral-60:    #666666;
  --social-bg:     #4f4f4f;
  --input-bg:      #3c3c3c;
  --placeholder:   #ababab;
  --hover:         #9c9c9c;
  --section-light: #f9f9f9;

  /* Layout */
  --pad: clamp(20px, 9vw, 200px);     /* padding lateral (200px @ 1919) */
  --maxw: 1520px;

  /* Type */
  --f-head: "Archivo", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-foot: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--white);
  line-height: 1.4;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ---------- helpers ---------- */
.section { padding-inline: var(--pad); }
.wrap { max-width: var(--maxw); margin-inline: auto; width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  padding: 36px var(--pad);
  background: transparent;
  transition: background .35s ease, padding .35s ease, box-shadow .35s ease;
}
/* inner pages: header sólido desde el inicio (sin hero detrás) */
.site-header.is-solid { background: var(--bg-footer); }
/* al hacer scroll: fondo sólido translúcido + blur + shrink */
.site-header.is-scrolled {
  background: rgba(20, 19, 19, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: 14px; padding-bottom: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.site-header.is-scrolled .nav__logo img { width: clamp(150px, 12vw, 230px); }
.nav__logo img { transition: width .35s ease; }

.nav {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav__logo img { width: clamp(180px, 16vw, 304px); height: auto; }
.nav__links {
  display: flex; gap: 28px; align-items: center;
  font-size: clamp(15px, 1.1vw, 20px); text-transform: uppercase; color: var(--white);
}
.nav__links a { transition: opacity .2s ease; }
.nav__links a:hover { opacity: .65; }

/* hamburger (mobile only) */
.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 30px; height: 22px; z-index: 60; flex-shrink: 0;
}
.nav__toggle span { display: block; height: 2px; width: 100%; background: var(--white); transition: transform .3s ease, opacity .3s ease; }

/* =========================================================
   HOME — HERO + VIDEO SECTIONS
   ========================================================= */
.media-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex; align-items: center;
  isolation: isolate;
}
.media-section__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2;
}
/* Vimeo background embed — fills the section like object-fit:cover; poster shows while loading */
.vimeo-bg {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  background-size: cover; background-position: center;
}
.vimeo-bg iframe {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100vw; height: 56.25vw;            /* full window width, 16:9 */
  min-height: 100%; min-width: 177.78vh;    /* never smaller than the section (full-bleed) */
  border: 0; pointer-events: none;          /* clicks pass through to content */
  opacity: 0; transition: opacity .9s ease; /* fade video in over the poster */
}
.vimeo-bg.is-playing iframe { opacity: 1; }
.media-section__bg + .media-section__overlay { z-index: -1; }
.media-section__overlay {
  position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.35);
}

/* Hero (Section 1) — full screen */
.hero {
  min-height: 100vh; min-height: 100svh;
  padding-block: 0;
}
.hero .media-section__overlay { background: rgba(0,0,0,.15); }
/* top scrim: keeps header legible + hides the placeholder poster's baked header
   (the real background video has no header, so this just reads as a cinematic vignette) */
.hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 220px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 100%);
  z-index: -1; pointer-events: none;
}

/* Feature sections (Instagram / YouTube) — full screen */
.feature {
  min-height: 100vh; min-height: 100svh;
  padding-inline: var(--pad);
}
.feature .media-section__overlay { background: rgba(0,0,0,.45); }

.feature__row {
  max-width: var(--maxw); margin-inline: auto; width: 100%;
  display: flex; align-items: center; gap: 30px;
  color: var(--section-light);
}
.feature__label {
  font-weight: 500; font-size: clamp(18px, 1.7vw, 24px); letter-spacing: .02em;
  white-space: nowrap;
}
.feature__tag {
  margin-left: auto;
  font-size: clamp(13px, 1vw, 18px); line-height: 1.25; text-align: right;
  text-transform: uppercase; letter-spacing: .04em;
}
/* VISIT button — horizontal pill with arrow (Diana ref: "boton flecha") */
.feature__visit {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--section-light); border-radius: 26px;
  width: 114px; height: 40px; flex-shrink: 0; padding: 8px;
  color: var(--section-light);
  transition: color .25s ease, border-color .25s ease;
}
.feature__visit svg { width: 100%; height: 12px; display: block; }
.feature__visit:hover { color: #111; border-color: var(--white); }

/* =========================================================
   HOME — WEST TEXAS RALLY (event section)
   ========================================================= */
.rally {
  position: relative; overflow: hidden; isolation: isolate;
  background: #0f0f0f;
  padding: clamp(70px, 11vw, 150px) var(--pad);
  min-height: clamp(420px, 47vw, 760px);
  display: flex; align-items: center;
}
.rally__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .55; }
.rally::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,.25)); }
.rally__inner { max-width: var(--maxw); margin-inline: auto; width: 100%; }
.rally__date {
  font-family: var(--f-body); font-weight: 500; text-transform: uppercase; letter-spacing: .14em;
  font-size: clamp(14px, 1.2vw, 18px); color: var(--section-light); margin-bottom: 20px;
}
.rally__title {
  font-family: var(--f-head); font-weight: 600; text-transform: uppercase; line-height: .92;
  font-size: clamp(44px, 7vw, 110px); color: var(--white); margin-bottom: 24px;
}
.rally__desc {
  font-family: var(--f-body); font-size: clamp(16px, 1.5vw, 22px); line-height: 1.4;
  color: rgba(255,255,255,.85); max-width: 520px; margin-bottom: 36px;
}
.rally__rule { border: none; border-top: 1px solid rgba(255,255,255,.4); margin-bottom: 36px; }
.rally__cta {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 36px; border-radius: 40px;
  border: 1px solid rgba(255,255,255,.6); color: var(--white);
  text-transform: uppercase; letter-spacing: .06em; font-size: 16px; font-weight: 500;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.rally__cta:hover { color: #111; border-color: var(--white); }

/* =========================================================
   HOME — NEWSLETTER (FOLLOW THE JOURNEY)
   ========================================================= */
.newsletter {
  background: var(--white);
  color: #141313;
  padding: clamp(60px, 10vw, 100px) var(--pad);
}
.newsletter__inner { max-width: var(--maxw); margin-inline: auto; text-align: right; }
.newsletter__title {
  font-family: var(--f-body); font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 5vw, 60px); line-height: 1; color: #141313;
  margin-bottom: 36px;
}
.newsletter__form {
  display: inline-flex; align-items: center;
  background: var(--input-bg); border-radius: 40px; overflow: hidden;
  max-width: 100%;
}
.newsletter__form input {
  background: transparent; border: none; outline: none;
  color: var(--white); font-size: 16px; padding: 0 28px; height: 56px;
  min-width: 220px;
}
.newsletter__form input::placeholder { color: var(--placeholder); text-transform: uppercase; letter-spacing: .04em; }
.newsletter__form button {
  height: 56px; padding: 0 32px; border-radius: 40px;
  border: 1px solid rgba(255,255,255,.3); color: var(--white);
  font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: background .25s ease, color .25s ease;
}
.newsletter__form button:hover { color: #111; border-color: var(--white); }

/* =========================================================
   PAGE TITLES (About / Contact / Privacy)
   ========================================================= */
.page {
  background: var(--bg);
  /* top padding clears the fixed header */
  padding: clamp(120px, 15vw, 180px) var(--pad) clamp(80px, 12vw, 150px);
}
.page__title {
  font-family: var(--f-head); font-weight: 600; text-transform: uppercase;
  font-size: clamp(40px, 6.2vw, 80px); line-height: .95; color: var(--white);
  text-shadow: 0 0 40px rgba(0,0,0,.4);
}
/* long title (Privacy) — 50% smaller */
.page__title--small { font-size: clamp(20px, 3.1vw, 40px); }

/* =========================================================
   ABOUT
   ========================================================= */
/* Desktop: overlapping composition — photo right (defines the height), ABOUT left,
   lead text over the photo's lower-left. The photo is in normal flow so percentages
   resolve against a real height (robust across widths). */
.about__hero {
  position: relative;
  margin-top: clamp(10px, 3vw, 40px);
}
.about__portrait {
  position: relative;
  width: 48.5%; margin-left: 51.5%;
  aspect-ratio: 700 / 886; overflow: hidden;
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.about__portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(24deg, #000 4%, rgba(20,20,20,0) 78%);
}
.about__title {
  position: absolute; left: 0; top: 46%; transform: translateY(-50%);
  width: 46%; margin: 0; text-align: right; z-index: 2;
}
.about__lead {
  position: absolute; left: 31%; bottom: 8%; width: 60%; margin: 0; z-index: 2;
  font-family: var(--f-body); font-weight: 500;
  font-size: clamp(15px, 1.5vw, 28px); line-height: 1.45; text-align: left; color: #fff;
}
.about__bio {
  max-width: 760px; margin: clamp(40px, 6vw, 90px) auto 0;
  font-size: clamp(17px, 1.6vw, 24px); line-height: 1.45;
}
.about__bio p { margin-bottom: 1.1em; }
.about__bio p:last-child { margin-bottom: 0; }
.about__mark { display: flex; justify-content: center; margin-top: clamp(50px, 8vw, 100px); }
.about__mark img { width: clamp(150px, 18vw, 220px); opacity: .55; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact__email {
  font-size: clamp(12px, 1vw, 15px); color: var(--white);
  margin-top: 14px; display: inline-block;
}
.contact__email:hover { opacity: .7; }
.contact__form {
  max-width: 760px; margin-top: clamp(28px, 4vw, 44px); margin-left: auto;
  display: flex; flex-direction: column; gap: 32px;
}
.field-row { display: flex; gap: 28px; flex-wrap: wrap; }
.field { flex: 1 1 200px; }
.field label {
  display: block; font-size: clamp(13px, 1.1vw, 15px); color: var(--white);
  margin-bottom: 10px;
}
.field input, .field textarea {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid var(--white); color: var(--white);
  font-family: var(--f-body); font-size: 16px; padding-bottom: 10px; outline: none;
  resize: none;
}
.field textarea { min-height: 40px; }
.field input::placeholder, .field textarea::placeholder { color: var(--neutral-60); }
.field input:focus, .field textarea:focus { border-color: var(--hover); }

.btn-pill {
  align-self: flex-start;
  height: 56px; padding: 0 32px; border-radius: 40px;
  border: 1px solid rgba(255,255,255,.6); color: var(--white);
  font-size: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn-pill:hover { border-color: var(--white); }

/* =========================================================
   PRIVACY / LEGAL
   ========================================================= */
.legal { padding-top: clamp(30px, 5vw, 60px); }
.legal__grid {
  columns: 2; column-gap: clamp(40px, 6vw, 100px);
  font-size: 14px; line-height: 1.65; color: var(--white);
}
.legal__grid h3 { font-size: 15px; margin: 22px 0 8px; font-weight: 600; }
.legal__grid h3:first-child { margin-top: 0; }
.legal__grid p { margin-bottom: 12px; color: rgba(255,255,255,.85); }
.legal__grid ul { margin: 0 0 12px 18px; color: rgba(255,255,255,.85); }
.legal__meta { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* =========================================================
   THANK YOU
   ========================================================= */
.thankyou {
  min-height: 70vh; display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(60px, 10vw, 120px);
}
.thankyou__title {
  font-family: var(--f-head); font-weight: 600; text-transform: lowercase;
  font-size: clamp(34px, 5vw, 64px); line-height: 1.05; margin-bottom: 28px;
}
.thankyou__text { max-width: 620px; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.5; color: var(--muted); margin-bottom: 40px; }
.thankyou__actions { display: flex; gap: 20px; flex-wrap: wrap; }
.btn-ghost {
  height: 56px; padding: 0 32px; border-radius: 40px; display: inline-flex; align-items: center;
  border: 1px solid rgba(255,255,255,.6); color: var(--white); text-transform: uppercase;
  font-size: 16px; letter-spacing: .06em; transition: background .25s, color .25s;
}
.btn-ghost:hover { color: #111; border-color: var(--white); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--bg-footer); padding: clamp(60px, 8vw, 100px) var(--pad) 0;
}
.site-footer__inner { max-width: var(--maxw); margin-inline: auto; }
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap; margin-bottom: clamp(40px, 6vw, 80px);
}
.footer-logo img { width: 264px; max-width: 60vw; height: auto; }
.footer-follow__title, .footer-col__title {
  font-family: var(--f-foot); font-weight: 500; text-transform: uppercase;
  font-size: 20px; color: var(--white); margin-bottom: 22px; letter-spacing: .02em;
}
.footer-social { display: flex; gap: 20px; }
.footer-social a {
  background: var(--social-bg); border-radius: 333px;
  height: 50px; min-width: 110px; flex: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s ease;
}
.footer-social a:hover { background: #5e5e5e; }
.footer-social img { width: 24px; height: 24px; object-fit: contain; }
.footer-social .ico-yt img { width: 30px; height: 30px; }

.footer-cols {
  display: flex; gap: clamp(40px, 8vw, 120px); flex-wrap: wrap;
  padding-bottom: clamp(40px, 6vw, 70px);
}
.footer-col { min-width: 180px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.footer-col a, .footer-col li {
  font-family: var(--f-foot); font-weight: 400; font-size: 20px; color: var(--muted);
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid var(--muted);
  padding: 40px 0; text-align: center;
}
.footer-bottom p { font-family: var(--f-foot); font-size: clamp(14px, 1.3vw, 20px); color: var(--muted); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  /* clear the fixed header (≈131px tall on mobile) so titles aren't covered */
  .page { padding-top: 150px; }
  .nav__links {
    position: fixed; inset: 0; z-index: 50;
    flex-direction: column; align-items: center; justify-content: center; gap: 40px;
    background: rgba(10,10,10,.97); font-size: 28px;
    transform: translateX(100%); transition: transform .35s ease;
  }
  .nav.is-open .nav__links { transform: translateX(0); }
  .nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* mobile: stack — photo, then ABOUT, then lead text (no overlap) */
  .about__hero { display: flex; flex-direction: column; }
  .about__portrait { width: 100%; margin-left: 0; aspect-ratio: 4/5; order: 1; }
  .about__title { position: static; transform: none; width: 100%; text-align: left; order: 2; margin-top: 24px; }
  .about__lead { position: static; left: auto; bottom: auto; width: 100%; order: 3; margin-top: 16px; }
  .legal__grid { columns: 1; }
  .contact__form { margin-left: 0; }
  .newsletter__inner { text-align: center; }
  .newsletter__title { text-align: center; }
  /* feature rows: keep label left + tag/visit right on one line (same in IG & YouTube) */
  .feature__row { flex-wrap: nowrap; gap: 14px; }
  .feature__label { font-size: 16px; }
  .feature__tag { font-size: 12px; }
  .feature__visit { width: 88px; }
}

@media (max-width: 520px) {
  .newsletter__form { width: 100%; flex-direction: column; border-radius: 24px; padding: 8px; gap: 8px; }
  .newsletter__form input { width: 100%; text-align: center; }
  .newsletter__form button { width: 100%; }
  .footer-social a { min-width: 0; }
  .btn-pill, .contact__form { align-self: stretch; }
}

/* =========================================================
   BUTTON HOVER — slide-fill (Figma "Hover" element)
   El relleno blanco se desliza al pasar el mouse; el texto invierte a oscuro.
   ========================================================= */
.btn-pill, .rally__cta, .btn-ghost,
.newsletter__form button, .feature__visit {
  position: relative; overflow: hidden; z-index: 0;
}
.btn-pill::before, .rally__cta::before, .btn-ghost::before,
.newsletter__form button::before, .feature__visit::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--white);
  transform: translateX(-101%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
/* Contact SEND INQUIRY: relleno gris #9c9c9c con texto blanco (color de hover del diseño) */
.btn-pill::before { background: var(--hover); }
.btn-pill:hover::before, .rally__cta:hover::before, .btn-ghost:hover::before,
.newsletter__form button:hover::before { transform: translateX(0); }

/* VISIT pill: relleno entra desde la izquierda */
.feature__visit:hover::before { transform: translateX(0); }

/* =========================================================
   MOTION — scroll/load reveals (Diana #5) + grain reveal (Diana #6)
   ========================================================= */
/* Pre-loader — logo over dark while the hero video loads; fades out to reveal the playing video */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 1s ease, visibility 1s ease;
}
#preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__logo {
  width: clamp(170px, 22vw, 300px); height: auto;
  animation: preloaderBreathe 1.9s ease-in-out infinite;
}
@keyframes preloaderBreathe {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .preloader__logo { animation: none; opacity: 1; } }

.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform .9s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Title char-by-char reveal — IN once (ref: nomoredesign.co.uk hover-animation-v4)
   opacity + blur(6→0) + slide y(3→0), staggered L→R. No loop, no out. */
.hw-word { display: inline-block; white-space: nowrap; }
.hw-char {
  display: inline-block;
  opacity: 0; filter: blur(6px); transform: translateY(3px);
  transition: opacity .3s cubic-bezier(.22, .61, .36, 1),
              filter .3s cubic-bezier(.22, .61, .36, 1),
              transform .3s cubic-bezier(.22, .61, .36, 1);
  white-space: pre;
}
.hw-char.hw-in { opacity: 1; filter: blur(0); transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hw-char { opacity: 1 !important; filter: none !important; transform: none !important; transition: none !important; }
}

/* =========================================================
   NAV LINK — underline reveal on hover (Diana #17)
   ========================================================= */
.nav__links a { position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: currentColor; transition: width .3s ease;
}
.nav__links a:hover::after { width: 100%; }

/* static image background for sections without video (Instagram / Rally) */
.media-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
