:root {
  color-scheme: light;
  --ink: #191a1d;
  --muted: #6d7076;
  --quiet: #94969b;
  --line: #dedfe2;
  --surface: rgba(255, 255, 255, 0.93);
  --accent: #5261ee;
  --accent-soft: rgba(82, 97, 238, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f7f7f5;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.98), transparent 34rem),
    #f7f7f5;
  font-family:
    Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  color: inherit;
  font: inherit;
}

::selection {
  color: #fff;
  background: var(--ink);
}

.page {
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr;
  overflow-x: clip;
}

.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 54px;
  border-top: 1px solid #f1f1f1;
  border-bottom: 1px solid #e5e5e7;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.header-inner {
  position: relative;
  display: flex;
  width: min(100%, 1540px);
  height: 100%;
  align-items: center;
  margin: 0 auto;
  padding: 0 42px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  display: block;
  width: 122px;
  height: auto;
}

.desktop-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 28px;
  align-items: center;
  transform: translate(-50%, -50%);
}

.desktop-nav a {
  position: relative;
  padding: 18px 0;
  color: #2b2c30;
  font-size: 14px;
  font-weight: 460;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav a::after {
  position: absolute;
  right: 50%;
  bottom: 9px;
  left: 50%;
  height: 1px;
  background: #202124;
  content: "";
  transition:
    right 160ms ease,
    left 160ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
  right: 0;
  left: 0;
}

.mobile-actions,
.mobile-drawer {
  display: none;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  color: #151619;
  background: transparent;
  cursor: pointer;
}

.hamburger-icon {
  display: grid;
  gap: 7px;
}

.hamburger-icon span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.icon-button[aria-expanded="true"] .hamburger-icon span:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

.icon-button[aria-expanded="true"] .hamburger-icon span:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}

.mobile-nav {
  display: grid;
  gap: 0;
}

.mobile-nav a {
  padding: 14px 2px;
  border-bottom: 1px solid #eeeeef;
  color: #242529;
  font-size: 15px;
  text-decoration: none;
}

.mobile-nav a:last-child {
  border-bottom: 0;
}

.brand-logo:focus-visible,
.icon-button:focus-visible,
.desktop-nav a:focus-visible,
.mobile-nav a:focus-visible,
.step-button:focus-visible,
.viewer-action:focus-visible,
.control-button:focus-visible {
  outline: 3px solid rgba(27, 28, 31, 0.16);
  outline-offset: 4px;
}

.guide-main {
  width: 100%;
  padding: clamp(64px, 8vw, 112px) clamp(20px, 4.5vw, 72px) clamp(72px, 9vw, 126px);
}

.guide-intro {
  width: min(100%, 820px);
  margin: 0 auto clamp(46px, 6vw, 76px);
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guide-intro h1 {
  max-width: 800px;
  margin: 13px auto 0;
  font-size: clamp(42px, 6.2vw, 72px);
  font-weight: 680;
  line-height: 0.98;
  letter-spacing: -0.058em;
}

.guide-intro-copy {
  max-width: 590px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.7;
}

.assembly-guide {
  width: min(100%, 1420px);
  margin: 0 auto;
}

.step-navigation {
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.step-navigation ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 78px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border: 0;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.step-button::after {
  position: absolute;
  right: 50%;
  bottom: -1px;
  left: 50%;
  height: 2px;
  background: var(--ink);
  content: "";
  transition:
    right 200ms ease,
    left 200ms ease;
}

.step-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.step-button.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.step-button.is-active::after {
  right: 18%;
  left: 18%;
}

.step-number {
  color: currentColor;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.step-short-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.78fr);
  gap: 18px;
  align-items: stretch;
}

.model-viewer,
.instruction-shell {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(27, 28, 31, 0.07);
  backdrop-filter: blur(16px);
}

.model-viewer {
  display: grid;
  min-width: 0;
  grid-template-rows: 1fr;
  overflow: hidden;
}

.instruction-progress,
.instruction-controls {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.viewer-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.viewer-action {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dedfe2;
  border-radius: 999px;
  color: #686a70;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.material-symbols-outlined {
  font-size: 17px;
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 20;
  line-height: 1;
}

.viewer-action:hover {
  border-color: #c8c9cd;
  color: var(--ink);
  background: #fff;
}

.viewer-action--replay {
  border-color: rgba(82, 97, 238, 0.22);
  color: #4654d8;
  background: rgba(82, 97, 238, 0.1);
}

.viewer-action--replay:hover {
  border-color: rgba(82, 97, 238, 0.34);
  color: #3543ca;
  background: rgba(82, 97, 238, 0.16);
}

.canvas-shell {
  position: relative;
  min-height: clamp(440px, 46vw, 640px);
  overflow: hidden;
  border-radius: inherit;
  background:
    linear-gradient(rgba(31, 32, 36, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 32, 36, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, #fefefd 0, #fdfdfb 64%, #fafaf7 100%);
  background-size: 28px 28px, 28px 28px, auto;
  isolation: isolate;
}

.canvas-shell::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, transparent 46%, rgba(252, 252, 250, 0.68) 100%);
  content: "";
  pointer-events: none;
}

#assembly-model {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  cursor: grab;
  touch-action: none;
}

#assembly-model.is-dragging {
  cursor: grabbing;
}

