/* Cube Compass — no inline styles (strict CSP), system fonts only. */
:root{
 --bg:#f3f5ee;--surface:#ffffff;--surface-2:#f6f8f2;--ink:#14302a;--muted:#5d6e66;--line:#e2e7dc;
 --brand:#1d4a3a;--brand-hover:#2a6350;--on-brand:#ffffff;--lime:#d4ef8a;--accent:#2f8a5c;
 --frame:#0f211b;--danger-bg:#fff1e3;--danger-ink:#7a3f12;--ok-bg:#eaf4e2;
 --shadow:0 1px 2px #1b33290d,0 12px 40px #1b332912;--radius:20px;
 --s-U:#f4f3ec;--s-R:#e2483f;--s-F:#2fae6a;--s-D:#f5cf2f;--s-L:#f58a2c;--s-B:#2f74d8;--s-x:#3c5149;--body:#16241f;
 color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
 --bg:#0e1814;--surface:#15221d;--surface-2:#1a2a24;--ink:#e6efe9;--muted:#9bb0a6;--line:#25372f;
 --brand:#d4ef8a;--brand-hover:#e2f6ad;--on-brand:#10231b;--accent:#9ad37a;
 --frame:#08120e;--danger-bg:#3a2414;--danger-ink:#ffcf9e;--ok-bg:#1c3328;
 --shadow:0 1px 2px #0006,0 12px 40px #0005;--s-x:#33463e;--body:#060c0a;color-scheme:dark;
}}
:root[data-theme="dark"]{
 --bg:#0e1814;--surface:#15221d;--surface-2:#1a2a24;--ink:#e6efe9;--muted:#9bb0a6;--line:#25372f;
 --brand:#d4ef8a;--brand-hover:#e2f6ad;--on-brand:#10231b;--accent:#9ad37a;
 --frame:#08120e;--danger-bg:#3a2414;--danger-ink:#ffcf9e;--ok-bg:#1c3328;
 --shadow:0 1px 2px #0006,0 12px 40px #0005;--s-x:#33463e;--body:#060c0a;color-scheme:dark;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
button,input,a,label{-webkit-tap-highlight-color:transparent}
button,a,label.button,summary{touch-action:manipulation}
button{font:inherit;color:inherit;cursor:pointer}
a{color:inherit}
button:disabled{opacity:.4;cursor:not-allowed}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.1;letter-spacing:-.03em;font-weight:650}
p{color:var(--muted)}
.site-header,main,footer{max-width:1240px;margin:0 auto;padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}

