/* Core layout, responsive structure, reduced motion and print rules. */
:root {
  --bg: #123c65;
  --fg: #f3f7fb;
  --muted: #c0d3e3;
  --line: #6d90ae;
  --accent: #ffffff;
  --pad: clamp(24px, 4.2vw, 76px);
  color: var(--fg);
  background: var(--bg);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
}

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

a, button, summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.skip-link {
  position: fixed;
  top: -90px;
  left: 20px;
  background: var(--accent);
  color: var(--bg);
  padding: 13px 16px;
  font-weight: 500;
  z-index: 30;
  transition: top .18s ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px var(--pad) 0;
  overflow-x: clip;
  transition: box-shadow .25s ease;
}

.wordmark {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: -3px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.site-header nav a {
  padding: 12px 0;
  transition: color .2s ease, opacity .2s ease, background-color .2s ease, border-color .2s ease;
}

.site-header nav a:not(.contact-link):hover {
  color: var(--accent);
}

.contact-link {
  border-bottom: 1px solid var(--accent);
}

.story {
  position: relative;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: hidden;
  isolation: isolate;
}

.stage-caption {
  position: absolute;
  left: 42%;
  right: var(--pad);
  top: max(15.5%, 140px);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

#car-scene {
  position: absolute;
  left: 31%;
  top: 24%;
  width: 69%;
  height: 53%;
  touch-action: pan-y;
  cursor: grab;
}

#car-scene:active {
  cursor: grabbing;
}

#car-scene:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

#car-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-15%, -50%);
  color: var(--muted);
  max-width: 300px;
}

.scene-loading[hidden] {
  display: none;
}

.scene-unavailable #car-scene {
  display: none;
}

.scene-unavailable .scene-loading {
  padding: 22px;
  border: 1px solid var(--line);
}

.drawing-note {
  position: absolute;
  right: var(--pad);
  bottom: 13%;
  text-align: right;
  color: var(--muted);
}

.scene-tools {
  position: absolute;
  left: 42%;
  bottom: 14.5%;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
}

.scene-tools button {
  color: var(--fg);
  border: 0;
  background: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color .2s ease, opacity .2s ease, border-color .2s ease;
}

