/* =====================================================================
   TEMAI 7 | hero.css
   owner task: code-shell (hero + showroom, option B of bible section 15)
   Figma: Hero / Desktop / AR 69:2119, EN 82:2735, phone 71:1605 (PNGs 05-hero-desktop-*.png, 06-hero-phone-ar.png)
   Desktop 1440x900: nav 88, kicker + trust line, one-line headline, stage (outlined name, car, horizon, reflection), then the band
   under the floor (lead, buttons | info row), then the chips strip. #showroom is display:contents: its children are cells of .hero__in.
   Phone: stage first, info row, kicker, headline, lead, buttons, trust list, chips.
   Animate transform, opacity, clip-path, filter only.
   ===================================================================== */

/* entrance clock: when the loader runs, the hero plays under it and is revealed by the wipe (loader 1.4 s + wipe 0.7 s) */
html { --hero-t0: 0.05s; }
html:not(.no-loader) { --hero-t0: 1.3s; }
html.loader-skip { --hero-t0: 0.05s; }

.hero {
  --floor-h: 223px;                                  /* band + chips under the horizon (Figma: 900 - 677) */
  position: relative; isolation: isolate; overflow: clip; container-type: inline-size;
  height: calc(100svh - var(--announce-h)); min-height: 640px;
  background: radial-gradient(90% 70% at 50% 34%, #101317 0%, var(--color-bg-base) 70%);
}
.hero__fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__breath {                                      /* far red breath behind the car (never behind text) */
  position: absolute; inset-inline-start: 50%; top: 30%; width: min(70cqw, 1100px); aspect-ratio: 2 / 1; transform: translate(-50%, 0);
  background: radial-gradient(closest-side, rgba(230, 50, 59, 0.13), transparent);
  animation: hero-fade 1.4s var(--ease-out) calc(var(--hero-t0) + 0.2s) both;
}
[dir="rtl"] .hero__breath { transform: translate(50%, 0); }
.hero__vignette { position: absolute; inset: 0; background: radial-gradient(120% 95% at 50% 42%, transparent 52%, var(--color-bg-base) 100%); }

.hero__in {
  --pad: max(var(--page-margin), calc((100cqw - var(--content-max)) / 2));
  position: relative; z-index: 1; height: 100%;
  padding: var(--nav-h) var(--pad) 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  align-content: stretch;
}
.hero__top { grid-column: 1 / -1; grid-row: 1; position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: var(--space-12); padding-block-start: var(--space-32); }
.show { display: contents; }

/* kicker + trust line */
.hero__kicker { grid-row: 1; grid-column: 1; min-width: 0; flex-wrap: nowrap; }
.hero__kicker .kicker__code { color: var(--color-text-secondary); }
.hero__code-short { display: none; }
.hero__trust { grid-row: 1; grid-column: 2; display: flex; align-items: center; font-size: var(--fs-body-s); line-height: var(--lh-body-s); color: var(--color-text-secondary); white-space: nowrap; }
.hero__trust li { display: inline-flex; align-items: center; gap: var(--space-8); }
.hero__trust li + li { margin-inline-start: var(--space-24); padding-inline-start: var(--space-24); border-inline-start: 1px solid var(--color-line-hair); }
.hero__trust .status { color: var(--color-text-secondary); }
.pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--color-state-ok); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--color-state-ok); opacity: 0.5; animation: pulse 2.4s var(--ease-out) infinite; }
.pulse.is-off { background: var(--color-text-muted); }
.pulse.is-off::after { animation: none; opacity: 0; }
@keyframes pulse { from { transform: scale(1); opacity: 0.5; } to { transform: scale(2.6); opacity: 0; } }

/* headline: one line on desktop, two lines on phones; lines rise through a mask */
.hero__h {
  grid-row: 2; grid-column: 1 / -1; overflow: hidden; padding-block: 0.02em; text-wrap: balance;
  font-family: var(--font-display); font-weight: 800; color: var(--color-text-primary);
  font-size: calc((100cqw - 2 * var(--pad)) * 0.086); line-height: 1.12; letter-spacing: 0;
}
:lang(en) .hero__h { font-size: calc((100cqw - 2 * var(--pad)) * 0.0778); letter-spacing: var(--ls-latin-display); }
.hero__h-in { display: block; white-space: nowrap; animation: h-rise 900ms var(--ease-out) calc(var(--hero-t0) + 0.06s) both; }
.hero__h br { display: none; }
.hero__h .hl { display: inline-block; margin-inline-start: 0.24em; color: inherit; animation: h-rise 900ms var(--ease-out) calc(var(--hero-t0) + 0.15s) both; }
@keyframes h-rise { from { transform: translateY(105%); } to { transform: none; } }

