/* Hero, navigation and enquiry panel. Shared tokens and controls live in tokens.css. */
/* ---------- Navigation ---------- */
.nav {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad-x);
}
/* A single hairline with end ticks, the only drawing-sheet reference in the hero. */
.nav::after {
  content: ""; position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 0; height: 7px;
  border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  background: linear-gradient(var(--hairline), var(--hairline)) center / 100% 1px no-repeat;
}
.mark {
  grid-column: 2; font-family: var(--serif); font-size: 21px; color: var(--graphite);
  text-decoration: none; padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center;
}

.nav-contact { justify-self: end; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: clamp(40px, 6.5vh, 64px);
}
.plate {
  position: absolute; z-index: -1; left: 4vw; right: 4vw; top: 3.5vh; height: 51.75vw;
  background: url("assets/bearing-hero-poster.jpg") 50% 0 / cover no-repeat;
}
/* The video sits exactly over the poster (same cover/top alignment) and only appears once frames are playing. */
.plate-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0; opacity: 0; pointer-events: none;
  /* The decoded edge row can sit a level darker than the fades; trimming it keeps the frame edge invisible. */
  clip-path: inset(3px);
}
.plate.is-playing .plate-video { opacity: 1; }
.plate::before, .plate::after { z-index: 1; }
.plate::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--studio) 0%, rgba(234,234,234,0) 8%, rgba(234,234,234,0) 92%, var(--studio) 100%),
    linear-gradient(180deg, var(--studio) 0%, rgba(234,234,234,0) 6%);
}
.plate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--studio) 0%, rgba(234,234,234,0) 22%); }

/* Reserves the bearing's footprint so the copy can never ride up over it; short screens scroll instead. */
.object-space { flex: none; height: calc(3.5vh + 35.5vw + 12px); }

.copy { margin-top: auto; width: min(880px, 92vw); text-align: center; }
h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(32px, 4.9vw, 72px); line-height: 1.02; letter-spacing: -0.02em;
}
h1 span { display: block; }
h1 em { display: block; color: var(--graphite-dim); }
.support, .enquiry h2, .notice, .done p { text-wrap: pretty; }
.enquiry h2 { text-wrap: balance; }
.support { margin: 20px auto 0; max-width: 580px; font-size: 15.5px; line-height: 1.6; color: var(--graphite-dim); }

/* Centreline through the object, drawn as a faint long-dash/dot line. */
.axis {
  position: absolute; left: 50%; width: 1px; margin-left: -0.5px;
  background: repeating-linear-gradient(180deg, var(--hairline) 0 12px, transparent 12px 16px, var(--hairline) 16px 18px, transparent 18px 22px);
}
.axis-top { top: calc(var(--nav-h) + 6px); height: max(0px, calc(3.5vh + 5.4vw - var(--nav-h) - 14px)); }
.axis-bottom { bottom: 0; height: clamp(20px, calc(6.5vh - 18px), 44px); }

.copy .race, .done .race { margin-top: 24px; }
.enquiry .race:focus-visible .ball { box-shadow: 0 0 0 2.5px var(--panel), 0 0 0 3.5px var(--graphite); }
.close:focus-visible { border-radius: 50%; outline-offset: 3px; }

/* ---------- Enquiry panel ---------- */
.enquiry {
  position: fixed; inset: 0 0 0 auto; margin: 0 0 0 auto;
  width: min(520px, 100vw); height: 100%; max-height: 100%; max-width: 100vw;
  border: 0; border-left: 1px solid var(--hairline);
  background: var(--panel); color: var(--graphite);
  overflow-y: auto; overscroll-behavior: contain;
}
.enquiry[open] { animation: panel-in .45s var(--ease); }
.enquiry::backdrop { background: rgba(30, 33, 36, 0.22); backdrop-filter: blur(2px); }
@keyframes panel-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }

.enquiry-inner { padding: 28px clamp(24px, 5vw, 44px) 40px; }
.enquiry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; }
.enquiry h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 4vw, 34px); line-height: 1.1; letter-spacing: -0.015em; padding-top: 6px; }

