/* Grounding page (5-4-3-2-1): layout of the page top and the one-step-at-a-time look.
   Behaviour comes from js/grounding-5-4-3-2-1.js; this file loads only on that page. */

/* ---------- Page top: the practice is on the first screen ----------
   Wide screens: the title on the left, the practice on the right. Narrow screens: title, the practice, then the text
   (visual order only, the markup is untouched). */
/* In a grid, a block centred with auto margins shrinks to its content; these keep their full width as before */
html:root .practice-page > section { width: 100%; }
html:root .practice-page > .g-band { border-radius: 20px; background: var(--panel, #f5f2f3); padding: 22px 28px 26px; }
@media (min-width: 1000px) {
  html:root .practice-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  html:root .practice-page > * { grid-column: 1 / -1; }
  html:root .practice-page > .practice-head { grid-column: 1; grid-row: 2; }
  html:root .practice-head h1 { font-size: clamp(34px, 3.5vw, 46px); }
  html:root .practice-page > .g-band { grid-column: 2; grid-row: 2; margin: 44px 32px 24px 8px; }
}
@media (max-width: 999px) {
  html:root .practice-page { display: grid; grid-template-columns: minmax(0, 1fr); }
  html:root .practice-page > * { order: 7; }
  html:root .practice-page > .practice-topbar { order: 0; }
  html:root .practice-page > .practice-head { display: contents; }
  html:root .practice-head > .eyebrow-cat { order: 1; margin: 44px 24px 12px; }
  html:root .practice-head > h1 { order: 2; margin: 0 24px 18px; }
  html:root .practice-page > .g-band { order: 3; margin: 0 16px; padding: 18px 18px 20px; }
  html:root .practice-head > .lead { order: 4; margin: 30px 24px 0; }
  html:root .practice-head > .practice-meta { order: 5; margin: 24px 24px 0; }
}

/* ---------- One step at a time ----------
   The script adds .is-live. Until it runs only the first step shows, in its final size, so nothing jumps;
   without scripts all five steps stay readable. */
html:root .gsteps { position: relative; max-width: none; margin: 0; padding-top: 22px; color: var(--ink, #0b0b0d); }
@media (scripting: enabled) {
  html:root .gsteps:not(.is-live) .gstep:not(:first-child) { display: none; }
}
html:root .gsteps.is-live .gstep:not(.active) { display: none; }
html:root .gstep, html:root .gdone { opacity: 1; padding: 0; border: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 28px; align-items: center; min-height: 300px; transition: opacity .3s ease, transform .3s ease; }
html:root .gdone[hidden] { display: none; }
html:root .gsteps.is-out .gstep, html:root .gsteps.is-out .gdone { opacity: 0; transform: translateY(8px); }
html:root .gstep .gstep-num { grid-row: 1 / span 2; min-width: 96px; font-size: 0; line-height: 0; text-align: center; color: var(--btn, #2f5582); }
html:root .gstep .gstep-num::before { content: "5"; font: 500 clamp(130px, 15vw, 190px)/.82 'Caveat', cursive; }
html:root .gstep[data-step="2"] .gstep-num::before { content: "4"; }
html:root .gstep[data-step="3"] .gstep-num::before { content: "3"; }
html:root .gstep[data-step="4"] .gstep-num::before { content: "2"; }
html:root .gstep[data-step="5"] .gstep-num::before { content: "1"; }
html:root .gstep .gstep-body { align-self: end; }
html:root .gstep .gstep-body p { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--muted, #4b4b56); max-width: 42ch; }
html:root .gstep .gstep-chips { gap: 10px; }
html:root .gstep .gchip { width: 56px; height: 56px; padding: 0; display: grid; place-items: center; border: 1px solid var(--hair2, rgba(11, 11, 13, .3)); border-radius: 50%; background: #fffdfb; color: inherit; cursor: pointer; transform: none; transition: border-color .3s ease; }
html:root .gstep .gchip:hover { border-color: var(--ink, #0b0b0d); background: #fffdfb; }
html:root .gstep .gchip.checked { border-color: transparent; background: #fffdfb; transform: none; }
html:root .gstep .gchip.checked::before { content: none; }
html:root .gstep .gchip:focus-visible, .g-again:focus-visible { outline: 2px solid var(--sky-accent, #2597d0); outline-offset: 3px; }
html:root .gstep .gchip svg { width: 46px; height: 46px; overflow: visible; pointer-events: none; }
.g-tick { fill: none; stroke: var(--btn, #2f5582); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-ring { fill: none; stroke: var(--btn, #2f5582); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html:root .gstep .gstatus, html:root .gstep.done .gstatus { grid-column: 2; align-self: start; min-width: 0; margin: 8px 0 0; text-align: left; font-family: var(--head, inherit); font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--muted, #4b4b56); font-variant-numeric: tabular-nums; }

.g-prog { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 6px; }
.g-prog i { flex: 1; height: 3px; border-radius: 3px; background: rgba(11, 11, 13, .13); transition: background .4s ease; }
.g-prog i.on { background: var(--btn, #2f5582); }
.g-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gdone-mark { min-width: 96px; display: grid; place-items: center; }
.gdone-mark svg { width: clamp(104px, 12vw, 150px); height: auto; overflow: visible; }
html:root .gdone-body h2 { margin: 0 0 16px; font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -0.02em; outline: none; }
.g-again { font-family: var(--head, inherit); font-size: 15px; font-weight: 500; min-height: 46px; padding: 0 26px; border-radius: 100px; border: 1px solid var(--hair2, rgba(11, 11, 13, .3)); background: transparent; color: inherit; cursor: pointer; }
.g-again:hover { border-color: currentColor; }

@media (max-width: 560px) {
  html:root .gstep, html:root .gdone { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 10px; }
  html:root .gstep .gstep-num { grid-row: auto; min-width: 0; text-align: left; }
  html:root .gstep .gstep-num::before { font-size: 110px; line-height: .78; }
  html:root .gstep .gstatus, html:root .gstep.done .gstatus { grid-column: 1; margin-top: 0; }
  .gdone-mark { justify-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  html:root .gstep, html:root .gdone, .g-prog i, html:root .gstep .gchip { transition: none; }
}
