:root {
  color-scheme: dark;
  --bg: #101217;
  --panel: #181b23;
  --raised: #222630;
  --line: #2b303c;
  --text: #f4f5f7;
  --muted: #a9b0bf;
  --accent: #d6fa85;
  --accent-dark: #171e0e;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .46; }
button:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { height: 69px; display: flex; align-items: center; gap: 17px; }
.brand { display: flex; gap: 8px; align-items: center; font: 800 16px/1 var(--mono); letter-spacing: -.04em; }
.brand > span:last-child { margin-left: -8px; color: var(--accent); }
.brand-icon { display: grid; width: 33px; height: 33px; place-items: center; background: var(--accent); color: var(--accent-dark); border-radius: 9px; }
.header-tag { padding-left: 17px; border-left: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); letter-spacing: .09em; }
.demo-button { margin-left: auto; }
.intro { display: flex; position: relative; align-items: center; min-height: 211px; padding: 38px 0 32px; }
.eyebrow, .kicker { color: var(--accent); font: 700 11px/1.4 var(--mono); letter-spacing: .13em; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #d6fa8560; }
h1 { margin: 8px 0 7px; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -.075em; }
h1 span { color: var(--accent); }
.intro p { margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
#hero-cube { position: absolute; right: 15px; top: 2px; width: 300px; height: 207px; pointer-events: none; }

.workflow { min-height: 52px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 19px; color: var(--muted); }
.workflow span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 660; }
.workflow b { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 11px var(--mono); }
.workflow b svg { width: 13px; height: 13px; }
.workflow i { width: 24px; height: 1px; background: var(--line); }
.workflow .workflow-current { color: var(--text); }
.workflow-current b { color: var(--accent-dark); background: var(--accent); border-color: var(--accent); }

.workspace { display: grid; grid-template-columns: 1.22fr 1fr; gap: 18px; align-items: start; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 19px; padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.kicker { margin: 0 0 5px; font-size: 10px; }
h2 { margin: 0; font-size: 23px; line-height: 1.14; letter-spacing: -.045em; }
.status-pill { display: flex; align-items: center; gap: 7px; padding: 7px 9px; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 10px/1 var(--mono); letter-spacing: .04em; }
.status-pill i, .viewfinder-label > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #828b9c; }
.status-pill[data-live="true"] { color: var(--accent); }
.status-pill[data-live="true"] i { background: var(--accent); box-shadow: 0 0 9px #d6fa8580; }
.face-count { color: var(--accent); }

.viewfinder { position: relative; overflow: hidden; isolation: isolate; display: grid; place-items: center; width: 100%; min-height: 240px; aspect-ratio: 1.55; border: 1px solid #303849; border-radius: 12px; background: radial-gradient(ellipse at 50% 47%, #222b35 0%, #12161f 73%); }
.viewfinder::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, #727c9255 1px, transparent 1.2px) 0 0 / 18px 18px; mask-image: radial-gradient(ellipse, #000, #0005 85%); z-index: -1; }
.viewfinder video, .viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder-label, .viewfinder-face { position: absolute; z-index: 1; border: 1px solid #3b4354; border-radius: 6px; background: #12161ee8; font: 10px var(--mono); color: #bec7d5; }
.viewfinder-label { top: 12px; left: 12px; padding: 7px 8px; display: flex; gap: 7px; align-items: center; }
.viewfinder-face { bottom: 12px; left: 12px; padding: 4px 8px 4px 4px; display: flex; gap: 7px; align-items: center; }
.viewfinder-face span { display: grid; place-items: center; width: 20px; height: 20px; background: var(--accent); color: var(--accent-dark); border-radius: 4px; font-weight: 800; }
.guide { position: relative; width: min(56%, 205px); aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; }
.guide i { position: absolute; width: 20px; height: 20px; border: solid var(--accent); border-width: 0; filter: drop-shadow(0 0 4px #141712); }
.guide i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; border-radius: 5px 0 0; }
.guide i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; border-radius: 0 5px 0 0; }
.guide i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; border-radius: 0 0 0 5px; }
.guide i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; border-radius: 0 0 5px; }
.guide-grid { position: absolute; inset: 0; border: 1px solid #b5c5db32; border-radius: 5px; background: linear-gradient(90deg, #cddbeb51 1px, transparent 1px) 0 0 / 33.333% 100%, linear-gradient(#cddbeb51 1px, transparent 1px) 0 0 / 100% 33.333%; }
.guide-icon { color: #d3dfed; opacity: .7; width: 27px; height: 27px; }
.viewfinder.has-media .guide-icon { display: none; }
.camera-help, .editor-help, .hold-instruction, .message { color: var(--muted); font-size: 13px; line-height: 1.5; }
.camera-help { margin: 12px 0 15px; }
.camera-actions, .review-actions, .move-actions { display: flex; gap: 8px; }
.button { min-height: 42px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; font-size: 13px; font-weight: 720; }
.button-primary { background: var(--accent); color: var(--accent-dark); }
.button-primary:hover:enabled { background: #e8ffb8; }
.button-secondary, .button-quiet { background: var(--raised); border-color: var(--line); color: var(--text); }
.button-quiet { background: transparent; min-height: 37px; }
.button-secondary:hover:enabled, .button-quiet:hover:enabled { background: #313645; }
.camera-actions #camera { flex: 1; }
.icon-button { min-width: 42px; }
.message { padding: 9px 11px; margin: 12px 0 0; border-left: 2px solid var(--accent); background: #20252e; border-radius: 4px; }
.message.error { color: #ffd4bd; border-color: #ff9e71; }

.face-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.face-tab { display: grid; place-content: center; position: relative; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #14171e; color: var(--muted); font: 700 14px var(--mono); }
.face-tab[aria-pressed="true"] { border-color: var(--accent); background: #d6fa8511; color: var(--accent); }
.face-tab:hover { color: var(--text); }
.face-dot { position: absolute; width: 6px; height: 6px; top: 5px; right: 5px; border-radius: 50%; }
.face-editor { text-align: center; padding: 7px 0 11px; }
.face-label { margin: 0 auto; display: flex; width: min(165px, 100%); align-items: center; justify-content: space-between; color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.rotate-button { display: grid; place-items: center; background: transparent; border: 0; color: var(--muted); min-height: 38px; }
.rotate-button svg { width: 16px; height: 16px; }
.rotate-button:hover:enabled { color: var(--accent); }
.stickers { width: min(165px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sticker { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #3c4453; border-radius: 7px; background: var(--sticker, #242934); color: var(--tile-text, #b5bfce); font: 700 15px var(--mono); }
.sticker:hover { border-color: var(--text); }
.sticker[data-center="true"] { box-shadow: inset 0 0 0 2px #15182145; }
.palette { display: flex; justify-content: center; gap: 6px; margin-top: 13px; }
.swatch { width: 36px; height: 38px; padding: 3px; border: 1px solid transparent; background: transparent; border-radius: 8px; display: grid; place-items: stretch; }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.swatch span { display: grid; place-items: center; background: var(--sticker); color: var(--tile-text); border-radius: 4px; font: 700 11px var(--mono); }
.editor-help { margin: 4px 0 0; font-size: 12px; }
.orientation { display: flex; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #14171e; }
.orientation svg { color: var(--accent); width: 15px; height: 15px; margin-top: 2px; }
.orientation h3 { margin: 0 0 3px; font-size: 12px; }
.orientation p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.review-actions { margin-top: 11px; }
.review-actions button { flex: 1; }
.workspace-foot { padding: 14px 0 23px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
.workspace-foot span { display: flex; align-items: center; gap: 6px; }
.workspace-foot svg { width: 14px; height: 14px; color: var(--accent); }
.text-button { display: inline-flex; gap: 6px; align-items: center; background: transparent; padding: 7px 0; border: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.text-button:hover { color: var(--accent); }

.solution-workspace { padding-bottom: 32px; }
.model-stage { position: relative; overflow: hidden; border: 1px solid #303849; border-radius: 12px; background: radial-gradient(ellipse at 50% 47%, #30394b, #12161f 75%); }
.model-stage::before { position: absolute; content: ""; inset: 0; background: radial-gradient(circle, #7c879c46 1px, transparent 1.2px) 0 0 / 18px 18px; pointer-events: none; }
#model { position: relative; width: 100%; height: clamp(285px, 40vw, 410px); display: block; cursor: grab; touch-action: none; }
#model:active { cursor: grabbing; }
.model-hint { position: absolute; bottom: 12px; left: 12px; background: #11151fda; border: 1px solid #3b4354; border-radius: 6px; color: var(--muted); padding: 6px 8px; font: 10px var(--mono); pointer-events: none; }
.hold-instruction { margin: 0 0 12px; }
.step-card { display: flex; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #14171e; min-height: 103px; }
.notation { width: 59px; height: 59px; flex: none; display: grid; place-items: center; background: var(--move-color, var(--accent)); color: #131720; border-radius: 9px; font: 800 28px var(--mono); }
.step-card h3 { margin: 4px 0 2px; font-size: 17px; }
.step-caption { color: var(--accent); font: 700 10px var(--mono); letter-spacing: .08em; }
.step-card p { margin: 0; }
#move-detail { color: var(--muted); font-size: 12px; line-height: 1.45; }
.move-actions { margin-top: 11px; }
.move-actions #next-move { flex: 1; }
.move-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 14px 0; }
.move-list button { min-width: 36px; min-height: 37px; border: 1px solid var(--line); border-radius: 6px; background: #14171e; color: var(--text); font: 13px var(--mono); }
.move-list button.done { color: var(--muted); }
.move-list button[aria-current="step"] { border-color: var(--accent); color: var(--accent); }
.back-button svg { width: 15px; height: 15px; }

@media (max-width: 800px) {
  .shell { width: calc(100% - 36px); }
  #hero-cube { right: -12px; width: 220px; height: 166px; top: 15px; opacity: .9; }
  .intro p { max-width: min(430px, calc(100vw - 238px)); }
  .workspace { gap: 12px; }
  .panel { padding: 15px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 26px); }
  .header-inner { height: 59px; gap: 9px; }
  .header-tag { display: none; }
  .intro { min-height: 0; padding: 26px 0 23px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: clamp(36px, 8.7vw, 54px); }
  .intro p { font-size: 14px; max-width: 315px; margin-top: 8px; }
  #hero-cube { display: none; }
  .workflow { min-height: 45px; margin-bottom: 12px; gap: 8px; }
  .workflow i { width: clamp(8px, 4vw, 19px); }
  .workflow span { gap: 5px; font-size: 12px; }
  .workflow b { width: 22px; height: 22px; }
  .workspace { grid-template-columns: 1fr; }
  .panel { padding: 13px; border-radius: 14px; }
  .panel-heading { margin-bottom: 12px; }
  h2 { font-size: 21px; }
  .viewfinder { min-height: 216px; aspect-ratio: 1.45; }
  .guide { width: min(51%, 195px); }
  .button, .face-tab { min-height: 44px; }
  .swatch { width: clamp(34px, 11vw, 44px); height: 44px; }
  .move-list button { min-width: 44px; min-height: 44px; }
}

.camera-panel .orientation { margin-bottom: 12px; }
.viewfinder.photo-align .guide { width: var(--photo-guide-size, 150px); }
.viewfinder.photo-align img, .viewfinder.is-capture img { object-fit: contain; }
.viewfinder.is-capture .guide { visibility: hidden; }
.camera-actions { flex-wrap: wrap; }

.scan-workspace { max-width: 690px; margin-inline: auto; }
#scan-view > .workflow, #scan-view > .workspace-foot { max-width: 690px; margin-inline: auto; }
.intro { min-height: 163px; padding-block: 23px; }
#hero-cube { height: 158px; top: 0; }
body.scanning .intro { display: none; }
body.scanning #scan-view > .workflow { margin-top: 10px; }
.scan-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.scan-progress li { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; border-radius: 7px; background: #12151c; color: var(--muted); font: 700 11px var(--mono); }
.scan-progress li[aria-current="step"] { background: #d6fa8521; color: var(--accent); outline: 1px solid #d6fa8560; }
.scan-progress li[data-complete="true"] { color: var(--accent); }
.scan-progress svg { width: 12px; height: 12px; }
.scan-progress li[data-complete="false"] svg { display: none; }
.orientation { min-height: 96px; align-items: center; padding: 5px 8px 5px 2px; }
#turn-guide { width: 102px; height: 86px; flex: none; }
.orientation-copy { flex: 1; }
.orientation-copy .kicker { font: 700 9px/1.4 var(--mono); margin-bottom: 3px; color: var(--accent); }
.orientation h3 { font-size: 15px; }
.orientation p { max-width: 52ch; }
.orientation #replay-guide svg { margin-top: 0; width: 17px; height: 17px; }
.capture-meter { overflow: hidden; height: 4px; margin-top: 8px; border-radius: 5px; background: #313848; }
.capture-meter span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(var(--scan-progress, 0)); transform-origin: left; transition: transform 120ms linear; }
.camera-help { min-height: 20px; }
.viewfinder[data-steady="true"] .guide { filter: drop-shadow(0 0 5px #d6fa856d); }
.viewfinder[data-steady="true"] .guide-grid { border-color: #d6fa85; }
.viewfinder .guide { width: min(60%, 56vh, 252px); }
.face-comparison { display: flex; justify-content: center; gap: 12px; }
.face-comparison > div, .face-comparison figure { width: min(167px, calc(50% - 6px)); margin: 0; }
.face-comparison figure { overflow: hidden; }
.face-comparison figure img { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.face-comparison .stickers { width: 100%; }
.face-comparison figcaption, .grid-caption { color: var(--muted); margin: 5px 0 0; font: 11px var(--mono); }
.sticker { position: relative; }
.sticker[data-unsure="true"]::after { content: "!"; position: absolute; right: 2px; top: 2px; padding: 1px 4px; border-radius: 4px; background: #171a20; color: #ffe38d; font-size: 10px; }
.uncertain-help { color: #ffe38d; text-align: center; }
@media (max-width: 650px) {
  .intro { min-height: 0; padding-block: 14px; }
  .intro h1 { font-size: 34px; }
  .intro .eyebrow { display: none; }
  body.scanning #scan-view > .workflow { display: none; }
  body.scanning #scan-view { padding-top: 10px; }
  .orientation { min-height: 86px; gap: 6px; }
  #turn-guide { width: 81px; height: 74px; }
  .orientation h3 { font-size: 14px; }
  .orientation p { font-size: 11px; }
  .viewfinder .guide { width: min(66%, 47vh, 225px); }
  .camera-actions #camera { flex-basis: 48%; }
  .camera-actions #manual { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .capture-meter span { transition: none; }
}