.close { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--track); transition: border-color .3s; }
.close span, .close span::before { position: absolute; left: 13px; right: 13px; top: 50%; height: 1px; background: var(--graphite); transform: rotate(45deg); }
.close span::before { content: ""; left: 0; right: 0; transform: rotate(90deg); }
.close:hover { border-color: var(--graphite); }

.notice {
  position: relative; padding: 14px 0 14px 22px; font-size: 14px; line-height: 1.55; color: var(--graphite);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.notice::before { content: ""; position: absolute; left: 0; top: 21px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--graphite); }
.notice strong { font-weight: 500; }

.intro { margin: 24px 0 8px; font-size: 15px; line-height: 1.6; color: var(--graphite-dim); }

.enquiry .field { margin-top: 22px; }
.error { display: block; min-height: 20px; padding-top: 6px; font-size: 13px; color: var(--alert); }

.form .race-submit { margin-top: 18px; }

/* Enquiry panel: the page the visitor came from (guides only). */
.enquiry-topic { padding: 16px 0 18px; border-bottom: 1px solid var(--hairline); }
.enquiry-topic-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-dim); }
.enquiry-topic-name { margin-top: 6px; font-family: var(--serif); font-size: 20px; line-height: 1.3; color: var(--graphite); text-wrap: balance; }
.enquiry-topic-page { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--graphite-dim); overflow-wrap: anywhere; }
.enquiry .no-credentials { margin-bottom: 8px; font-size: 14px; line-height: 1.55; color: var(--graphite); }
#e-business:empty { min-height: 0; padding-top: 0; }
.count { display: block; padding-top: 4px; font-size: 12.5px; color: var(--graphite-dim); }
.count[hidden] { display: none; }
.count.over { color: var(--alert); }
.enquiry-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.enquiry-status { margin-top: 18px; padding: 12px 0 12px 22px; position: relative; font-size: 14px; line-height: 1.55; color: var(--graphite); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); text-wrap: pretty; }
.enquiry-status::before { content: ""; position: absolute; left: 0; top: 19px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--graphite); }
.enquiry-status[data-tone="problem"]::before { background: var(--graphite); }
.enquiry-status:focus { outline: none; }
.enquiry-status:focus-visible { outline: 1.5px solid var(--graphite); outline-offset: 4px; }
.enquiry-status a, .enquiry-alt a, .done a { color: inherit; text-decoration: underline; text-decoration-color: var(--track); text-underline-offset: 3px; }
.enquiry-actions { display: flex; flex-wrap: wrap; align-items: center; column-gap: 28px; }
.enquiry-discard { margin-top: 18px; }
.enquiry-discard[hidden] { display: none; }
.race-submit[hidden] { display: none; }
.race-submit[aria-disabled] { opacity: 0.55; cursor: default; }
.enquiry-alt { margin-top: 18px; font-size: 13px; line-height: 1.55; color: var(--graphite-dim); }

.done { padding-top: 28px; }
.done:focus { outline: none; }
.done h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.2; }
.done p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--graphite-dim); max-width: 400px; }

/* ---------- Phone ---------- */
@media (max-width: 759px) {
  :root { --nav-h: 76px; }
  .nav { grid-template-columns: auto 1fr auto auto; column-gap: 6px; }
  .mark { grid-column: 1; font-size: 20px; padding-left: 0; }
  .nav-contact { grid-column: 4; grid-row: 1; }

  .plate { left: -37.5vw; right: -37.5vw; top: calc(var(--nav-h) - 6vw); height: 98.4vw; }
  .plate::before { background: linear-gradient(180deg, var(--studio) 0%, rgba(234,234,234,0) 10%); }
  .object-space { height: calc(var(--nav-h) + 61.5vw + 6px); }
  .copy { margin-top: clamp(0px, 5vh - 14px, 36px); margin-bottom: auto; width: calc(100vw - 2 * var(--pad-x)); }
  .hero { padding-bottom: 40px; }
  h1 { font-size: clamp(30px, 9.4vw, 44px); }
  .support { font-size: 15px; margin-top: 16px; }
  .copy .race { margin-top: 18px; }
  .axis-top { display: none; }

  .enquiry { width: 100vw; border-left: 0; }
  .enquiry[open] { animation-name: sheet-in; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
