/* ==========================================================================
   START GUIDE (templates/partials/guide.html, static/js/guide.js): a modal
   with five steps on the dashboard and on the project page. Uses the
   dashboard tokens (dashboard.css, .faDashBody), so it follows dark mode.
   ========================================================================== */

.faGuide {
	width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
	padding: 0; border: 0; border-radius: var(--r-plus);
	background: var(--surface); color: var(--ink); box-shadow: var(--shadow-up);
	overflow: hidden auto;
}
.faGuide[open] { animation: gDialogIn .28s cubic-bezier(.2, .8, .3, 1); }
.faGuide::backdrop { background: rgb(17 17 17 / .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.gStep:not([hidden]) { display: block; animation: gStepIn .3s ease-out; }
.gArt { display: block; width: 100%; height: auto; aspect-ratio: 400 / 220; background: var(--hl-tint); }
.gText { padding: 18px 28px 2px; }
.gText h2, .gText h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
.gText p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.gText b { color: var(--ink); }
.gNew, .gPaid, .gFree {
	display: inline-block; vertical-align: .15em; margin: 0 1px;
	padding: 2px 7px; border-radius: 999px;
	font-size: .65rem; font-weight: 500; letter-spacing: .06em; line-height: 1.3; text-transform: uppercase;
}
.gNew { background: var(--hl); color: var(--on-highlight-color); }
.gPaid, .gFree { box-shadow: inset 0 0 0 1.5px var(--hl); color: var(--hl); }

.gFoot { display: flex; align-items: center; gap: 12px; padding: 20px 28px 24px; }
.gDots { flex: 1; display: flex; justify-content: center; gap: 2px; }
.faGuide .gDot, .regTour .gDot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.gDot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s, background .2s; }
.gDot:hover::before { background: var(--hl-soft); }
.gDot[aria-current="step"] { width: 34px; }
.gDot[aria-current="step"]::before { width: 22px; background: var(--hl); }
.gDot:focus-visible, .faGuide .btn:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
.faGuide .btn.primary { min-width: 8.5rem; justify-content: center; }

@media (max-width: 520px) {
	.gText { padding: 14px 20px 2px; }
	.gText h2 { font-size: 1rem; }
	.gFoot { padding: 16px 20px 20px; gap: 8px; }
	.faGuide .btn.primary { min-width: 0; }
}

/* --- illustration paint: drawn like the hands (static/icons/hands): a light fill
   with a highlight outline; warnings and errors are the true yellow and red -- */
.gArt text { font-family: inherit; }
.faDash .gArt g.tone > svg.h { max-width: 100px; max-height: 100px; }
.gArt .o, .gArt .o-s, .gArt .o-a, .gArt .o-q { stroke: var(--hl); stroke-width: 2; stroke-linejoin: round; }
.gArt .o { fill: var(--hl-tint); }
.gArt .o-s { fill: var(--surface); }
.gArt .o-a { fill: var(--hl-soft); }
.gArt .o-q { fill: var(--bg); stroke: var(--hl-soft); stroke-width: 1.5; }
.gArt .ln, .gArt .ln-s { fill: none; stroke: var(--hl); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gArt .ln-s { stroke: var(--hl-soft); }
.gArt .s-thick { stroke-width: 6; }
.gArt .o-half { opacity: .55; }
.gArt .f-hl { fill: var(--hl); }
.gArt .f-on { fill: var(--on-highlight-color); }
.gArt .b-w { fill: var(--warn); }
.gArt .b-e { fill: var(--err); }
.gArt .t-ink { fill: var(--ink); }
.gArt .t-hl { fill: var(--hl); }
.gArt .t-white { fill: #fff; }
.gArt .t-w { fill: var(--warn-on); }
.gArt .t-e { fill: var(--err-on); }
.gArt .ln-white { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.gArt .t-stroke { stroke: var(--ink); stroke-width: 0; stroke-linejoin: round; paint-order: stroke; }
.gArt .a-track { fill: var(--hl); }
.gArt .a-knob { transform: translateX(14px); }

/* --- motion: runs on the open step only (hidden steps are display: none) ---- */
.gArt [class*="a-"] { transform-box: fill-box; transform-origin: center; animation-delay: var(--d, 0s); animation-fill-mode: both; }
.gArt .d2 { --d: .5s; } .gArt .d3 { --d: 1s; } .gArt .d4 { --d: 1.5s; } .gArt .d5 { --d: 2s; } .gArt .d6 { --d: 2.5s; }
.gArt .a-popio.d2 { --d: 1.1s; }
.gArt .a-popio.d3 { --d: 2.2s; }
.gArt .a-popio.d4 { --d: 3.3s; }
.gArt .a-rise { animation: gRise .5s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both; }
.gArt .a-pop { animation: gPop .45s cubic-bezier(.3, 1.6, .5, 1) var(--d, 0s) both; }
.gArt .d4.a-pop { --d: .6s; } .gArt .d5.a-pop { --d: .9s; }
.gArt .a-drop { animation: gDrop .8s cubic-bezier(.3, 1.4, .5, 1) .2s both; }
.gArt .a-up { animation: gUp .9s cubic-bezier(.2, .9, .3, 1.2) calc(.2s + var(--d, 0s)) both; }
.gArt .a-draw { stroke-dasharray: 100; animation: gDraw .5s ease-out var(--d, 0s) both; }
.gArt .a-track { animation: gTrack .3s ease-out var(--d, 0s) both; }
.gArt .a-knob { animation: gKnob .3s ease-out var(--d, 0s) both; }
.gArt .a-fly { animation: gFly 3s ease-in-out var(--d, 0s) infinite both; }
.gArt .a-glow { animation: gGlow 1.8s ease-in-out infinite alternate; }
.gArt .a-grow { transform-origin: 50% 100%; animation: gGrow .5s cubic-bezier(.2, .9, .3, 1.2) var(--d, 0s) both; }
.gArt .a-pulse { animation: gPulse .9s ease-in-out var(--d, 0s) infinite alternate both; }
.gArt .a-float { animation: gFloat 2.4s ease-in-out calc(var(--d, 0s) * -1) infinite alternate both; }
.gArt .a-drift { animation: gDrift 7s ease-in-out calc(var(--d, 0s) * -3) infinite alternate both; }
/* the four hands of the custom-tests step take turns in one place, 1.6s each */
.gArt .a-popio { animation: gPopIO 6.4s cubic-bezier(.3, 1.4, .5, 1) var(--d, 0s) infinite both; }
.gArt .p2 { --d: 1.6s; } .gArt .p3 { --d: 3.2s; } .gArt .p4 { --d: 4.8s; }
.gArt .a-weight { animation: gWeight 2.6s ease-in-out infinite alternate; }
.gArt .a-kern { animation: gKern 1.6s ease-in-out .8s infinite alternate both; }
.gArt .a-play { transform-origin: 0 0; animation: gPlay 2.6s ease-in-out infinite alternate; }

@keyframes gDialogIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes gStepIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes gRise { from { opacity: 0; transform: translateY(18px); } }
@keyframes gPop { from { opacity: 0; transform: scale(.3); } }
@keyframes gDrop { from { opacity: 0; transform: translateY(-60px); } 40% { opacity: 1; } }
@keyframes gUp { from { transform: translateY(70px); } }
@keyframes gDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes gTrack { from { fill: var(--hl-tint); } }
@keyframes gKnob { from { transform: translateX(0); } }
@keyframes gFly {
	0% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
	12%, 45% { opacity: 1; transform: translate(var(--dx), var(--dy)); }
	80% { opacity: 1; transform: translate(0, 0) scale(.7); }
	100% { opacity: 0; transform: translate(0, 0) scale(.7); }
}
@keyframes gGlow { from { stroke-opacity: .25; } to { stroke-opacity: 1; } }
@keyframes gGrow { from { transform: scaleY(0); } }
@keyframes gPulse { to { transform: scale(1.4); } }
@keyframes gFloat { from { transform: translateY(4px) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes gDrift { from { transform: translate(-6px, 4px) rotate(-3deg); } to { transform: translate(6px, -4px) rotate(3deg); } }
@keyframes gPopIO { 0% { opacity: 0; transform: scale(.2); } 5%, 21% { opacity: 1; transform: scale(1); } 25%, 100% { opacity: 0; transform: scale(.2); } }
@keyframes gWeight { to { stroke-width: 7px; } }
@keyframes gKern { to { transform: translateX(-10px); } }
@keyframes gPlay { to { transform: translateX(220px); } }

/* --- registration carousel (accounts/_why_tour.html, script in register.html) --- */
.regTour {
	max-width: 51.5rem; margin: 2.5rem auto 0; overflow: hidden;
	border-radius: var(--border-radius); background: var(--bgminus-color); box-shadow: var(--shadow); outline: 1px solid var(--edge);   /* same as .faCard (account.css) */
}
.regTour .gStep:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
.regTour .gText { padding: 24px 28px; }
.regTour .gFoot { padding: 4px 28px 18px; }
.regArrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--hl); font-size: 1.1rem; }
.regArrow:hover { background: var(--hl-tint); }
.regArrow:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
@media (max-width: 40rem) {
	.regTour { margin-top: 1.5rem; }
	.regTour .gStep:not([hidden]) { display: block; }
	.regTour .gText { padding: 16px 20px 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.faGuide[open], .gStep:not([hidden]), .gArt [class*="a-"] { animation: none !important; }
	.gDot::before { transition: none; }
	.gArt .a-fly, .gArt .p2, .gArt .p3, .gArt .p4 { opacity: 0; }   /* still: only the first hand of the custom-tests step */
}
