:root {
  --paper: #f2f1ec;
  --paper-deep: #e9e7e0;
  --ink: #171816;
  --ink-soft: #555750;
  --muted: #7e8078;
  --line: #d6d4cc;
  --line-dark: #b9b7ae;
  --screen: #151614;
  --screen-soft: #1d1e1b;
  --paper-on-screen: #f5f4ef;
  --accent: #d64725;
  --accent-soft: #f1d9d1;
  --max-width: 1440px;
  --pad: clamp(20px, 4vw, 64px);
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(23, 24, 22, .025) calc(100% - 1px)),
    var(--paper);
  background-size: 72px 100%;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

svg {
  display: block;
}

.scroll-meter {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 2px;
  background: rgba(23, 24, 22, .08);
}

.scroll-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: 70px;
  padding: 0 var(--pad);
  border-bottom: 1px solid rgba(23, 24, 22, .14);
  background: rgba(242, 241, 236, .9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--ink);
}

.brand-mark span {
  position: absolute;
  width: 12px;
  height: 1px;
  background: var(--ink);
}

.brand-mark span:last-child {
  transform: rotate(90deg);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-copy span {
  color: var(--muted);
  font-size: 10px;
}

.process-nav {
  display: flex;
  height: 70px;
  align-items: stretch;
}

.process-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.process-nav a::after {
  position: absolute;
  inset: auto 22px 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(.3);
  transition: opacity .25s ease, transform .25s ease;
}

.process-nav a span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.process-nav a:hover::after,
.process-nav a[aria-current="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.process-nav a[aria-current="true"] {
  color: var(--accent);
}

.header-meta {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

main,
.site-footer {
  width: min(100%, var(--max-width));
  margin-inline: auto;
}

.project-intro {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  min-height: 300px;
  padding: 44px var(--pad) 36px;
  border-bottom: 1px solid var(--line);
}

.intro-index {
  align-self: start;
  display: grid;
  gap: 12px;
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
}

.intro-index span {
  font-size: 9px;
  letter-spacing: 0;
}

.intro-index strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.5;
}

.intro-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: 80px;
  font-weight: 620;
  letter-spacing: 0;
  line-height: .88;
}

.intro-summary {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.intro-facts {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--ink);
}

.intro-facts div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.intro-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.intro-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.sequence {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.sequence i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.process {
  padding: 44px var(--pad) 0;
  scroll-margin-top: 72px;
}

.process-head {
  display: grid;
  grid-template-columns: 100px minmax(250px, .9fr) minmax(330px, 1.35fr) minmax(250px, .7fr);
  gap: clamp(22px, 3.2vw, 54px);
  align-items: start;
  padding-bottom: 28px;
}

.process-number {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  line-height: 1;
}

.process-number span {
  font-size: 8px;
  letter-spacing: 0;
}

.process-number strong {
  color: var(--accent);
  font-size: 64px;
  font-weight: 400;
  letter-spacing: 0;
}

.process-title p {
  margin: 2px 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1.5;
}

.process-title h2 {
  margin: 0;
  font-size: 40px;
  font-weight: 620;
  letter-spacing: 0;
  line-height: 1.08;
  white-space: nowrap;
}

.process-description {
  max-width: 610px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.9;
}

.process-stats {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--ink);
}

.process-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.process-stats dt {
  color: var(--muted);
  font-size: 10px;
}

.process-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.viewer {
  overflow: hidden;
  border: 1px solid #30312d;
  border-radius: 4px;
  background: var(--screen);
  box-shadow: 0 24px 70px rgba(25, 26, 22, .12);
}

.viewer-bar,
.viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aeafa8;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

.viewer-bar {
  min-height: 43px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid #2f302c;
}

.viewer-status,
.viewer-actions {
  display: flex;
  align-items: center;
}

.viewer-status {
  gap: 10px;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e45d3a;
  box-shadow: 0 0 0 4px rgba(228, 93, 58, .1);
}

