/* App Guide page. Loaded only by app-guide.html, on top of style.css. */
.app-guide {
    --bg: #000000;
    --surface: #1b1d22;
    --ink: #ffffff;
    --muted: #c9c9c9;
    --line: rgba(255, 255, 255, .16);
    --accent: #9db0ff;
    --accent-soft: rgba(77, 109, 255, .18);
    --select: #3b55cc;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --mono: Consolas, Menlo, Monaco, 'Courier New', monospace;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.55;
}
[data-theme="light"] .app-guide {
    --bg: #e4e7ec;
    --surface: #eef0f4;
    --ink: #34383e;
    --muted: #5b6066;
    --line: rgba(0, 0, 0, .12);
    --accent: #3b55cc;
    --accent-soft: rgba(59, 85, 204, .10);
}

.app-guide h1, .app-guide h2, .app-guide h3, .app-guide p { margin: 0; }
.app-guide h1, .app-guide h2, .app-guide h3 { text-wrap: balance; line-height: 1.15; }
:where(.app-guide) button { font: inherit; color: inherit; }
.app-guide :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-guide .section-kicker { margin-bottom: 0; }
.navbar .nav-link.active { color: #9db0ff; }
[data-theme="light"] .navbar .nav-link.active { color: #3b55cc; }

.guide-flow { display: grid; gap: 56px; padding-top: 128px; padding-bottom: 24px; }
.guide-result { scroll-margin-top: 104px; }

.intro { display: grid; gap: 14px; max-width: 760px; }
.intro h1 { font-size: clamp(38px, 6vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.intro p.lede { font-size: 20px; color: var(--muted); max-width: 62ch; }

.section-head { display: grid; gap: 8px; max-width: 700px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.015em; }
.section-head p { color: var(--muted); }

/* Result */
.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  align-items: start;
}
.explain { display: grid; gap: 14px; }
.explain .tag { color: var(--accent); font-weight: 700; }
.explain h3 { font-size: 30px; font-weight: 800; }
.facts { display: grid; gap: 10px; margin: 0; }
.facts div { display: grid; gap: 1px; }
.facts dt { font-weight: 700; font-size: 15px; }
.facts dd { margin: 0; color: var(--muted); }

.stage { display: grid; place-items: center; min-height: 330px; border-radius: 8px; padding: 18px; }

/* Next step */
.next { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.next > div { flex: 1 1 320px; display: grid; gap: 4px; }
.next h3 { font-size: 21px; font-weight: 700; }
.next p { color: var(--muted); font-size: 16px; }
.next .custom-btn { flex: none; }

/* The six types */
.types { display: grid; gap: 22px; }
.types-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.type-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 4px; align-content: start; }
.type-item h3 { font-size: 19px; font-weight: 700; }
.type-item span { color: var(--accent); font-weight: 600; font-size: 15px; }
.type-item p { color: var(--muted); font-size: 16px; }

/* One question at a time, with the options narrowing beside it */
.guide-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.guide-ask {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  display: grid;
  gap: 16px;
  min-height: 545px;
  align-content: start;
  overflow: hidden;
}
.guide-step { display: grid; gap: 16px; }
.guide-progress { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.guide-progress i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .5s var(--ease); }
.guide-count { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.guide-ask h2 { font-size: clamp(27px, 3.5vw, 36px); font-weight: 800; letter-spacing: -.015em; }
.guide-ask h2:focus { outline: none; }
.guide-ask p { color: var(--muted); }
.guide-answers { display: grid; gap: 10px; }
.guide-answer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  animation: guide-rise .38s var(--ease) both;
  transition: background-color .18s, border-color .18s, color .18s, transform .12s;
}
.guide-answer:nth-child(2) { animation-delay: 60ms; }
.guide-answer:nth-child(3) { animation-delay: 120ms; }
.guide-answer:active { transform: scale(.985); }
.guide-answer span { color: var(--accent); transition: transform .2s var(--ease), color .18s; }
.guide-answer.chosen { background: var(--select); border-color: var(--select); color: #ffffff; }
.guide-answer.chosen span { color: #ffffff; transform: translateX(8px); }
.guide-label { display: inline-flex; align-items: center; gap: 12px; font-style: normal; }
.guide-label svg { width: 24px; height: 24px; flex: none; color: var(--accent); transition: color .18s; }
.guide-answer.chosen .guide-label svg { color: #ffffff; }
.guide-back { justify-self: start; display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px; font-weight: 600; cursor: pointer; transition: border-color .18s; }
.guide-back svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.guide-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-board { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; display: grid; gap: 12px; grid-template-rows: auto 1fr; }
.guide-board-title { font-weight: 700; justify-self: start; transform-origin: left center; }
.guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.guide-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 3px;
  align-content: start;
  animation: guide-rise .42s var(--ease) both;
  animation-delay: calc(var(--i) * 55ms);
  transition: background-color .32s, border-color .32s, color .32s, opacity .4s;
}
.guide-cards.waiting .guide-card { background: transparent; opacity: .5; }
.guide-cards.waiting .guide-card .status { color: var(--muted); }
.guide-cards.waiting .guide-card > * { filter: blur(6px); user-select: none; }
.guide-card .line, .guide-card .status { transition: filter .45s; }
.guide-card b {
  font-size: 17px;
  line-height: 1.25;
  justify-self: start;
  transition: color .32s, filter .45s;
}
.guide-card .line { font-size: 14px; color: var(--muted); line-height: 1.3; }
.guide-card .status { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: 4px; }
.guide-card.best { background: var(--select); border-color: var(--select); color: #ffffff; grid-column: 1 / -1; grid-row: 1 / -1; align-content: center; justify-items: center; text-align: center; padding: 28px; }
.guide-card.best b { font-size: 28px; justify-self: center; }
.guide-card.best .line { font-size: 16px; }
.guide-card.best .line, .guide-card.best .status { color: #ffffff; }
.guide-card-action { margin-top: 18px; background: #ffffff; color: #27337a; border: 0; border-radius: 6px; padding: 11px 18px; font-weight: 700; cursor: pointer; transition: opacity .18s; }
/* Touch screens keep :hover after a tap, which would mark an answer on the next question */
@media (hover: hover) {
  .guide-answer:hover { border-color: var(--accent); }
  .guide-answer:hover span { transform: translateX(4px); }
  .guide-back:hover { border-color: var(--accent); }
  .guide-back:hover svg { transform: translateX(-3px); }
  .guide-back.restart:hover svg { transform: rotate(-40deg); }
  .guide-card-action:hover { opacity: .88; }
}

@media (min-width: 861px) {
  .guide-cards { grid-template-rows: repeat(3, 1fr); }
}
.guide-result { display: grid; gap: 24px; }
.guide-result > * { animation: guide-rise .5s var(--ease) both; }
.guide-result > :nth-child(1) { animation-delay: .75s; }
.guide-result > :nth-child(2) { animation-delay: .87s; }
.guide-result > :nth-child(3) { animation-delay: .99s; }
.guide-result .stage svg { animation: guide-pop .55s var(--ease) both; animation-delay: 1.05s; }
.stage.plain { background: var(--bg); }
.stage.plain svg { width: 100%; max-width: 380px; height: auto; }
.i-frame { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.i-block { fill: var(--line); }
.i-soft { fill: var(--accent-soft); }
.i-strong { fill: var(--select); }
.i-dot { fill: var(--accent); }
.i-white { fill: #ffffff; }
.i-wire { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-wire-white { fill: none; stroke: #ffffff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes guide-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes guide-pop { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.guide-result > h2 { font-size: clamp(26px, 3.5vw, 32px); font-weight: 800; letter-spacing: -.015em; }

/* Phone parts, off on desktop */
.guide-strip, .guide-phone-action { display: none; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chip { font-size: 13px; font-weight: 600; line-height: 1.2; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }

@media (max-width: 860px) {
  .explorer, .guide-panel { grid-template-columns: minmax(0, 1fr); }
  .guide-ask { min-height: 0; padding: 18px; }
  .intro { gap: 8px; }
  .intro h1 { font-size: 32px; }
  .guide-flow { gap: 32px; padding-top: 120px; }
  .intro p.lede { font-size: 17px; }
  .guide-panel { display: block; }
  .guide-board { display: none; }
  .guide-ask h2 { font-size: 26px; }
  .guide-strip.on { display: grid; gap: 8px; min-height: 86px; align-content: start; }
  .guide-strip-label { font-size: 15px; font-weight: 700; }
  .guide-ask.is-best { background: var(--select); border-color: var(--select); color: #ffffff; }
  .guide-ask.is-best .guide-progress { display: none; }
  .guide-ask.is-best .guide-count, .guide-ask.is-best p { color: #ffffff; }
  .guide-ask.is-best .guide-back { color: #ffffff; border-color: rgba(255, 255, 255, .55); }
  .guide-phone-action { display: block; width: 100%; margin-top: 2px; }
  .guide-nav .guide-back { flex: 1; justify-content: center; }
  .guide-result > h2, .section-head h2 { font-size: 26px; }
  .guide-result > :nth-child(n), .guide-result .stage svg { animation-delay: .1s !important; }
  .explain h3 { display: none; }
  .stage { min-height: 0; padding: 14px; }
  .stage.plain svg { max-width: 280px; }
  .next { padding: 18px; }
  .next .custom-btn { flex: 1 1 100%; }
  .types-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .guide-cards, .types-grid { grid-template-columns: minmax(0, 1fr); }
  .types-grid { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
  .type-item { background: transparent; border: 0; border-radius: 0; padding: 14px 16px; }
  .type-item + .type-item { border-top: 1px solid var(--line); }
  .guide-ask, .guide-board, .next { padding: 18px; }
  .explorer { padding: 16px; }
}

@media (max-width: 339.98px) {
  .navbar-brand { margin-right: 0; }
  .navbar .brand-logo { width: 200px; height: 33px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-guide *, .guide-result { animation: none !important; transition: none !important; }
}
