/* The welcome, one question at a time (GateFlow.astro; Kyle, 11 November 2026: the gate "feels an incredibly intense page to
   land on"). Three ways of showing the same steps, on their /alt pages: steps (the whole screen, one calm column), sheet
   (the homepage stays in view and the welcome rises from the foot of the screen) and split (the moving field beside it).
   Type a size under the site's own, as on the gate (Kyle, 11 November 2026: "shrink all of the text (the non-headline text
   anyway)"): the strong lines 17px, text 15px, the choices' notes 14px, small print 13px; the welcome in the serif.
   Movement on the house curve, 0.3 to 0.9 seconds; colour over half a second; flat, square-cornered where the brand says. */

.gf { --gf-strong: 1.0625rem; --gf-text: .9375rem; --gf-small: .8125rem; --gf-pad: clamp(1.25rem, 2.4vw, 2rem);
  position: fixed; inset: var(--rh, 34px) 0 0 0; z-index: 21; display: grid; color: var(--ink); font-family: var(--sans); }
html.gf-done .gf, html.aud-set .gf.gate { display: none; }
/* the live gate carries the old gate's class (.gate) for everything that listens for it; its look is this one */
html .gf.gate { display: grid; padding: 0; overflow: visible; background: none; }
html .gf.gate:focus { outline: none; }
/* only while the welcome is up: the live gate (.gf.gate) is hidden once the visitor has chosen (aud-set), so it must not
   hold the page still or tint the risk line after that */
html:not(.gf-done):is(:has(.gf:not(.gate)), :not(.aud-set):has(.gf.gate)) body { overflow: hidden; }
html:not(.gf-done):is(:has(.gf:not(.gate)), :not(.aud-set):has(.gf.gate)) { scrollbar-gutter: stable; }
/* the risk line keeps its own navy over the welcome, as it does over the gate */
html:not(.gf-done):is(:has(.gf:not(.gate)), :not(.aud-set):has(.gf.gate)):is(:not(.gf-leaving), .gf-stay) .risk { background: var(--navy-deep) !important; color: var(--chalk) !important; }
html:not(.gf-done):is(:has(.gf:not(.gate)), :not(.aud-set):has(.gf.gate)):is(:not(.gf-leaving), .gf-stay) .risk :is(a, u) { color: var(--chalk) !important; }
/* and as the welcome leaves a page that opens on navy, it turns to the page's own tone with it, rather than after it */
html.gf-leaving:not(.gf-stay):is(.bar-dark, .wl-top:not(:has(.head.solid))) .risk { background: var(--chalk) !important; color: var(--ink) !important; transition: background-color .5s ease, color .5s ease; }
html.gf-leaving:not(.gf-stay):is(.bar-dark, .wl-top:not(:has(.head.solid))) .risk :is(a, u) { color: var(--ink) !important; }
html.gf-leaving:not(.gf-stay):is(.bar-dark, .wl-top:not(:has(.head.solid))) .risk u { text-decoration-color: var(--brick-word); }

/* ---------- the parts, the same in every way of showing them ---------- */
.gf-panel { position: relative; display: grid; align-content: start; gap: clamp(1rem, 2.6vh, 1.75rem); min-width: 0; }
.gf-steps { position: relative; display: grid; height: var(--gf-h, auto); overflow: clip; overflow-clip-margin: 8px; transition: height .55s var(--ease); }
html.gf-still .gf-steps { transition: none; }
.gf-step { grid-area: 1 / 1; align-self: start; display: grid; align-content: start; gap: clamp(1rem, 2.6vh, 1.75rem); min-width: 0;
  visibility: hidden; opacity: 0; transition: opacity .18s ease, visibility 0s .18s; }
.gf-step.on { visibility: visible; opacity: 1; transition: opacity .4s ease .1s, visibility 0s; }
/* each half of a step rises into place a beat after the one before it, as the menu's panel columns do */
.gf-step > * { transform: translateY(.75rem); transition: transform 0s .18s; }
.gf-step.on > * { transform: none; transition: transform .6s var(--ease) .1s; }
.gf-step.on > .gf-r { transition-delay: .16s; }
.gf-l, .gf-r { display: grid; align-content: start; gap: .75rem; min-width: 0; }