.viewer-actions,
.dialog-actions {
  gap: 4px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #b8b9b2;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.icon-button:hover {
  border-color: #41423d;
  background: #23241f;
  color: #f4f3ed;
}

.icon-button:focus-visible,
.back-to-top:focus-visible,
.process-nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.viewer-screen {
  position: relative;
  height: clamp(520px, 68vw, 840px);
  max-height: 78vh;
  min-height: 500px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(23, 24, 22, .04) calc(50% - .5px), rgba(23, 24, 22, .04) calc(50% + .5px), transparent calc(50% + .5px)),
    #f5f4ef;
}

.process--stamping .viewer-screen {
  min-height: 560px;
}

.viewer-screen iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f4ef;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.viewer-screen iframe.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.viewer-poster,
.viewer-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewer-poster {
  z-index: 0;
  object-fit: cover;
  object-position: center;
  transition: opacity .5s ease;
}

.viewer-screen.has-frame .viewer-poster {
  opacity: 0;
}

.viewer-placeholder {
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 24, 22, .035) 1px, transparent 1px),
    linear-gradient(rgba(23, 24, 22, .035) 1px, transparent 1px),
    #f5f4ef;
  background-size: 48px 48px;
  color: var(--ink);
}

.placeholder-grid {
  position: absolute;
  inset: 13% 10%;
  border: 1px solid rgba(23, 24, 22, .1);
  transform: skewY(-8deg);
}

.placeholder-grid::before,
.placeholder-grid::after {
  position: absolute;
  background: rgba(23, 24, 22, .12);
  content: "";
}

.placeholder-grid::before {
  inset: 33.333% 0 auto;
  height: 1px;
}

.placeholder-grid::after {
  inset: 66.666% 0 auto;
  height: 1px;
}

.placeholder-copy {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(420px, 80%);
  padding: 30px;
  border: 1px solid var(--line-dark);
  background: rgba(245, 244, 239, .9);
  transform: translate(-50%, -50%);
}

.placeholder-copy span,
.placeholder-copy small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

.placeholder-copy strong {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0;
}

.placeholder-levels {
  position: absolute;
  right: 24px;
  bottom: 28px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.viewer-loading,
.dialog-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(245, 244, 239, .94);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.viewer-screen.is-loading .viewer-loading,
.dialog-screen.is-loading .dialog-loading {
  opacity: 1;
  pointer-events: auto;
}

.viewer-loading span,
.dialog-loading span {
  justify-self: center;
  width: 34px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.viewer-loading span::after,
.dialog-loading span::after {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--accent);
  content: "";
  animation: loading-line 1.2s ease-in-out infinite;
}

.viewer-loading p,
.dialog-loading p {
  margin: 0;
}

@keyframes loading-line {
  0% { transform: translateX(-16px); }
  50% { transform: translateX(36px); }
  100% { transform: translateX(-16px); }
}

.viewer-foot {
  min-height: 38px;
  padding: 0 16px;
  border-top: 1px solid #2f302c;
  color: #777971;
}

.process-transition {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: calc(100% - var(--pad) * 2);
  margin: clamp(68px, 9vw, 120px) auto 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

.process-transition i {
  position: relative;
  height: 1px;
  background: var(--line-dark);
}

.process-transition i::after {
  position: absolute;
  top: -2px;
  right: 0;
  width: 5px;
  height: 5px;
  border-top: 1px solid var(--muted);
  border-right: 1px solid var(--muted);
  content: "";
  transform: rotate(45deg);
}

.process--bodyshop,
.process--paintshop {
  padding-top: clamp(68px, 9vw, 122px);
}

.closing {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr) auto;
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  margin-top: clamp(90px, 11vw, 150px);
  padding: clamp(56px, 8vw, 92px) var(--pad);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper-deep);
}

.closing .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -30px;
}

.closing h2 {
  margin: 0;
  font-size: 56px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
}

