/* ============================================================================
 * guide.css — WaveForge Guide (mission-driven, assistant-led experience)
 * Uses the shared studio design tokens (--bg/--panel/--ink/--cyan …) so it
 * stays theme-aware. Spacious, editorial, self-explanatory.
 * ==========================================================================*/

/* when guided, hide the expert chrome; when expert, hide the guide */
body.guided .topbar, body.guided .askbar, body.guided .modebar,
body.guided #designLayout, body.guided .workbench, body.guided .footnote { display: none !important; }
body:not(.guided) #guideLayout { display: none; }

#guideLayout {
  position: fixed; inset: 0; overflow-y: auto; background:
    radial-gradient(1200px 720px at 82% -8%, color-mix(in oklab, var(--cyan) 12%, transparent), transparent 60%),
    radial-gradient(900px 600px at 5% 110%, color-mix(in oklab, var(--magenta) 8%, transparent), transparent 60%),
    var(--bg);
  color: var(--ink); font-family: var(--sans); z-index: 50;
}
@supports not (color: color-mix(in oklab, white, black)) {
  #guideLayout { background: radial-gradient(1200px 720px at 82% -8%, rgba(34,211,238,.12), transparent 60%), var(--bg); }
}

/* ── top bar: brand · step rail · expert ── */
.g-top { display: flex; align-items: center; gap: 24px; padding: 20px 40px; border-bottom: 1px solid var(--edge);
  position: sticky; top: 0; background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(10px); z-index: 5; }
.g-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.g-brand svg { flex: none; }
.g-brand-dim { color: var(--cyan); font-weight: 800; }
.g-rail { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.g-rail-line { width: 30px; height: 2px; background: var(--edge); }
.g-step { display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer;
  color: var(--ink-faint); font: 600 14px var(--sans); padding: 6px 4px; transition: color .2s; }
.g-step:disabled { cursor: default; opacity: .55; }
.g-step .g-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--edge-2); font: 700 13px var(--mono); color: var(--ink-faint); transition: all .2s; }
.g-step.on { color: var(--ink); }
.g-step.on .g-dot { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cyan) 18%, transparent); }
.g-step.done { color: var(--ink-dim); }
.g-step.done .g-dot { border-color: var(--green); color: #052b1e; background: var(--green); }
.g-expert { background: none; border: 1px solid var(--edge-2); color: var(--ink-dim); border-radius: 999px;
  padding: 9px 18px; font: 600 13px var(--sans); cursor: pointer; transition: all .18s; }
.g-expert:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── main + coach ── */
.g-main { max-width: 1080px; margin: 0 auto; padding: 40px; }
.g-coach { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 34px;
  background: color-mix(in oklab, var(--panel) 70%, transparent); border: 1px solid var(--edge);
  border-radius: 16px; padding: 18px 22px; }
.g-orb { flex: none; width: 40px; height: 40px; border-radius: 50%; margin-top: 2px;
  background: radial-gradient(circle at 35% 30%, #7ff0ff, var(--cyan) 45%, #0b6b7d 90%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--cyan) 16%, transparent), 0 6px 18px color-mix(in oklab, var(--cyan) 30%, transparent);
  animation: g-pulse 3.2s ease-in-out infinite; }
@keyframes g-pulse { 0%,100%{ transform: scale(1); filter: brightness(1);} 50%{ transform: scale(1.06); filter: brightness(1.12);} }
@media (prefers-reduced-motion: reduce){ .g-orb { animation: none; } }
.g-coach-txt { font-size: 17px; line-height: 1.5; color: var(--ink-dim); padding-top: 8px; }
.g-coach-txt b { color: var(--ink); font-weight: 700; }

/* ── hero / mission step ── */
.g-hero { text-align: center; padding: 8px 0 20px; }
.g-h1 { font-size: 58px; line-height: 1.03; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; margin-bottom: 18px; }
.g-accent { color: var(--cyan); }
.g-lede { font-size: 20px; line-height: 1.5; color: var(--ink-dim); max-width: 680px; margin: 0 auto 30px; }
.g-askwrap { display: flex; gap: 12px; max-width: 720px; margin: 0 auto; }
.g-ask { flex: 1; background: var(--panel); border: 1.5px solid var(--edge-2); border-radius: 14px; color: var(--ink);
  font-size: 18px; padding: 18px 20px; outline: none; transition: border-color .18s, box-shadow .18s; }
.g-ask::placeholder { color: var(--ink-faint); }
.g-ask:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cyan) 16%, transparent); }
.g-go, .g-primary { background: linear-gradient(180deg, color-mix(in oklab, var(--cyan) 92%, white), var(--cyan)); color: #04222a;
  border: 0; border-radius: 14px; font: 700 17px var(--sans); padding: 0 26px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 20px color-mix(in oklab, var(--cyan) 34%, transparent); transition: transform .12s, filter .18s; }
