/* =========================================================================
   Position Zero — landing page
   Design reference: Figma "Hero" (1:3) and "Contact-Page" (3:4), 1440 canvas
   ========================================================================= */

/* ---------------------------------- Tokens -------------------------------- */
:root {
  --red: #ce1919;
  --black: #000;
  --white: #fff;

  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-soft: rgba(255, 255, 255, 0.1);

  --radius-shell: 30px;
  --radius: 8px;
  --radius-pill: 999px;

  --page-pad: 22px;
  --shell-pad-x: clamp(20px, 2.92vw, 42px);

  /* One "design unit" = 1/100th of the 1440x1119 Figma frame. Taking the
     smaller of the width- and height-derived value keeps the whole hero on
     screen on short laptop displays instead of pushing the cards below the
     fold. At the design aspect ratio both terms resolve to 14.4px. */
  --s: min(1vw, 1.2868vh);

  --card-gap: clamp(14px, calc(2.014 * var(--s)), 29px);
  --card-w: clamp(124px, calc(13.472 * var(--s)), 194px);
  --stack-gap: clamp(18px, calc(4.167 * var(--s)), 60px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------- Reset --------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

h1, h2, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Body is locked while the contact modal is open */
body.is-modal-open { overflow: hidden; }

/* ----------------------------------- Page --------------------------------- */
.page { padding: var(--page-pad); }

@media (max-width: 640px) {
  :root { --page-pad: 12px; }
}

/* ----------------------------------- Hero --------------------------------- */
.hero-container {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - (var(--page-pad) * 2));
  padding:
    clamp(16px, calc(2.847 * var(--s)), 41px)
    var(--shell-pad-x)
    clamp(40px, calc(9.375 * var(--s)), 135px);
  overflow: hidden;
  border-radius: var(--radius-shell);
  background: linear-gradient(180deg, #000 0%, var(--red) 100%);
}

/* ----------------------------------- Nav ---------------------------------- */
.nav {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: clamp(52px, calc(5 * var(--s)), 72px);
  padding: 0 clamp(14px, 1.94vw, 28px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* The asset is cropped to the letterforms, so flex centring is true centring */
.nav-logo img {
  width: clamp(130px, 14.31vw, 206px);
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 23px);
  font-size: clamp(15px, 1.389vw, 20px);
  font-weight: 500;
  text-transform: capitalize;
}

.nav-links a {
  display: inline-block;
  padding: 4px 2px;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.nav-links a:hover { color: #ff6b6b; }

/* Hamburger — hidden until the mobile breakpoint takes over */
.nav-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.24); }

/* Middle bar is the element; the other two are its pseudo-elements */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--white);
}

.nav-toggle-bars {
  position: relative;
  transition: background-color 0.2s var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.32s var(--ease), top 0.28s var(--ease);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top: 6px; }

/* Open: bars collapse into an X, matching the modal's close button */
.nav.is-open .nav-toggle-bars { background: transparent; }

.nav.is-open .nav-toggle-bars::before,
.nav.is-open .nav-toggle-bars::after { top: 0; }

.nav.is-open .nav-toggle-bars::before { transform: rotate(45deg); }
.nav.is-open .nav-toggle-bars::after  { transform: rotate(-45deg); }

/* ------------------------------ Headline block ---------------------------- */
.hero-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Equal space above (to the nav) and below (to the card row) */
  text-align: center;
}

.hero-text { max-width: 1067px; }

.hero-title {
  font-size: clamp(28px, calc(4.444 * var(--s)), 64px);
  font-weight: 700;
  line-height: 1.17;
  text-transform: capitalize;
}

.hero-body {
  max-width: 629px;
  margin: var(--stack-gap) auto 0;
  font-size: clamp(15px, calc(1.389 * var(--s)), 20px);
  font-weight: 500;
  line-height: 1.25;
  text-transform: capitalize;
}

/* --------------------------------- Buttons -------------------------------- */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 205px;
  max-width: 100%;
  height: 56px;
  border: 2px solid var(--red);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
  transition: background-color 0.28s var(--ease), box-shadow 0.28s var(--ease),
              transform 0.28s var(--ease);
}

.hero-main .btn-ghost { margin-top: var(--stack-gap); }

.btn-ghost:hover {
  background: rgba(206, 25, 25, 0.22);
  box-shadow: 0 0 24px rgba(206, 25, 25, 0.45);
  transform: translateY(-2px);
}

.btn-ghost:active { transform: translateY(0); }

.btn-arrow {
  width: 22px;
  height: auto;
  transition: transform 0.28s var(--ease);
}

.btn-ghost:hover .btn-arrow { transform: translateX(5px); }