.gf-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, min(4.4vw, 7.5vh), 3.75rem); line-height: .98; letter-spacing: -.012em; color: var(--navy); text-wrap: balance; }
.gf-h em { font-style: italic; color: var(--brick-word); }
.gf-h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, min(2.6vw, 4.6vh), 2.25rem); line-height: 1.02; color: var(--navy); outline: none; text-wrap: balance; }
.gf-q { margin: 0; font: 600 var(--gf-strong)/1.4 var(--sans); color: var(--navy); }
.gf-t { margin: 0; font-size: var(--gf-text); line-height: 1.55; color: var(--ink); }
.gf-l > .gf-h + .gf-q { margin-top: .375rem; }

/* how far through you are: a short line for each step, the ones done in navy (two for an investor, three for an adviser) */
.gf-prog { display: flex; gap: .3125rem; }
.gf-prog i { width: 1.5rem; height: 2px; background: var(--rule); transition: background-color .5s ease; }
.gf-prog .gf-adv { display: none; }
.gf[data-choice="adviser"] .gf-prog .gf-adv { display: block; }
/* the notice already understood on this device: no step to count */
.gf[data-noticed] .gf-prog { visibility: hidden; }
.gf-prog i:nth-child(1), .gf:is([data-step="notice"], [data-step="declare"]) .gf-prog i:nth-child(2), .gf[data-step="declare"] .gf-prog i:nth-child(3) { background: var(--navy); }

/* the two choices: one click each, no Confirm */
.gf-opts { display: grid; gap: .75rem; }
.gf-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; width: 100%; padding: 1rem 1.125rem 1rem 1rem;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color .5s ease, background-color .5s ease; }
.gf-opt:hover, .gf-opt.on { border-color: var(--navy); }
.gf-opt.on { box-shadow: inset 0 0 0 1px var(--navy); }
.gf-opt:focus-visible { outline: 2px solid var(--trim-focus); outline-offset: 3px; }
.gf-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-icon); background: var(--navy); color: var(--chalk); transition: background-color .5s ease; }
.gf-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gf-opt:hover .gf-ico, .gf-opt.on .gf-ico { background: var(--brick); }
.gf-ot { display: grid; gap: .1875rem; min-width: 0; }
.gf-ot b { font-family: var(--serif); font-weight: 400; font-size: 1.375rem; line-height: 1.1; color: var(--navy); }
.gf-ot small { font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.gf-go { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--brick-word); transition: transform .5s var(--ease); }
.gf-go svg { width: 18px; height: 18px; }
.gf-opt:hover .gf-go { transform: translateX(.25rem); }

/* back, quietly */
.gf-back { justify-self: start; display: inline-flex; align-items: center; gap: .25rem; margin: 0 0 .25rem -.375rem; padding: .3125rem .625rem .3125rem .25rem; border: 0; border-radius: var(--r-button);
  background: none; font: 500 var(--gf-text)/1.2 var(--sans); color: var(--ink-soft); cursor: pointer; transition: background-color .5s ease, color .5s ease; }
.gf-back svg { width: 16px; height: 16px; }
.gf-back:hover { background: var(--stone); color: var(--navy); }

/* the notice's points: rows under hairlines, no bullets */
/* the notice as short paragraphs, with no lines between them (Kyle, 12 November 2026); one hairline above it, under the
   heading, and none below, the prompt and its button following on */