.g-go { padding: 18px 26px; }
.g-go:hover, .g-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.g-ex-lbl { margin: 36px 0 16px; color: var(--ink-faint); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }

.g-missions, .g-examples { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.g-mission, .g-ex { text-align: left; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px;
  padding: 20px; cursor: pointer; transition: border-color .16s, transform .12s, background .16s; display: flex; flex-direction: column; gap: 8px; }
.g-mission:hover, .g-ex:hover { border-color: var(--cyan); transform: translateY(-3px); background: color-mix(in oklab, var(--panel) 80%, var(--cyan) 6%); }
.g-m-ic, .g-ex-ic { font-size: 30px; }
.g-m-t, .g-ex-t { font-weight: 700; font-size: 16px; }
.g-m-d, .g-ex-tag { color: var(--ink-dim); font-size: 13.5px; line-height: 1.4; }
.g-ex-tag { color: var(--cyan); }

/* ── understand step ── */
.g-understand { background: var(--panel); border: 1px solid var(--edge); border-radius: 20px; padding: 34px; }
.g-und-hd { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.g-und-brief { color: var(--ink-dim); font-size: 17px; font-style: italic; margin: 10px 0 26px; line-height: 1.5; }
.g-reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g-req { background: var(--panel-2); border: 1px solid var(--edge); border-radius: 12px; padding: 16px 18px; }
.g-req.assumed { border-color: color-mix(in oklab, var(--amber) 45%, var(--edge)); }
.g-req-l { font-size: 13px; color: var(--ink-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; letter-spacing: .02em; }
.g-assumed-tag { font: 600 10px var(--mono); color: var(--amber); border: 1px solid color-mix(in oklab, var(--amber) 45%, transparent);
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.g-req-sel, .g-opt-slider input { width: 100%; }
.g-req-sel { background: var(--bg); color: var(--ink); border: 1px solid var(--edge-2); border-radius: 9px; padding: 10px 12px; font-size: 15px; cursor: pointer; }

/* ── design step ── */
.g-card { background: var(--panel); border: 1px solid var(--edge); border-radius: 20px; padding: 34px; }
.g-card-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.g-kicker { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); display: flex; gap: 10px; align-items: center; }
.g-badge { font: 600 10px var(--mono); letter-spacing: .05em; color: var(--green); border: 1px solid color-mix(in oklab, var(--green) 42%, transparent);
  padding: 3px 9px; border-radius: 999px; text-transform: none; }
.g-pick { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.g-conf { text-align: center; flex: none; }
.g-conf-n { font: 800 30px var(--mono); color: var(--green); }
.g-conf-l { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.g-why { font-size: 17px; line-height: 1.55; color: var(--ink-dim); margin-bottom: 22px; }
.g-why b { color: var(--ink); }
.g-decs { display: flex; flex-direction: column; gap: 12px; }
.g-dec { background: var(--panel-2); border: 1px solid var(--edge); border-radius: 12px; padding: 16px 18px; }
.g-dec-main { display: flex; align-items: center; gap: 14px; }
.g-dec-l { font-size: 13px; color: var(--ink-faint); width: 150px; flex: none; text-transform: uppercase; letter-spacing: .04em; }
.g-dec-v { font-size: 17px; font-weight: 700; flex: 1; }
.g-dec-edit { background: none; border: 1px solid var(--edge-2); color: var(--ink-dim); border-radius: 8px; padding: 6px 12px; font: 600 12px var(--sans); cursor: pointer; transition: all .16s; }
.g-dec-edit:hover { border-color: var(--cyan); color: var(--cyan); }
.g-dec-why { font-size: 14.5px; line-height: 1.5; color: var(--ink-dim); margin-top: 10px; }
.g-dec-why b { color: var(--ink); }
.g-dec-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.g-opt { text-align: left; background: var(--bg); border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color .14s; display: flex; flex-direction: column; gap: 4px; }
.g-opt:hover { border-color: var(--cyan); }
.g-opt.on { border-color: var(--cyan); background: color-mix(in oklab, var(--cyan) 10%, var(--bg)); }
.g-opt-t { font-weight: 700; font-size: 14.5px; }
.g-opt-h { font-size: 12.5px; color: var(--ink-dim); line-height: 1.35; }
.g-opt-slider { display: flex; align-items: center; gap: 14px; grid-column: 1/3; }
.g-mono { font-family: var(--mono); color: var(--cyan); }

.g-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 6px; }
.g-fact { background: var(--panel-2); border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; }
.g-fact-l { display: block; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.g-fact-v { font-weight: 700; font-size: 16px; }
.g-rlist { margin: 0 0 22px 18px; color: var(--ink-dim); font-size: 15px; line-height: 1.7; }

/* ── actions ── */
.g-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.g-actions-wide { max-width: 1080px; margin: 28px auto 0; }
.g-secondary { background: none; border: 1px solid var(--edge-2); color: var(--ink-dim); border-radius: 12px; padding: 14px 22px; font: 600 15px var(--sans); cursor: pointer; transition: all .16s; }
.g-secondary:hover { border-color: var(--ink-dim); color: var(--ink); }

/* ── preview ── */
.g-preview { display: grid; grid-template-columns: 1fr 1.05fr; gap: 22px; }
.g-pv-left { display: flex; flex-direction: column; gap: 18px; }
.g-pv-card { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 22px; }
.g-verdict { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
.g-vbadge { font: 800 20px var(--sans); padding: 8px 18px; border-radius: 10px; }
.g-vbadge.green { color: #052b1e; background: var(--green); }
.g-vbadge.amber { color: #2a1c02; background: var(--amber); }
.g-vbadge.red { color: #2a0808; background: var(--red); }
.g-vdesc { font-size: 15px; color: var(--ink-dim); line-height: 1.4; }
.g-vmetrics { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.g-vmetrics div { display: flex; justify-content: space-between; font-size: 15px; padding: 7px 0; border-top: 1px solid var(--edge); }
.g-vmetrics span { color: var(--ink-dim); } .g-vmetrics b { font-family: var(--mono); color: var(--cyan); }
.g-tune { margin-top: 16px; } .g-tune label { display: block; font-size: 14px; color: var(--ink-dim); margin-bottom: 8px; }
.g-tune input[type=range] { width: 100%; }
.g-tune-note { font-size: 13px; margin-top: 6px; }
.g-dim { color: var(--ink-faint); }
.g-seg { display: inline-flex; border: 1px solid var(--edge-2); border-radius: 10px; overflow: hidden; }
.g-seg button { background: var(--panel-2); border: 0; border-right: 1px solid var(--edge); color: var(--ink-dim); padding: 10px 16px; font: 600 14px var(--sans); cursor: pointer; }
.g-seg button:last-child { border-right: 0; }
.g-seg button.on { background: var(--cyan); color: #04222a; }
.g-pv-right { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 22px; }
.g-const-wrap { margin-top: 14px; } .g-const-wrap canvas { width: 100%; height: auto; aspect-ratio: 1; background: var(--panel-2); border: 1px solid var(--edge); border-radius: 12px; }
.g-const-lg { display: flex; gap: 20px; justify-content: center; margin-top: 12px; font-size: 13px; }
.g-lg-cy { color: var(--cyan); } .g-lg-am { color: var(--amber); }

/* ── integrate ── */
.g-int-targets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.g-tgt { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--edge); color: var(--ink-dim);
  border-radius: 12px; padding: 12px 18px; font: 600 15px var(--sans); cursor: pointer; transition: all .16s; }
.g-tgt:hover { border-color: var(--cyan); color: var(--ink); }
.g-tgt.on { border-color: var(--cyan); color: var(--ink); background: color-mix(in oklab, var(--cyan) 10%, var(--panel)); }
.g-tgt-ic { font-size: 18px; }
.g-int-body { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.g-int-steps { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 22px; }
.g-steps-ol { margin: 14px 0 0 0; padding-left: 20px; color: var(--ink-dim); font-size: 15px; line-height: 1.7; }
.g-steps-ol code { font-family: var(--mono); color: var(--cyan); background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.g-int-code { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; overflow: hidden; }
.g-code-hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--edge); }
.g-sides { display: inline-flex; gap: 6px; }
.g-sides button { background: var(--panel-2); border: 1px solid var(--edge); color: var(--ink-dim); border-radius: 8px; padding: 7px 14px; font: 600 13px var(--sans); cursor: pointer; }
.g-sides button.on { background: var(--cyan); color: #04222a; border-color: var(--cyan); }
.g-copy { background: none; border: 1px solid var(--edge-2); color: var(--ink-dim); border-radius: 8px; padding: 7px 14px; font: 600 13px var(--sans); cursor: pointer; }
.g-copy:hover { border-color: var(--cyan); color: var(--cyan); }
.g-code { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--ink);
  white-space: pre; overflow-x: auto; max-height: 460px; }

@media (max-width: 900px) {
  .g-missions, .g-examples, .g-reqs, .g-facts { grid-template-columns: 1fr 1fr; }
  .g-preview, .g-int-body, .g-dec-opts { grid-template-columns: 1fr; }
  .g-h1 { font-size: 42px; } .g-rail { display: none; }
}