.scene-tools button:hover:not(:disabled) {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.scene-tools button[aria-pressed="true"] {
  color: var(--accent);
}

.scene-tools button:disabled {
  opacity: .42;
  cursor: default;
  border-bottom-color: transparent;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.scene-tools .view-controls button {
  border: 0;
  min-width: 32px;
  min-height: 32px;
  padding: 5px 7px;
}

.scene-tools .view-controls button:hover:not(:disabled) {
  color: var(--accent);
}

.scene-tools .view-controls button[hidden],
.view-controls[hidden] {
  display: none;
}

.part-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  white-space: nowrap;
  color: var(--accent);
  opacity: 0;
}

.pin {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.chapter-nav {
  position: absolute;
  bottom: 30px;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  z-index: 5;
}

.chapter-nav a {
  color: var(--muted);
  padding: 10px 0;
  transition: color .2s ease;
}

.chapter-nav a:hover {
  color: var(--fg);
}

.chapter-nav a span {
  margin-right: 10px;
  transition: color .2s ease;
}

.chapter-nav a[aria-current],
.chapter-nav a[aria-current] span {
  color: var(--accent);
}

.progress-line {
  position: absolute;
  top: -1px;
  height: 1.5px;
  left: 0;
  right: 0;
  pointer-events: none;
}

.progress-line span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  background: var(--accent);
}

.chapter {
  position: relative;
  min-height: 120vh;
  min-height: 120svh;
  display: flex;
  align-items: center;
  padding: 100px var(--pad) 150px;
  pointer-events: none;
}

.chapter:last-child {
  min-height: 100vh;
  min-height: 100svh;
}

.chapter-copy {
  width: 31%;
  max-width: 430px;
  pointer-events: auto;
}

.chapter h2,
.section-heading h2,
.contact h2 {
  margin: 25px 0;
}

.eyebrow {
  color: var(--accent);
  margin: 0;
}

.chapter p:not(.eyebrow) {
  margin: 24px 0;
}

.hero {
  min-height: 120vh;
  min-height: 120svh;
  align-items: flex-start;
  padding-top: 21vh;
  padding-top: 21svh;
}

.hero .chapter-copy {
  width: 43%;
  max-width: 640px;
}

.hero h1 {
  margin: 22px 0 28px;
}

.hero p.hero-intro {
  margin: 23px 0;
}

.scroll-cue {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  transition: color .2s ease;
}

.scroll-cue > span {
  display: grid;
  place-items: center;
  color: var(--accent);
  transition: transform .22s ease;
}

.scroll-cue:hover > span {
  transform: translateY(3px);
}

.function-context {
  border-top: 1px solid var(--line);
  margin: 28px 0 22px;
  padding-top: 18px;
}

.function-context dt {
  color: var(--fg);
  margin: 0 0 8px;
}

.function-context dd {
  margin: 0 0 18px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s ease, color .2s ease;
}

.text-link:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.text-link span {
  color: var(--accent);
  transition: transform .2s ease;
}

.text-link:hover span {
  transform: translateX(3px);
}

.workshop {
  position: relative;
  z-index: 3;
  padding: 80px var(--pad) 50px;
}

.section-heading h2 {
  margin: 24px 0 45px;
  max-width: 1000px;
}

.workshop-content {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 11%;
}

.workshop-intro {
  max-width: 420px;
  margin: 0;
}

.service-list details {
  border-top: 1px solid var(--line);
  padding: 23px 0;
}

.service-list details:last-child {
  border-bottom: 1px solid var(--line);
}

.service-list summary {
  display: flex;
  list-style: none;
  gap: 21px;
  align-items: center;
  cursor: pointer;
}

.service-list summary::-webkit-details-marker {
  display: none;
}

.service-list h3 {
  margin: 0;
  transition: color .2s ease;
}

.service-list summary:hover h3 {
  color: var(--accent);
}

.expand {
  margin-left: auto;
  transition: transform .22s ease;
}

.service-list details[open] .expand {
  transform: rotate(45deg);
}

.service-list details p {
  margin: 16px 0 6px;
  max-width: 520px;
}

.service-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
}