.model-status,
.drag-hint {
  position: absolute;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(218, 219, 222, 0.88);
  color: #57595f;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 26px rgba(25, 26, 29, 0.07);
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.model-status {
  top: 16px;
  left: 16px;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
}

.status-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.drag-hint {
  right: 16px;
  bottom: 16px;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 9px;
  color: #777980;
  font-weight: 560;
}

.drag-rotate-icon {
  flex: 0 0 auto;
  font-size: 18px;
}

.instruction-shell {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto auto;
  padding: clamp(28px, 3.5vw, 48px);
}

.instruction-progress {
  padding-bottom: 25px;
  border-bottom: 1px solid #e5e5e7;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#step-part {
  color: var(--ink);
}

.instruction-panels {
  min-height: 420px;
  padding: clamp(34px, 4vw, 52px) 0 30px;
}

.instruction-panel[hidden] {
  display: none;
}

.instruction-panel h2 {
  max-width: 410px;
  margin: 0 0 24px;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 680;
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.instruction-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.instruction-panel > p + p {
  margin-top: 17px;
}

.instruction-panel .orientation-note {
  color: #4d4f54;
}

.orientation-note strong {
  color: var(--ink);
  font-weight: 700;
}

.tip-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-top: 26px;
  padding: 17px 18px;
  border: 1px solid #e2e3e6;
  border-radius: 14px;
  background: #f8f8f7;
}

.tip-label {
  padding: 4px 7px;
  border-radius: 5px;
  color: #fff;
  background: var(--ink);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tip-callout p {
  color: #62646a;
  font-size: 12.5px;
  line-height: 1.6;
}

.completion-message {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #e4e5e7;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.completion-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
}

.instruction-controls {
  padding-top: 25px;
  border-top: 1px solid #e5e5e7;
}

.control-button {
  display: inline-flex;
  min-height: 46px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #dcdddf;
  border-radius: 11px;
  color: #585a60;
  background: #fafaf9;
  font-size: 12.5px;
  font-weight: 680;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.control-button:hover:not(:disabled) {
  border-color: #c8c9cd;
  color: var(--ink);
  background: #f5f5f3;
  transform: translateY(-1px);
}

.control-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.control-button-primary {
  min-width: 154px;
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.control-button-primary:hover:not(:disabled) {
  border-color: #050506;
  color: #fff;
  background: #050506;
}

.progress-track {
  height: 2px;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e5e7;
}

#progress-fill {
  display: block;
  width: calc(100% / 6);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@media (max-width: 900px) {
  .site-header {
    height: 46px;
    border-top-color: #ededee;
  }

  .header-inner {
    justify-content: center;
    padding: 0 20px;
  }

  .brand-logo img {
    width: clamp(102.4px, 14.4vw, 113.6px);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-actions {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .hamburger-icon {
    gap: 4.8px;
  }

  .hamburger-icon span {
    width: 17.6px;
    height: 1.6px;
  }

  .icon-button[aria-expanded="true"] .hamburger-icon span:first-child {
    transform: translateY(3.2px) rotate(45deg);
  }

  .icon-button[aria-expanded="true"] .hamburger-icon span:last-child {
    transform: translateY(-3.2px) rotate(-45deg);
  }

  .mobile-drawer {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 11;
    padding: 10px 24px 24px;
    border-bottom: 1px solid #e4e4e6;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 36px rgba(25, 26, 29, 0.1);
  }

  .mobile-drawer:not([hidden]) {
    display: grid;
  }

  .guide-main {
    padding-top: 58px;
  }

  .step-navigation ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-navigation li:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .step-button {
    min-height: 62px;
  }


  .guide-workspace {
    grid-template-columns: 1fr;
  }

  .canvas-shell {
    min-height: clamp(390px, 72vw, 580px);
  }

  .instruction-panels {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .guide-main {
    padding-right: 14px;
    padding-bottom: 72px;
    padding-left: 14px;
  }

  .guide-intro {
    margin-bottom: 42px;
    padding: 0 8px;
  }

  .guide-intro h1 {
    font-size: clamp(39px, 12vw, 54px);
  }

  .guide-intro-copy {
    margin-top: 19px;
    font-size: 14.5px;
  }

  .step-button {
    min-height: 58px;
    gap: 7px;
    padding: 10px 6px;
  }

  .step-short-title {
    font-size: 11.5px;
  }

  .model-viewer,
  .instruction-shell {
    border-radius: 19px;
  }

  .canvas-shell {
    min-height: clamp(360px, 102vw, 470px);
  }

  .viewer-actions {
    top: 11px;
    right: 11px;
  }

  .model-status {
    top: 11px;
    left: 11px;
  }

  .drag-hint {
    right: 11px;
    bottom: 11px;
  }

  .instruction-shell {
    padding: 27px 22px 24px;
  }

  .instruction-progress {
    padding-bottom: 20px;
  }

  .instruction-panels {
    padding-top: 30px;
  }

  .instruction-panel h2 {
    margin-bottom: 20px;
    font-size: 32px;
  }

  .tip-callout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tip-label {
    width: fit-content;
  }

  .instruction-controls {
    gap: 10px;
  }

  .control-button {
    min-height: 44px;
    padding: 0 13px;
  }

  .control-button-primary {
    min-width: 0;
  }
}

@media (max-width: 440px) {
  .header-inner {
    padding: 0 14px;
  }

  .mobile-actions {
    left: 8px;
  }

  .brand-logo img {
    width: 105.6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  #progress-fill {
    transition: none;
  }
}