.closing > p:not(.eyebrow) {
  max-width: 600px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.9;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.back-to-top svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.back-to-top:hover {
  background: var(--ink);
  color: var(--paper);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--pad) 34px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

.viewer-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.viewer-dialog::backdrop {
  background: rgba(16, 17, 15, .84);
  backdrop-filter: blur(10px);
}

.dialog-shell {
  position: absolute;
  inset: clamp(12px, 2.2vw, 28px);
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #3a3b36;
  background: var(--screen);
}

.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid #353631;
  color: #c8c9c2;
}

.dialog-bar > div:first-child {
  display: grid;
  gap: 2px;
}

.dialog-bar span {
  color: #777971;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0;
}

.dialog-bar strong {
  font-size: 12px;
  font-weight: 600;
}

.icon-button--light:hover {
  border-color: #4a4b45;
  background: #262722;
}

.dialog-screen {
  position: relative;
  min-height: 0;
  background: #f5f4ef;
}

.dialog-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f4ef;
  opacity: 0;
  transition: opacity .35s ease;
}

.dialog-screen iframe.is-ready {
  opacity: 1;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-meta {
    display: none;
  }

  .project-intro {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .intro-copy h1 {
    font-size: 80px;
  }

  .intro-facts {
    grid-column: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
  }

  .intro-facts div {
    display: block;
    padding: 12px 14px 12px 0;
    border-top: 1px solid var(--line);
  }

  .intro-facts dd {
    margin-top: 5px;
  }

  .process-head {
    grid-template-columns: 80px minmax(220px, .85fr) minmax(300px, 1.25fr);
  }

  .process-stats {
    grid-column: 2 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2px;
  }

  .process-stats div {
    display: grid;
    gap: 3px;
    padding-right: 14px;
  }
}

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: 1fr;
    min-height: 102px;
    padding-top: 12px;
  }

  .brand {
    justify-self: start;
  }

  .process-nav {
    width: 100%;
    height: 42px;
  }

  .process-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .process-nav a::after {
    inset-inline: 8px;
  }

  .project-intro {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 48px;
  }

  .intro-index {
    display: none;
  }

  .intro-copy h1 {
    font-size: 60px;
  }

  .intro-summary {
    margin-top: 22px;
  }

  .intro-facts {
    grid-column: 1;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .intro-facts div {
    display: grid;
    grid-template-columns: 60px 1fr;
  }

  .process {
    scroll-margin-top: 100px;
    padding-top: 58px;
  }

  .process-head {
    grid-template-columns: 56px 1fr;
    gap: 18px;
    padding-bottom: 24px;
  }

  .process-number strong {
    font-size: 38px;
  }

  .process-title h2 {
    font-size: 34px;
  }

  .process-description {
    grid-column: 2;
  }

  .process-stats {
    grid-column: 2;
    grid-template-columns: 1fr;
  }

  .process-stats div {
    display: flex;
    padding-right: 0;
  }

  .viewer-screen,
  .process--stamping .viewer-screen {
    height: 62vh;
    min-height: 380px;
    max-height: 620px;
  }

  .viewer-foot {
    align-items: flex-start;
    gap: 14px;
    padding-block: 10px;
    line-height: 1.5;
  }

  .process-transition {
    margin-top: 68px;
  }

  .process--bodyshop,
  .process--paintshop {
    padding-top: 72px;
  }

  .closing {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .closing .eyebrow {
    grid-column: 1;
    margin-bottom: 0;
  }

  .back-to-top {
    justify-self: start;
  }

  .closing h2 {
    font-size: 38px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }

  .dialog-shell {
    grid-template-rows: 50px minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .brand-copy strong {
    font-size: 10px;
  }

  .process-nav a {
    font-size: 12px;
  }

  .process-nav a span {
    display: none;
  }

  .viewer-screen,
  .process--stamping .viewer-screen {
    height: 58vh;
    min-height: 340px;
  }

  .process-transition {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .placeholder-copy {
    padding: 22px;
  }

  .intro-copy h1 {
    font-size: 52px;
  }

  .process-title h2 {
    font-size: 30px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