.marques {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 3vw;
  margin: 85px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.marques a {
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.marques a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.workshop-faq {
  position: relative;
  z-index: 3;
  padding: 68px var(--pad);
}

.faq-list {
  max-width: 860px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact {
  padding: 75px var(--pad);
  position: relative;
  z-index: 3;
}

.contact-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10%;
  align-items: start;
  margin-top: 20px;
}

.contact h2 {
  margin: 8px 0;
}

.contact-info > p {
  margin: 12px 0 23px;
}

.phone-link {
  display: block;
  width: fit-content;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  transition: border-color .2s ease, color .2s ease;
}

.phone-link:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.sms-link {
  display: inline-block;
  margin: 18px 0;
  transition: color .2s ease;
}

.sms-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact address {
  margin: 24px 0 17px;
}

footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 27px var(--pad);
  color: var(--muted);
}

.site-credit a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a {
  transition: color .2s ease;
}

footer a:hover {
  color: var(--accent);
}

.no-script {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 14px var(--pad);
  z-index: 20;
}

.reduced-motion {
  scroll-behavior: auto;
}

.reduced-motion * {
  transition: none !important;
  animation: none !important;
}

@media (min-width: 1600px) {
  .chapter-copy {
    max-width: 450px;
  }
}

@media (max-width: 1100px) {
  .site-header nav {
    gap: 22px;
  }

  .chapter-copy {
    width: 35%;
  }

  .hero .chapter-copy {
    width: 46%;
  }

  .scene-tools {
    left: 42%;
    bottom: 14%;
  }

  .drawing-note {
    bottom: 18%;
  }

  .stage-caption span:last-child {
    display: none;
  }

  .drag-hint {
    display: none;
  }

  .chapter {
    padding-bottom: 120px;
  }

  .chapter-nav a span {
    margin-right: 4px;
  }

  .workshop-content {
    gap: 6%;
  }
}

@media (max-width: 760px) {
  :root {
    --pad: 23px;
  }

  .site-header {
    padding: 12px var(--pad) 0;
  }

  .site-header nav > a:not(.contact-link) {
    display: none;
  }

  .stage-caption {
    top: max(15%, 112px);
    left: var(--pad);
    right: var(--pad);
  }

  .stage-caption span:last-child {
    display: none;
  }

  #car-scene {
    left: 0;
    top: 25%;
    width: 100%;
    height: 32%;
  }

  .chapter {
    min-height: 130svh;
    align-items: center;
    padding-top: 60svh;
    padding-bottom: 20svh;
  }

  .chapter-copy {
    width: 100%;
    max-width: 520px;
  }

  .chapter:not(.hero) .chapter-copy {
    background: var(--bg);
    padding: 18px 0;
    position: relative;
    z-index: 2;
  }

  .chapter h2 {
    margin: 14px 0;
  }

  .chapter p:not(.eyebrow) {
    margin: 15px 0;
  }

  .function-context {
    margin: 17px 0 10px;
    padding-top: 14px;
  }

  .function-context dd {
    margin-bottom: 13px;
  }

  .hero {
    align-items: flex-start;
    padding-top: 20svh;
    min-height: 130svh;
  }

  .hero .chapter-copy {
    width: 100%;
    max-width: none;
  }

  .hero h1 {
    margin: 17px 0;
  }

  .hero h1 > span {
    display: block;
  }

  .hero-visible #car-scene {
    top: 40%;
    height: 26%;
  }

  .hero-visible .stage-caption {
    top: 34%;
  }

  .drawing-note {
    display: none;
  }

  .scene-tools {
    bottom: auto;
    top: 56%;
    left: auto;
    right: var(--pad);
    gap: 14px;
  }

  .scene-tools button {
    min-height: 36px;
  }

  .scene-tools .view-controls button {
    min-width: 36px;
    min-height: 36px;
  }

  .hero-visible .part-label {
    display: none;
  }

  .chapter-nav {
    bottom: 16px;
    padding-top: 12px;
    gap: 3px;
  }

  .chapter-nav a {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 0;
  }

  .chapter-nav a span {
    margin: 0;
  }

  .chapter:last-child {
    min-height: 115svh;
  }

  .scene-loading {
    left: var(--pad);
    right: var(--pad);
    top: 48%;
    transform: translateY(-50%);
  }

  .workshop {
    padding-top: 54px;
  }

  .section-heading h2 {
    margin-bottom: 30px;
  }

  .workshop-content {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .service-list summary {
    gap: 15px;
  }

  .marques {
    gap: 14px;
    margin-top: 44px;
  }

  .contact {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .contact-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 761px) and (max-height: 740px) {
  .hero {
    padding-top: 19vh;
  }

  .hero h1 {
    margin-top: 14px;
  }

  .hero p.hero-intro {
    margin: 17px 0;
  }

  .scroll-cue {
    margin-top: 5px;
  }

  .chapter h2 {
    margin: 16px 0;
  }

  .function-context {
    margin: 18px 0 12px;
  }

  .function-context dd {
    margin-bottom: 12px;
  }

  .chapter-copy {
    max-width: 375px;
  }
}

@media print {
  .stage,
  .scroll-cue,
  .scene-tools,
  .skip-link,
  .no-script,
  .site-header nav {
    display: none !important;
  }

  .site-header {
    position: static;
    padding: 0 16px 16px;
    border-bottom: 1px solid #b7cde0;
    box-shadow: none;
  }

  .brand-mark {
    width: 190px;
  }

  body {
    background: #ffffff !important;
    color: #123c65 !important;
  }

  .story {
    padding: 0 16px;
  }

  .chapter,
  .hero {
    min-height: 0;
    padding: 20px 0;
    break-inside: avoid;
  }

  .chapter-copy,
  .hero .chapter-copy {
    width: 100%;
    max-width: none;
  }

  .hero p.hero-intro {
    position: static;
    margin-top: 16px;
  }

  .workshop,
  .contact,
  .drawing-reference,
  footer {
    padding: 24px 16px;
  }
}