.gf-points { margin: 0; padding-top: clamp(.875rem, 2vh, 1.25rem); border-top: 1px solid var(--rule); display: grid; gap: clamp(.625rem, 1.6vh, 1rem); font-size: var(--gf-text); line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.gf-points p { margin: 0; }
.gf-ask { margin-top: .25rem; }
.gf-act { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .25rem; }
.gf-act .btn { min-width: 12rem; justify-content: center; font: 500 1rem/1.2 var(--sans); border-radius: var(--r-button); }
.gf-act .btn:disabled { background: var(--stone); border-color: var(--stone); color: var(--taupe); cursor: default; }
.gf-hint { margin: 0; font-size: var(--gf-small); color: var(--ink-soft); }

/* the adviser's four statements: rows to tick */
.gf-ticks { display: grid; border-bottom: 1px solid var(--rule); }
.gf-tick { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: .875rem; align-items: start; padding-block: .6875rem; border-top: 1px solid var(--rule);
  font-size: var(--gf-text); line-height: 1.5; color: var(--ink); cursor: pointer; }
.gf-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
/* each box sits on the middle of its first line's lowercase letters (Kyle, 20 November 2026: "a little too high"): it was
   set at the top of the line, which centred it on the capitals, so it stood 2px further above the lowercase words than it
   hung below them. The middle of Archivo's lowercase is .79em below the top of a 1.5 line; in em, so it holds at every size */
.gf-box { width: 22px; height: 22px; margin-top: calc(.79em - 11px); box-sizing: border-box; display: grid; place-items: center; border: 1.5px solid var(--navy); background: #fff; color: var(--chalk); transition: background-color .5s ease; }
.gf-box svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .35s var(--ease) .05s; }
.gf-tick:hover .gf-box { background: var(--stone); }
.gf-tick:has(input:checked) .gf-box { background: var(--navy); }
.gf-tick:has(input:checked) .gf-box svg { stroke-dashoffset: 0; }
.gf-tick:has(input:focus-visible) .gf-box { outline: 2px solid var(--trim-focus); outline-offset: 3px; }
.gf-false { font-size: var(--gf-small); color: var(--ink-soft); }
.gf-false b { font-weight: 600; color: var(--navy); }

/* the small print is about the choice: it shows with the choice, and steps aside for the notice and the statements */
.gf-foot { transition: opacity .3s ease; }
.gf:not([data-step="choose"]) .gf-foot { display: none; }
.gf-foot { margin: 0; font-size: var(--gf-small); line-height: 1.5; color: var(--ink-soft); }
.gf-foot a { color: var(--brick-word); font-weight: 600; white-space: nowrap; }
.gf-foot a:hover { color: var(--navy); }
.gf-foot a svg { width: 11px; height: 11px; margin-left: .25rem; vertical-align: .05em; }
.gf-logo { display: none; }

/* ---------- steps: the whole screen in chalk, one calm column ---------- */
/* anchored a little above the middle rather than centred, so the column grows downwards from one step to the next and the
   question never moves */
.gf[data-flow="steps"] { background: var(--chalk); overflow-y: auto; place-items: start center; padding: calc(var(--hh, 80px) + clamp(1rem, 9vh, 7rem)) 1.5rem 2rem; }
.gf[data-flow="steps"] .gf-panel { width: min(44rem, 100%); }
.gf[data-flow="steps"] .gf-logo, .gf[data-flow="split"] .gf-logo { display: flex; align-items: center; position: absolute; top: 0; left: max(2rem, calc((100% - 1280px) / 2)); height: var(--hh, 80px); z-index: 2; }
.gf-logo svg { width: auto; height: 50px; display: block; }   /* the header's own size, so the logo holds still as the welcome leaves */
.gf[data-flow="steps"] .gf-step[data-s="choose"] .gf-r { margin-top: .5rem; }

/* ---------- sheet: the homepage in view, dimmed; the welcome rises from the foot of the screen ---------- */
.gf[data-flow="sheet"] { align-items: end; }
.gf-scrim { position: absolute; inset: 0; background: rgb(23 42 74 / .42); }
.gf[data-flow="sheet"] .gf-panel { justify-self: center; width: calc(100% - 2 * var(--nf-in, 1rem)); max-height: calc(100% - 1.5rem); overflow-y: auto;
  padding: clamp(1.5rem, 3.6vh, 2.5rem) clamp(1.5rem, 3vw, 2.75rem) clamp(1rem, 2.4vh, 1.5rem);
  background: var(--chalk); border: 1px solid var(--rule); border-bottom: 0; border-radius: 8px 8px 0 0; }
.gf[data-flow="sheet"] .gf-step { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.gf[data-flow="sheet"] .gf-h { font-size: clamp(2.25rem, min(3.6vw, 6.4vh), 3.25rem); }
.gf[data-flow="sheet"] .gf-foot { padding-top: clamp(.75rem, 2vh, 1rem); border-top: 1px solid var(--rule); }
.gf[data-flow="sheet"] .gf-prog { position: absolute; top: clamp(1rem, 2.4vh, 1.5rem); right: clamp(1.5rem, 3vw, 2.75rem); }

/* ---------- split: the moving field on the left with the welcome; the steps on chalk on the right ---------- */
html .gf[data-flow="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--chalk); }
.gf-art { display: none; }
.gf[data-flow="split"] .gf-art { display: block; position: relative; overflow: hidden; background-color: var(--navy); background-size: 200% 100%; background-position: 0 50%; }
/* once the field draws itself, the still under it goes */
.gf-art.gl-on { background-image: none !important; }
/* the field drawn the width of the whole screen, so the panel shows the homepage's own field, its left half, and the page
   under it carries straight on when the welcome leaves */
.gf-art canvas { position: absolute; top: 0; left: 0; width: 200%; height: 100%; display: block; }
.gf[data-flow="split"] > .fpause { top: auto; right: auto; bottom: .75rem; left: .75rem; }   /* the corner of the screen, as far from the left as from the foot (Kyle, 18 November 2026), not lined up with the logo */
.gf-art-h { position: absolute; left: max(2rem, calc((200% - 1280px) / 2)); right: clamp(2rem, 4vw, 4rem); bottom: clamp(2rem, 9vh, 5.5rem); margin: 0;
  font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, min(4.6vw, 11vh), 5.5rem); text-wrap: balance; line-height: .94; letter-spacing: -.014em; color: var(--chalk); }
.gf-art-h em { font-style: italic; color: var(--brick-accent); }
.gf[data-flow="split"] .gf-panel { align-self: center; justify-self: center; width: min(32rem, 100% - 4rem); max-height: 100%; overflow-y: auto; padding-block: 2rem; }
.gf[data-flow="split"] .gf-step[data-s="choose"] .gf-h { display: none; }
.gf[data-flow="split"] .gf-step[data-s="choose"] .gf-l > .gf-q { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, min(2.6vw, 4.6vh), 2.25rem); line-height: 1.08; }

/* ---------- arriving and leaving ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* steps and split: the column rises in out of a soft blur, as the gate's words do */
  .gf:is([data-flow="steps"], [data-flow="split"]) .gf-panel > :is(.gf-prog, .gf-steps, .gf-foot) { animation: gf-in .85s cubic-bezier(.215,.61,.355,1) var(--d, .1s) both; }
  .gf .gf-panel > .gf-steps { --d: .18s; } .gf .gf-panel > .gf-foot { --d: .3s; }
  .gf[data-flow="split"] .gf-art-h { animation: gf-in 1s cubic-bezier(.215,.61,.355,1) .35s both; }
  /* sheet: the page dims, then the sheet rises */
  .gf[data-flow="sheet"] .gf-scrim { animation: gf-fade .7s ease .2s both; }
  .gf[data-flow="sheet"] .gf-panel { animation: gf-rise .9s var(--ease) .45s both; }
  /* leaving */
  html.gf-leaving .gf:is([data-flow="steps"], [data-flow="split"]) .gf-panel > * { animation: gf-out .42s cubic-bezier(.55,.06,.68,.19) both; }
  html.gf-leaving .gf:is([data-flow="steps"], [data-flow="split"]) { animation: gf-fade-out .6s cubic-bezier(.4,0,.2,1) .3s both; }
  html.gf-leaving .gf[data-flow="split"] .gf-art { animation: gf-fade-out .5s ease .1s both; }
  html.gf-leaving .gf[data-flow="sheet"] .gf-panel { animation: gf-sink .6s cubic-bezier(.55,.06,.68,.19) both; }
  html.gf-leaving .gf[data-flow="sheet"] .gf-scrim { animation: gf-fade-out .6s ease .15s both; }
  /* going on to the adviser's version of the page: only the words go; the next page lifts the rest (gate-cover, vt-gate-out) */
  html.gf-leaving.gf-stay .gf { animation: none !important; }
  html.gf-leaving.gf-stay .gf[data-flow="split"] .gf-art { animation: none; }

  /* the homepage, on a wide screen (gateflow.js, sweep): the words lift away as ever; then the chalk half slides off to
     the right in one piece, and the homepage, its field already the welcome's own, is there underneath, its words coming
     in as the panel goes. Nothing else moves: the field never changes. */
  html.gf-sweep .gf[data-flow="split"], html.gf-sweep .gf[data-flow="split"] .gf-art { animation: none; }
  html.gf-sweep .gf[data-flow="split"] .gf-art-h { animation: gf-out .5s cubic-bezier(.55,.06,.68,.19) .2s both; }
  html.gf-sweep .gf[data-flow="split"] > .fpause { opacity: 0; transition: opacity .3s ease; }
  html.gf-swept .gf[data-flow="split"] { background: none; transition: none; }
  html.gf-swept .gf[data-flow="split"] .gf-art { background: none !important; transition: none; }   /* at once: an eased fade washed the field */
  html.gf-swept .gf[data-flow="split"] .gf-art canvas { visibility: hidden; }
  html.gf-swept .gf[data-flow="split"] .gf-panel { visibility: hidden; }
  .gf-wall { position: absolute; z-index: 4; top: 0; bottom: 0; left: 50%; right: 0; background: var(--chalk); pointer-events: none; }
  html.gf-swept .gf-wall { transform: translateX(100%); transition: transform .85s cubic-bezier(.65,0,.35,1); }

  /* the adviser's move onto the adviser's homepage (head.mjs: gf-arrive): the same. The page before, its words gone, is
     cut to its chalk half, which slides off to the right over the new page; the new page's field has carried straight on
     from the welcome's (wl.js), and its words and menu come in as the panel goes (site.js). The logo stays in its pixel. */
  /* the page before is held whole for a moment, while the new page's field draws its first frame under it, then cut to
     its chalk half, which slides */
  html.gf-hand .gf[data-flow="split"] .gf-art-h { animation: gf-out .42s cubic-bezier(.55,.06,.68,.19) both; }
  html.gf-hand .gf[data-flow="split"] > .fpause { opacity: 0; transition: opacity .3s ease; }
  html.gf-arrive.vt-gate-out::view-transition-old(root) { z-index: 1; animation: gf-slide-out 1.05s linear both; }
  html.gf-arrive.gate-cover body::after { left: 50%; top: var(--rh, 44px); transition: transform .85s cubic-bezier(.65,0,.35,1); }
  html.gf-arrive.gate-cover.gate-uncover body::after { opacity: 1; transform: translateX(100%); }
  html.hm-anim.wl-top.gf-arrive:not(.gate-arrive) .head { opacity: 1; }
  html.hm-anim.wl-top.gf-arrive .head .wrap > :not(.logo) { transition: opacity .8s ease .1s; }
  html.hm-anim.wl-top.gf-arrive:not(.gate-arrive) .head .wrap > :not(.logo) { opacity: 0; }
}
@keyframes gf-slide-out {
  0%, 18% { clip-path: inset(var(--rh, 44px) 0 0 0); transform: none; }
  18.01% { clip-path: inset(var(--rh, 44px) 0 0 50%); transform: none; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  100% { clip-path: inset(var(--rh, 44px) 0 0 50%); transform: translateX(50%); }
}
@keyframes gf-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes gf-out { to { opacity: 0; transform: translateY(-14px); filter: blur(6px); } }
@keyframes gf-fade { from { opacity: 0; } }
@keyframes gf-fade-out { to { opacity: 0; } }
@keyframes gf-rise { from { transform: translateY(100%); } }
@keyframes gf-sink { to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .gf-step, .gf-step > *, .gf-steps { transition: none !important; } }

/* ---------- phones: one column on chalk, whichever way it is shown ---------- */
@media (max-width: 900px) {
  html .gf[data-flow] { display: block; background: var(--chalk); overflow-y: auto; padding: 1.5rem 1.25rem 2rem; }
  .gf[data-flow] .gf-art, .gf[data-flow] .gf-logo, .gf[data-flow] > .fpause { display: none; }
  .gf[data-flow] .gf-scrim { display: none; }
  .gf[data-flow] .gf-panel { width: 100%; max-height: none; padding: 0; border: 0; background: none; overflow: visible; }
  .gf[data-flow] .gf-step { grid-template-columns: minmax(0, 1fr); }
  .gf[data-flow="split"] .gf-step[data-s="choose"] .gf-h { display: block; }
  .gf[data-flow="split"] .gf-step[data-s="choose"] .gf-l > .gf-q { font: 600 var(--gf-strong)/1.4 var(--sans); }
  .gf[data-flow="sheet"] .gf-prog { position: static; }
  .gf-act .btn { flex: 1 1 100%; }
}