/* Header */
.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:18px;padding-bottom:18px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;font-size:21px;font-weight:750;letter-spacing:-.04em}
.wordmark span{font-weight:400}
.brand img{border-radius:9px}
.chip{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);background:var(--surface);border:1px solid var(--line);padding:7px 12px;border-radius:99px}
.live-dot{width:7px;height:7px;border-radius:50%;background:#3fb26f;box-shadow:0 0 0 3px #3fb26f2e}

/* Hero */
.hero{display:grid;grid-template-columns:1.15fr .85fr;align-items:center;gap:40px;padding:48px 0 44px}
.eyebrow{font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:var(--accent);margin-bottom:14px}
.eyebrow.tight{margin-bottom:4px}
h1{font-size:clamp(44px,6.4vw,84px);letter-spacing:-.05em}
h1 em{font-family:ui-serif,Georgia,"Times New Roman",serif;font-weight:400;font-style:italic;letter-spacing:-.03em;color:var(--accent)}
.lede{font-size:18px;margin-top:20px;max-width:30em}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}
.hero-meta{display:flex;flex-wrap:wrap;gap:6px 18px;list-style:none;padding:0;margin:22px 0 0;font-size:13px;color:var(--muted)}
.hero-meta li:before{content:'✓';color:var(--accent);font-weight:700;margin-right:6px}
.hero-art{display:grid;place-items:center;position:relative}
.hero-art:before{content:'';position:absolute;width:78%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,#d4ef8a66,transparent 68%)}
.hero-art svg{position:relative;width:100%;max-width:360px;filter:drop-shadow(0 30px 30px #0f231b2e);animation:float 6s ease-in-out infinite}
@keyframes float{50%{transform:translateY(-10px) rotate(-2deg)}}

/* Buttons */
.button{display:inline-flex;gap:10px;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;border-radius:12px;border:1px solid transparent;text-decoration:none;font-size:14px;font-weight:650;line-height:1.2;cursor:pointer;transition:background .15s,transform .1s,border-color .15s}
.button:active:not(:disabled){transform:scale(.98)}
.button.big{min-height:52px;padding:14px 24px;font-size:15px;border-radius:14px}
.primary{background:var(--brand);color:var(--on-brand)}
.primary:hover:not(:disabled){background:var(--brand-hover)}
.secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
.secondary:hover{border-color:var(--muted)}
.ghost{background:transparent;border-color:var(--line);color:var(--ink)}
.ghost:hover{background:var(--surface)}
.lime{background:var(--lime);color:#10231b}
.text-button{white-space:nowrap;background:none;border:none;padding:8px 2px;font-size:13px;font-weight:600;color:var(--muted)}
.text-button:hover{color:var(--ink);text-decoration:underline}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.row.end{justify-content:flex-end}

/* Workspace */
.workspace{background:var(--surface);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow);scroll-margin-top:12px;overflow:hidden}
.workspace-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 24px;border-bottom:1px solid var(--line)}
.stepper{display:flex;gap:6px;list-style:none;margin:0;padding:0}
.stepper li{display:flex;align-items:center;gap:8px;padding:6px 14px 6px 6px;border-radius:99px;font-size:14px;font-weight:600;color:var(--muted)}
.stepper li span{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;border:1px solid var(--line);font-size:12px}
.stepper li.active{background:var(--ok-bg);color:var(--ink)}
.stepper li.active span{background:var(--brand);color:var(--on-brand);border-color:transparent}
.stepper li.done span{background:var(--ok-bg);color:var(--accent);border-color:transparent;font-size:0}
.stepper li.done span:before{content:'✓';font-size:13px}
.message{margin:18px 24px 0;padding:12px 16px;background:var(--ok-bg);border-radius:14px;font-size:14px;line-height:1.45}
.message.error{background:var(--danger-bg);color:var(--danger-ink)}
.view{padding:24px}
.small{font-size:12px;line-height:1.55}
.center{text-align:center}
.pill{display:inline-block;white-space:nowrap;padding:5px 11px;background:var(--surface-2);border:1px solid var(--line);border-radius:99px;font-size:12px;font-weight:600;color:var(--muted)}

/* Scan */
.scan-layout{display:grid;grid-template-columns:1.15fr 1fr;gap:28px;align-items:start}
.camera-frame{position:relative;aspect-ratio:4/3;background:var(--frame);border-radius:22px;overflow:hidden;color:#fff;display:grid;place-items:center;isolation:isolate}
.camera-frame video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1}
.camera-frame.frozen video{filter:brightness(.35) saturate(.6)}
.placeholder{text-align:center;padding:24px;max-width:320px}
.placeholder h3{font-size:19px;margin-top:18px}
.placeholder p{color:#b9c8c0;font-size:14px;margin:8px 0 20px}
.placeholder-icon{display:grid;grid-template-columns:repeat(3,22px);gap:4px;justify-content:center;transform:rotate(-8deg)}
.placeholder-icon span{height:22px;border-radius:5px;background:var(--s-F)}
.placeholder-icon span:nth-child(2),.placeholder-icon span:nth-child(9){background:var(--s-R)}
.placeholder-icon span:nth-child(3),.placeholder-icon span:nth-child(4){background:var(--s-D)}
.placeholder-icon span:nth-child(6){background:var(--s-B)}
.placeholder-icon span:nth-child(7){background:var(--s-U)}
.placeholder-icon span:nth-child(8){background:var(--s-L)}
.guide{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
.guide-box{position:relative;height:84%;aspect-ratio:1;border-radius:18px}
.frozen .guide-box{outline:3px solid #ffffffe6;box-shadow:0 0 0 2000px #050d0aa6}
.guide-box canvas{position:absolute;inset:0;width:100%;height:100%;border-radius:18px}
.guide-cells{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);border:3px solid #ffffffb3;border-radius:12px;transition:left .12s,top .12s,width .12s,height .12s,opacity .2s,border-color .2s}
.grid-layer{position:absolute;inset:0;transform-origin:50% 50%}
.grid-layer .guide-cells{inset:auto;left:30%;top:20%;width:40%;height:40%}
.guide-cells.searching{opacity:0}
.guide-cells.repeat{border-color:#f5b84a;box-shadow:0 0 0 4px #f5b84a40}
.guide-cells.locked{border-color:var(--lime);box-shadow:0 0 0 4px #d4ef8a40}
.frozen .guide-cells{border:0;box-shadow:none}
.advancing .guide-box{outline-color:var(--lime)}
.guide-cells .cell{display:grid;place-items:center;border:1px dashed #ffffff55}
.guide-cells .cell:nth-child(-n+3){border-top:0}.guide-cells .cell:nth-child(n+7){border-bottom:0}
.guide-cells .cell:nth-child(3n+1){border-left:0}.guide-cells .cell:nth-child(3n){border-right:0}
.guide-cells i{width:30%;aspect-ratio:1;border-radius:50%;border:3px solid #fff;box-shadow:0 2px 8px #0008;transition:background .15s}
.guide-cells i:not([class]),.guide-cells i[class=""]{display:none}
.guide-cells i.colour-unknown{background:transparent;border-style:dashed}
.frozen .guide-cells i{width:24%}
.guide-hint{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);max-width:92%;text-align:center;font-size:13px;font-weight:600;background:#000a;padding:6px 12px;border-radius:99px;backdrop-filter:blur(6px)}
.frozen .guide-hint{display:none}
.camera-state{position:absolute;top:12px;left:12px;font-size:12px;font-weight:600;background:#0009;padding:5px 10px;border-radius:99px;color:#dfe9e3}
.camera-state.on:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:#ff4d4d;margin-right:7px;vertical-align:1px;animation:pulse 1.6s infinite}
@keyframes pulse{50%{opacity:.3}}
.frozen .camera-state{display:none}
.camera-actions{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;margin:16px 0 10px}
.camera-actions>label{justify-self:start}
.camera-actions>#retake,.camera-actions>#stop-camera{justify-self:end;grid-column:3}
.shutter{grid-column:2;width:74px;height:74px;border-radius:50%;border:4px solid var(--brand);background:var(--surface);padding:5px;display:grid;place-items:center}
.shutter span{width:100%;height:100%;border-radius:50%;background:var(--brand);transition:transform .1s}
.shutter:active:not(:disabled) span{transform:scale(.88)}
.shutter.waiting span{background:var(--surface-2);border:2px dashed var(--muted)}

/* Face editor */
.face-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin-bottom:16px}
.face-tab{display:flex;flex-direction:column;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:8px 4px;min-width:0}
.face-tab.active{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand) inset}
.mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;width:34px;padding:2px;background:var(--body);border-radius:5px}
.mini-grid i{aspect-ratio:1;border-radius:1.5px}
.tab-name{font-size:11px;font-weight:600;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.face-tab.confirmed .tab-name{color:var(--accent)}
.face-tab.confirmed .tab-name:after{content:' ✓'}
.face-card{background:var(--surface-2);border:1px solid var(--line);border-radius:22px;padding:20px}
.face-head{display:flex;align-items:center;gap:12px}
.face-head h2{font-size:20px}
.face-head .pill{margin-left:auto}
.colour-dot{display:inline-block;width:14px;height:14px;border-radius:50%;box-shadow:0 0 0 1px #0002 inset;flex-shrink:0;vertical-align:-2px}
.colour-dot.big{width:34px;height:34px}
.hint{font-size:14px;margin:12px 0 4px;line-height:1.5}
.editor-wrap{width:min(250px,100%);margin:18px auto 16px}
.edge-bar{height:26px;border-radius:9px 9px 3px 3px;margin:0 8px 6px;display:grid;place-items:center;box-shadow:0 0 0 1px #0002 inset}
.edge-bar span{font-size:11px;font-weight:700;color:#14302a;background:#ffffffb3;padding:1px 8px;border-radius:99px}
.face-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;background:var(--body);padding:6px;border-radius:12px;aspect-ratio:1}
.face-grid.big{gap:7px;padding:8px;border-radius:16px}
.sticker{position:relative;padding:0;border:0;border-radius:6px;color:#0008;font-size:13px;font-weight:750;aspect-ratio:1;display:grid;place-items:center;box-shadow:inset 0 -3px 0 #0000001f;transition:transform .1s}
button.sticker:hover:not(:disabled){transform:scale(1.05)}
.face-grid.big .sticker{border-radius:9px;font-size:15px}
.sticker.colour-unknown{color:#ffffff99}
.sticker.centre{cursor:default;opacity:1}
.sticker.centre:after{content:'';position:absolute;width:22%;aspect-ratio:1;border-radius:50%;background:#00000026;bottom:12%}
.sticker.changed{outline:3px solid var(--ink);outline-offset:-1px;z-index:1}
.sticker.unsure{outline:3px dashed var(--danger-ink);outline-offset:-1px;z-index:1}
.paint-label{font-size:13px;color:var(--muted);text-align:center;margin-bottom:10px}
.palette{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.swatch{height:44px;border:0;border-radius:12px;font-size:12px;font-weight:750;color:#0009;box-shadow:inset 0 0 0 1px #0002}
.swatch.selected{outline:3px solid var(--ink);outline-offset:2px}
.editor-actions{display:flex;justify-content:space-between;gap:12px;margin-top:18px;align-items:center}

/* Colours (classes, so no inline styles are needed) */
.colour-U{background:var(--s-U)}.colour-R{background:var(--s-R)}.colour-F{background:var(--s-F)}
.colour-D{background:var(--s-D)}.colour-L{background:var(--s-L)}.colour-B{background:var(--s-B)}.colour-unknown{background:var(--s-x)}
.cube-body{fill:var(--body)}
.cube-sticker{stroke:none}
.s-U{fill:var(--s-U)}.s-R{fill:var(--s-R)}.s-F{fill:var(--s-F)}.s-D{fill:var(--s-D)}.s-L{fill:var(--s-L)}.s-B{fill:var(--s-B)}.s-unknown{fill:var(--s-x)}
.face-F{filter:brightness(.93)}.face-R{filter:brightness(.82)}

/* Review */
.review-layout,.solution-layout{display:grid;grid-template-columns:1.1fr 1fr;gap:36px;align-items:center}
.cube-net{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:500px;width:100%;margin:0 auto 10px}
.net-face{min-width:0;background:transparent;border:0;padding:0;text-align:center;color:var(--muted);font:inherit;border-radius:12px}
button.net-face:hover .face-grid{box-shadow:0 0 0 3px var(--accent)}
.net-face .face-grid{gap:3px;padding:4px;border-radius:8px}
.net-face .sticker{font-size:0;border-radius:3px;box-shadow:none}
.net-face>span{display:block;font-size:11px;margin-top:4px}
.net-U{grid-area:1/2}.net-L{grid-area:2/1}.net-F{grid-area:2/2}.net-R{grid-area:2/3}.net-B{grid-area:2/4}.net-D{grid-area:3/2}
.review-info h2{font-size:28px}
.review-info>p{font-size:14px;margin:16px 0}
.counts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:20px 0}
.count{display:flex;gap:8px;align-items:center;font-size:13px;padding:8px 10px;border-radius:12px;background:var(--surface-2);border:1px solid var(--line)}
.count b{margin-left:auto;font-weight:700}
.count.good b{color:var(--accent)}
.count.bad{background:var(--danger-bg);color:var(--danger-ink);border-color:transparent}
.fix-box{background:var(--danger-bg);border-radius:16px;padding:14px 16px;margin:0 0 8px}
.fix-box p{color:var(--danger-ink);font-size:14px;margin-bottom:10px}
.fix-box p:last-child{margin-bottom:0}

/* Solve */
.solution-visual>svg{display:block;width:100%;max-width:300px;margin:10px auto 4px}
.hold-tip{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;font-size:13px;font-weight:600}
.hold-tip .colour-dot:not(:first-child){margin-left:8px}
.compact{max-width:300px;margin-top:14px}
.compact .net-face>span{font-size:10px}
.move-top{display:flex;justify-content:space-between;align-items:center}
.progress{height:6px;background:var(--surface-2);border:1px solid var(--line);border-radius:99px;margin:14px 0 4px;overflow:hidden}
.progress span{display:block;height:100%;width:0;background:var(--accent);border-radius:99px;transition:width .3s}
.move-heading{display:flex;align-items:baseline;gap:22px;margin:14px 0 6px}
#move-symbol{font-size:96px;line-height:1;font-weight:700;letter-spacing:-.04em}
#move-symbol.done{color:var(--accent)}
#move-arrow{font-size:56px;color:var(--accent);line-height:1}
.move-panel h2{font-size:26px}
.move-panel>p{font-size:15px;margin:12px 0 22px;min-height:68px}
.move-controls{display:flex;gap:10px}
.move-controls .primary{flex:1}
.move-list{display:flex;gap:5px;flex-wrap:wrap;margin:22px 0}
.move-token{font-size:12px;font-weight:600;padding:4px 8px;border:1px solid var(--line);border-radius:8px;color:var(--muted)}
.move-token.current{background:var(--brand);color:var(--on-brand);border-color:transparent}
.move-token.done{background:var(--ok-bg);color:var(--accent);border-color:transparent;text-decoration:line-through}
.move-panel details{font-size:13px;color:var(--muted)}
details p{margin:10px 0;font-size:13px}
summary{cursor:pointer;font-weight:600}

/* Info */
.how{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:40px 0 20px}
.how article{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:22px}
.how .num{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--ok-bg);color:var(--accent);font-weight:750;font-size:14px}
.how h3{font-size:18px;margin:14px 0 8px}
.how p{font-size:14px}
.faq{font-size:14px;padding:18px 22px;margin:4px 0 0;background:var(--surface);border:1px solid var(--line);border-radius:20px}
footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding-top:28px;padding-bottom:max(28px,env(safe-area-inset-bottom))}
.small-brand{font-size:17px}
footer small{font-size:12px;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
label.button:has(+input:focus-visible){outline:3px solid var(--accent);outline-offset:3px}
dialog{border:1px solid var(--line);border-radius:22px;padding:26px;max-width:min(420px,92vw);color:var(--ink);background:var(--surface);box-shadow:var(--shadow)}
dialog::backdrop{background:#0b1a1499;backdrop-filter:blur(3px)}
dialog h2{font-size:22px}
dialog p{margin:10px 0 20px}

@media (max-width:860px){
 .hero{grid-template-columns:1fr;gap:8px;padding:24px 0 28px}
 .hero-art{display:none}
 .lede{font-size:16px}
 .scan-layout,.review-layout,.solution-layout{grid-template-columns:1fr;gap:22px}
 .view{padding:16px}
 .workspace{border-radius:22px}
 .workspace-top{padding:12px 14px}
 .message{margin:14px 14px 0}
 .camera-frame{aspect-ratio:1;border-radius:18px}
 .guide-box{height:80%}
 .camera-state{top:8px;left:8px;font-size:11px}
 .how{grid-template-columns:1fr;gap:10px;padding:28px 0 14px}
}
@media (max-width:520px){
 .chip{display:none}
 .hero-actions .button{flex:1}
 .stepper li{padding:4px 10px 4px 4px;font-size:13px;gap:6px}
 .stepper li span{width:22px;height:22px}
 .face-card{padding:16px;border-radius:18px}
 .face-head h2{font-size:17px}
 .face-head .pill{display:none}
 .tab-name{font-size:10px}
 .tab-num{display:none}
 .face-strip{gap:4px}
 .mini-grid{width:28px}
 .counts{grid-template-columns:repeat(2,1fr)}
 #move-symbol{font-size:76px}
 .move-controls .button{padding:12px 14px}
 .shutter{width:68px;height:68px}
 .camera-actions .button{padding:10px 12px;font-size:13px}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}.hero-art svg,.camera-state.on:before{animation:none}*{transition:none!important}}