/* ---------------------------- Animated card row --------------------------- */
.marquee {
  flex: 0 0 auto;
  /* full-bleed inside the rounded shell */
  margin-inline: calc(var(--shell-pad-x) * -1);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.marquee-track {
  display: flex;
  gap: var(--card-gap);
  width: max-content;
  will-change: transform;
}

.marquee-set {
  display: flex;
  gap: var(--card-gap);
}

/* --shift and --duration are measured and set by script.js; until then the
   row simply sits still, which is also the no-JS fallback. */
.marquee-track.is-animated {
  animation: marquee-scroll var(--duration, 30s) linear infinite;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  /* Exactly one set + one gap, which lands on the identical next set */
  to   { transform: translate3d(calc(var(--shift, 0px) * -1), 0, 0); }
}

.card {
  flex: 0 0 auto;
  width: var(--card-w);
  aspect-ratio: 194 / 196;
  overflow: hidden;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius);
  background: var(--glass);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

/* Per-card crops taken from the Figma frames */
.card--c1 { border-color: var(--glass-border); }
.card--c2 { border-color: var(--glass-border); }
.card--c4 img { object-position: 50% 58%; }
.card--c5 img { object-position: 50% 56%; }
.card--c6 img { object-position: 50% 59%; }

/* =============================== Contact modal ============================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--page-pad);
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: opacity 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
              -webkit-backdrop-filter 0.4s var(--ease);
}

.overlay[hidden] { display: none; }

.overlay.is-open {
  opacity: 1;
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}

/* Fallback blur for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .page {
    transition: filter 0.4s var(--ease);
  }
  body.is-modal-open .page { filter: blur(10px); }
}

.modal-shell {
  position: relative;
  width: min(478px, 100%);
  /* Reserves the strip the close button occupies above the panel (36px button
     + 16px gap), so it can never be pushed off-screen on a short viewport */
  padding-top: 52px;
}

.modal {
  max-height: calc(100svh - (var(--page-pad) * 2) - 52px);
  padding: 42px 41px 40px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--black);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
}

.overlay.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Close button — sits above the panel, flush with its right edge */
.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--black);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              background-color 0.25s var(--ease);
}

.overlay.is-open .modal-close {
  opacity: 1;
  transform: translateY(0);
}

.modal-close:hover { background: #1a1a1a; }
.modal-close img { width: 34px; height: 34px; }

.modal-title {
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  text-transform: capitalize;
}

.modal-title em {
  color: var(--red);
  font-style: italic;
  font-weight: 700;
}

.modal-intro {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: capitalize;
}

/* ---------------------------------- Form ---------------------------------- */
.form { margin-top: 26px; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field { margin-bottom: 25px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 500;
  text-transform: capitalize;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  font-size: 15px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.field input { height: 45px; }

.field textarea {
  min-height: 116px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.4;
}

.field input:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, 0.35); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.2);
}

.field.has-error input,
.field.has-error textarea { border-color: var(--red); }

.field-error {
  min-height: 0;
  margin-top: 6px;
  color: #ff7b7b;
  font-size: 13px;
  font-weight: 500;
}

.field-error:empty { display: none; }

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 5px 0 32px;
}

.checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--white);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: var(--red);
  background: var(--red);
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  margin: 3px auto 0;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-row label {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: capitalize;
  cursor: pointer;
}

.accent { color: var(--red); }

.btn-submit {
  display: flex;
  margin: 0 auto;
}

.form-status {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.form-status.is-success { color: #6ee7a8; }
.form-status.is-error { color: #ff7b7b; }

/* ================================ Responsive ============================== */
@media (max-width: 900px) {
  .hero-container { min-height: calc(100svh - (var(--page-pad) * 2)); }
  .hero-main { padding-bottom: 0; }
}

@media (max-width: 640px) {
  :root {
    --radius-shell: 22px;
    --card-w: clamp(112px, 34vw, 150px);
    --card-gap: 12px;
  }

  .hero-container { padding-block: 16px 40px; }

  .nav { padding: 0 10px 0 14px; }

  .nav-toggle { display: grid; }

  /* Links become a panel that drops out of the nav bar */
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(18, 18, 18, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease),
                visibility 0.28s var(--ease);
  }

  .nav.is-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 13px 14px;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }

  .hero-title { font-size: clamp(28px, 8.2vw, 40px); }

  .hero-body {
    margin-top: 20px;
    font-size: 15px;
  }

  .modal-shell { padding-top: 0; }

  .modal {
    max-height: calc(100svh - (var(--page-pad) * 2));
    padding: 32px 22px 30px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    z-index: 1;
  }

  .modal-title { padding-right: 44px; }
}

@media (max-width: 380px) {
  .btn-ghost { width: 100%; }
}

/* Landscape phones: let the hero grow and the page scroll rather than squash */
@media (max-height: 620px) and (min-width: 641px) {
  .hero-container { min-height: 620px; }
}

/* ============================= Reduced motion ============================= */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