/* entrance for everything else */
.hero__rise { animation: hero-rise 700ms var(--ease-out) calc(var(--hero-t0) + var(--d, 0s)) both; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }
html.loader-skip .hero__rise, html.loader-skip .hero__h-in, html.loader-skip .hero__h .hl { animation-delay: var(--d, 0s); }

/* ---------- stage ---------- */
.show__stage {
  grid-row: 2; grid-column: 1 / -1; position: relative; z-index: 1; min-height: 0;
  margin-inline: calc(var(--pad) * -1); margin-block-start: calc(var(--space-12) * -1);
  outline-offset: -4px;
}
.show__stage:focus-visible { outline: var(--focus-ring); }
.show__name {                                       /* outlined model name, standing on the horizon behind the car */
  position: absolute; inset-inline: 0; bottom: 4px; text-align: center; white-space: nowrap; overflow: hidden; pointer-events: none; user-select: none;
  font-family: var(--font-display); font-weight: 800; font-size: min(15.3cqw, 24svh); line-height: 1; letter-spacing: -0.01em;
  color: transparent; -webkit-text-stroke: 1px rgba(201, 206, 212, 0.34); direction: ltr;
  transform: translate3d(calc(var(--px, 0) * 10px), 0, 0); transition: transform 600ms var(--ease-out);
  animation: hero-fade 1.2s var(--ease-out) calc(var(--hero-t0) + 0.1s) both;
}
.show__pool {                                       /* the one light pool, under and slightly behind the car */
  position: absolute; inset-inline-start: 50%; bottom: -34px; width: min(88cqw, 1300px); height: 150px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), transparent); pointer-events: none;
  animation: pool-in 1.4s var(--ease-out) calc(var(--hero-t0) + 0.2s) both;
}
[dir="rtl"] .show__pool { transform: translateX(50%); }
@keyframes pool-in { from { opacity: 0; } to { opacity: 1; } }
.show__stage::after {                               /* the floor: a soft lift under the horizon, fading out */
  content: ""; position: absolute; inset-inline: 0; top: 100%; height: calc(var(--floor-h) - 20px); z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent); border-block-start: 1px solid var(--color-line-hair);
}
.show__floor { position: absolute; inset-inline: 0; top: 100%; height: 14px; z-index: 0; opacity: 0.9; animation: ticks-in 1.2s var(--ease-out) calc(var(--hero-t0) + 0.3s) both; }
@keyframes ticks-in { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0); } }

