html {
  scroll-padding-block-start: calc(var(--fixed-header-height, 0px) + var(--preview-bar-height, 0px));
}

body > header {
  position: sticky;
  top: var(--preview-bar-height, 0px);
  z-index: 50;
  background: #fff;
}

header .nav-cta {
  background: #000;
  border-color: #000;
  color: #fff;
}

header.has-side-menu {
  flex-wrap: nowrap;
  height: auto;
  min-height: 64px;
  gap: 12px;
  padding-block: 8px;
}

header.has-side-menu .nav-cta { margin: 0 0 0 auto; }
header.has-side-menu .mobile-menu,
#navigation-drawer .drawer-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.menu-bars {
  width: 20px;
  height: 14px;
  border-block: 2px solid currentColor;
  display: grid;
  align-items: center;
}
.menu-bars::after { content: ''; height: 2px; background: currentColor; }

#navigation-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) 20px;
  width: min(340px, 88vw);
  height: 100%;
  max-height: none;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#navigation-drawer[open] { animation: drawer-enter .24s ease-out; }
#navigation-drawer::backdrop { background: rgb(0 0 0 / 35%); backdrop-filter: none; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
#navigation-title { font: 700 32px/1 var(--display); text-transform: uppercase; }
#navigation-drawer .drawer-close { font: 26px/1 var(--body); }
#navigation-drawer .nav {
  position: static;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  gap: 0;
  border: 0;
  background: transparent;
}
#navigation-drawer .nav a {
  padding-block: 12px;
  min-height: 60px;
  font: 600 20px/1.3 var(--body);
  gap: 14px;
  border-top: 1px solid var(--line);
}
#navigation-drawer .nav-number { font-size: 12px; }
html.drawer-open { overflow: hidden; }
@keyframes drawer-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { #navigation-drawer[open] { animation: none; } }
@media (max-width: 430px) {
  header.has-side-menu .nav-cta { display: none; }
  header.has-side-menu .mobile-menu { margin-left: auto; }
}

main > section[id], #manual.manual-deck {
  scroll-margin-block-start: 0;
}

header .nav a[aria-current="location"] {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

body > header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: var(--red);
  transform-origin: left;
  transform: translateX(var(--indicator-x, 0px)) scaleX(var(--indicator-scale, 0));
}
header:not(.has-side-menu)::after {
  transition: transform .32s cubic-bezier(.22,.7,.25,1);
}
header:not(.has-side-menu) .nav a[aria-current="location"] { text-decoration: none; }

.gear svg .shift-trace {
  stroke: var(--red);
  stroke-linecap: round;
  pointer-events: none;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .gear.entered .shift-trace { animation: trace-gates 1.6s ease-in-out; }
  .culture-photo.photo-entrance { animation: settle-photo 1s cubic-bezier(.2,.65,.3,1); }
  #culture-title.entered { animation: reveal-model .6s ease-out; }
}
@keyframes trace-gates {
  0% { opacity: 0; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
  10% { opacity: 1; }
  80% { opacity: 1; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
}
@keyframes settle-photo { from { transform: scale(1.045); } to { transform: scale(1); } }
@keyframes reveal-model { from { opacity: .25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  header:not(.has-side-menu)::after { transition: none; }
}

.js .reveal,
.js .reveal[data-motion] {
  opacity: .72;
  transform: translateY(9px);
  transition: opacity .42s ease-out, transform .5s cubic-bezier(.22,.61,.36,1);
  transition-delay: 0s;
}

.js .reveal.visible,
.js .reveal:focus-within,
.js section:target > .reveal,
.js section:target .section-head {
  opacity: 1;
  transform: none;
}

#sourcing-form {
  background: #fafafa;
  padding: clamp(18px, 3vw, 36px);
}

#sourcing-form .sourcing-priorities,
#sourcing-form .sourcing-contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#sourcing-form label {
  display: block;
  font: 600 14px/1.4 var(--body);
  letter-spacing: 0;
  text-transform: none;
}

#sourcing-form .sourcing-vehicles {
  border-block: 1px solid var(--line);
  margin: 20px 0;
}

.sourcing-vehicles summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.sourcing-vehicles summary::-webkit-details-marker { display: none; }
.sourcing-vehicles summary::after { content: '+'; margin-left: auto; font: 22px var(--mono); color: var(--red); }
.sourcing-vehicles[open] summary::after { content: '−'; }
.sourcing-vehicles summary span { font-weight: 400; font-size: 13px; }
.sourcing-vehicles summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
#sourcing-form fieldset { background: white; }
#sourcing-form .sourcing-contact { margin-bottom: 18px; }
#source-result:empty, #coaching-eligibility:empty, #lesson-result:empty { display: none; }
#manual .manual-slide [data-gear].active { border-color: var(--red); }
#manual .manual-layout { width: 100%; }
.manual-shifter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}
.manual-next-area {
  display: grid;
  align-items: center;
  padding-left: clamp(10px, 1.8vw, 28px);
}
.manual-next {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font: 24px/1 var(--body);
  cursor: pointer;
  transition: opacity .18s ease-out, border-color .18s ease-out;
}
.manual-next:hover { border-color: currentColor; }
.manual-next:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
#manual .gear { max-width: 100%; }
#manual .gear button:nth-of-type(3), #manual .gear button:nth-of-type(4) { left: calc(50% - 24px); }
@media (hover: hover) and (pointer: fine) {
  .manual-next { opacity: 0; }
  .manual-next-area:hover .manual-next, .manual-next:focus-visible { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .manual-next { transition: none; }
}
#manual .manual-layout .button { margin-top: 18px !important; }
#manual .manual-slide :is(input, select, textarea):focus-visible, #sourcing-form :is(input, select, textarea):focus-visible {
  outline-offset: 1px;
}

@media (max-width: 640px) {
  #manual.manual-deck { scroll-margin-top: 0; }
  #manual.manual-deck .manual-layout { gap: 18px; }
  #manual .manual-layout h2 { margin: 14px 0; }
  #manual .manual-layout .text { line-height: 1.55; }
  #manual .gear-panel { padding: 16px 20px; }
  #manual .gear { height: 155px; width: min(235px, 100%); margin: 14px auto; }
  #manual .gear button:nth-of-type(3), #manual .gear button:nth-of-type(4) { left: calc(50% - 24px); }
  #manual .gear-description { min-height: 88px; padding-top: 12px; }
  #manual .gear-description p { margin-top: 5px; }
  #manual .manual-caption { margin-top: 10px; }
  #sourcing-form input, #sourcing-form select, #sourcing-form textarea, #contact-form input, #contact-form select, #contact-form textarea { font-size: 16px; }
  #sourcing-form .sourcing-priorities, #sourcing-form .sourcing-contact { gap: 12px; }
}

@media (max-width: 440px) {
  #sourcing-form .sourcing-contact, #sourcing-form .sourcing-priorities { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal[data-motion] { opacity: 1; transform: none; transition: none; }
}