.show__car {
  position: absolute; inset: -12px 0 0 0; z-index: 1; pointer-events: none;
  transform: translate3d(calc(var(--px, 0) * -14px), 0, 0); transition: transform 600ms var(--ease-out);
}
.show__img {
  position: absolute; inset: 0; opacity: 0; filter: blur(6px);
  transform: translateX(calc(var(--dir, 1) * 60px));
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), filter var(--dur-slow) var(--ease-out);
}
.show__img.is-on { opacity: 1; transform: none; filter: none; }
.show__img.is-out { opacity: 0; transform: translateX(calc(var(--dir, 1) * -60px)); filter: blur(6px); }
.show__img.is-static { animation: car-in 1.1s var(--ease-out) calc(var(--hero-t0) + 0.1s) both; }
html.loader-skip .show__img.is-static { animation-delay: 0.05s; }
@keyframes car-in { from { opacity: 0; transform: translateX(40px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.show__img img {
  position: absolute; inset-inline-start: 50%; bottom: 0; width: min(68cqw, 1300px); max-width: none; height: 100%;
  object-fit: contain; object-position: center bottom; transform: translateX(-50%); user-select: none; -webkit-user-drag: none;
}
[dir="rtl"] .show__img img { transform: translateX(50%); }
.show__img .show__refl {                            /* same photo, flipped, 18% and fading out within 70% of its height */
  transform: translateX(-50%) translateY(100%) scaleY(-1); opacity: 0.18;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 70%); mask-image: linear-gradient(to top, #000 0%, transparent 70%);
}
[dir="rtl"] .show__img .show__refl { transform: translateX(50%) translateY(100%) scaleY(-1); }

/* ---------- band under the floor ---------- */
.hero__sub {
  grid-row: 3; grid-column: 1 / -1; position: relative; z-index: 3; max-width: 520px; justify-self: start; padding-block-start: var(--space-16);
  font-size: var(--fs-body-m); line-height: var(--lh-body-m); color: var(--color-text-secondary); text-wrap: pretty;
}
.hero__cta { grid-row: 4; grid-column: 1; position: relative; z-index: 3; display: flex; align-items: center; gap: var(--space-12); padding-block: var(--space-16) var(--space-20); }
.hero__cta .btn { white-space: nowrap; }
.hero__book { position: relative; overflow: hidden; }
.hero__book::before {                               /* idle sheen every 6 s, hero only */
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-160%) skewX(-18deg); animation: sheen 6s var(--ease-inout) 3.4s infinite;
}
[dir="rtl"] .hero__book::before { transform: translateX(160%) skewX(18deg); animation-name: sheen-rtl; }
@keyframes sheen { 0%, 70% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(420%) skewX(-18deg); } }
@keyframes sheen-rtl { 0%, 70% { transform: translateX(160%) skewX(18deg); } 100% { transform: translateX(-420%) skewX(18deg); } }
.hero__book:hover::before, .hero__book:focus-visible::before { animation-play-state: paused; }

.show__info { grid-row: 4; grid-column: 2; position: relative; z-index: 3; display: flex; align-items: center; justify-self: end; gap: var(--space-16); padding-block: var(--space-16) var(--space-20); }
.show__brand { align-self: center; }
.show__model { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-heading-l); line-height: var(--lh-heading-l); color: var(--color-text-primary); white-space: nowrap; }
:lang(en) .show__model { letter-spacing: var(--ls-latin-display); }
.show__tags { display: flex; align-items: center; gap: var(--space-12); }
.tag {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: var(--space-24);
  border: 1px solid var(--color-line-strong); border-radius: var(--radius-pill); background: transparent; white-space: nowrap;
  font-size: var(--fs-label-l); line-height: var(--lh-label-l); font-weight: 500; color: var(--color-text-primary);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tag:hover { background: var(--color-surface-2); border-color: var(--color-metal-steel); }
.tag:active { transform: scale(0.98); background: var(--color-surface-3); }
.tag:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.show__count { font-family: var(--font-code); font-size: var(--fs-code-m); line-height: var(--lh-code-m); font-weight: 500; letter-spacing: var(--ls-code); color: var(--color-text-muted); direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.show__arrows { display: flex; gap: var(--space-12); }
.show__arrow { flex: none; }

/* ---------- car chips strip: closes the first viewport ---------- */
.show__chips {
  grid-row: 5; grid-column: 1 / -1; position: relative; z-index: 3;
  margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: 64px;
  border-block-start: 1px solid var(--color-line-hair); background: rgba(8, 9, 10, 0.5);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.show__chips::-webkit-scrollbar { display: none; }
.carchip {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding-inline-end: var(--space-8);
  text-align: start; color: var(--color-text-secondary); transition: color var(--dur-fast) var(--ease-out);
}
.carchip small { font-family: var(--font-code); font-size: var(--fs-code-s); line-height: var(--lh-code-s); font-weight: 500; letter-spacing: var(--ls-code); text-transform: uppercase; color: var(--color-text-muted); direction: ltr; text-align: start; white-space: nowrap; }
.carchip b { font-family: var(--font-text); font-weight: 500; font-size: var(--fs-label-l); line-height: var(--lh-label-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carchip::before {                                  /* the red marker on the top edge of the active chip */
  content: ""; position: absolute; inset-block-start: -1px; inset-inline-start: 0; width: 28px; height: 4px; border-radius: 1px; background: var(--color-brand-red);
  transform: scaleX(0); transform-origin: left center; transition: transform var(--dur-base) var(--ease-out);
}
[dir="rtl"] .carchip::before { transform-origin: right center; }
.carchip:hover, .carchip.is-on { color: var(--color-text-primary); }
.carchip.is-on::before { transform: scaleX(1); }
.carchip:focus-visible { outline: var(--focus-ring); outline-offset: -4px; border-radius: var(--radius-sm); }

/* English: longer labels, so the service pills give way (Figma 05-hero-desktop-en shows none) and the band gets room to breathe */
@media (min-width: 1180px) {
  .hero__cta { margin-inline-end: var(--space-32); }
  :lang(en) .show__tags { display: none; }
  .hero__sub { padding-block-start: var(--space-24); }
}

/* laptops: the English tags are longer, so the band gets tighter before it would collide */
@media (min-width: 1180px) and (max-width: 1399px) {
  .show__count { display: none; }
  .tag { padding-inline: var(--space-16); }
  .show__tags, .show__info { gap: var(--space-8) var(--space-12); }
}

/* short desktop screens (1280x720 and similar): tighten the vertical rhythm */
@media (min-width: 1180px) and (max-height: 800px) {
  .hero { --floor-h: 205px; }
  .hero__top { padding-block-start: var(--space-20); }
  .hero__sub { padding-block-start: var(--space-8); }
  .hero__cta, .show__info { padding-block: var(--space-12) var(--space-16); }
}

/* ---------- tablet and phone: stacked layout (Figma phone 71:1605) ---------- */
@media (max-width: 1179px) {
  .hero { height: auto; min-height: 0; --floor-h: 0px; }
  .hero__in { display: flex; flex-direction: column; height: auto; padding-block-end: 0; }
  .hero__top { display: contents; }
  .show { display: contents; }
  .show__stage { order: 1; flex: none; margin-block-start: 0; height: clamp(150px, 24svh, 300px); margin-inline: calc(var(--pad) * -1); }
  .show__info { order: 2; padding-block: var(--space-24) var(--space-32); justify-self: stretch; flex-wrap: wrap; gap: var(--space-12) var(--space-16); }
  .hero__kicker { order: 3; }
  .hero__h { order: 4; margin-block: var(--space-16) var(--space-16); }
  .hero__sub { order: 5; max-width: 62ch; padding: 0; font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
  .hero__cta { order: 6; padding-block: var(--space-24); }
  .hero__trust { order: 7; padding-block-end: var(--space-32); }
  .show__chips { order: 8; flex: none; grid-auto-columns: 128px; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); }
  .carchip { scroll-snap-align: start; }
  .hero__code-long { display: none; }
  .hero__code-short { display: inline; }
  .hero__h { font-size: clamp(44px, 9vw, 76px); line-height: 1.22; white-space: normal; }
  :lang(en) .hero__h { font-size: clamp(34px, 9.2vw, 76px); line-height: 1.12; }
  .hero__h br { display: inline; }
  .hero__h .hl { margin-inline-start: 0; }
  .hero__h-in { white-space: normal; }
  .show__name { font-size: clamp(96px, 25cqw, 190px); bottom: 0; }
  .show__img img { width: min(94cqw, 760px); }
  .show__pool { bottom: -20px; height: 90px; }
  .show__tags { display: none; }
  .show__info { display: flex; flex-wrap: nowrap; gap: var(--space-12); }
  .show__model { font-size: var(--fs-heading-m); line-height: var(--lh-heading-m); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .show__arrows { gap: var(--space-8); }
  .show__count { margin-inline-start: auto; }
  .hero__trust { flex-direction: column; align-items: flex-start; gap: var(--space-8); white-space: normal; }
  .hero__trust li + li { margin: 0; padding: 0; border: 0; }
  .hero__trust li:not(.status)::before {            /* check mark */
    content: ""; flex: none; width: 20px; height: 20px; background: var(--color-text-secondary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .hero__trust .status { padding-inline-start: 6px; }
  .hero__sub, .hero__cta { padding-inline: 0; }
}
@media (max-width: 759px) {
  .hero__in { padding-block-start: var(--nav-h); }
  .hero__cta { flex-direction: column; align-items: stretch; gap: var(--space-12); }
  .hero__cta .btn { --btn-h: 56px; width: 100%; }
  .show__info .icon-btn { width: 48px; height: 48px; }
}
@media (max-width: 389px) {
  .show__count { display: none; }
  .show__chips { height: 64px; }
}
/* phone, short screens (360x740): the buttons must stay inside the first screen */
@media (max-width: 759px) and (max-height: 800px) {
  .show__stage { height: clamp(140px, 21svh, 170px); }
  .show__info { padding-block: var(--space-16) var(--space-16); }
  .hero__h { margin-block: var(--space-12) var(--space-8); }
  .hero__sub { font-size: var(--fs-body-m); line-height: var(--lh-body-m); }
  .hero__cta { padding-block: var(--space-16); gap: var(--space-8); }
  .hero__cta .btn { --btn-h: 52px; }
}

/* ---------- reduced motion: no slides, no sheen, no pulse; opacity only ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__rise, .hero__h-in, .hero__h .hl, .show__img.is-static, .show__floor, .show__name, .show__pool, .hero__breath { animation: hero-fade 120ms linear both; animation-delay: 0s; }
  .hero__book::before, .pulse::after { animation: none; }
  .show__img, .show__img.is-out { transform: none; filter: none; transition: opacity 120ms linear; }
  .show__car, .show__name { transform: none; transition: none; }
}
html.reduce-motion .hero__rise, html.reduce-motion .hero__h-in, html.reduce-motion .hero__h .hl, html.reduce-motion .show__img.is-static, html.reduce-motion .show__floor, html.reduce-motion .show__name, html.reduce-motion .show__pool, html.reduce-motion .hero__breath { animation: hero-fade 120ms linear both; animation-delay: 0s; }
html.reduce-motion .hero__book::before, html.reduce-motion .pulse::after { animation: none; }
html.reduce-motion .show__img, html.reduce-motion .show__img.is-out { transform: none; filter: none; }
