/* referral-link-uk — bespoke styles. Archetype: vertical timeline / guided step-flow.
   Type: British humanist sans (Gill Sans). Palette: British racing green / charcoal + brass accent. */

:root {
  --font: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Calibri, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --paper: #f5f7f4;
  --surface: #ffffff;
  --ink: #1a1f1c;
  --ink-soft: #47514b;
  --racing: #0f3d2e;      /* British racing green */
  --racing-deep: #0a2c21;
  --racing-tint: #e6efe9;
  --accent: #9c6f1f;      /* brass — used with dark ink for contrast */
  --accent-strong: #7d5714;
  --line: #d5ddd6;
  --line-soft: #e6ebe6;
  --live: #146c43;
  --live-bg: #e2f2e9;
  --check: #8a5a00;
  --check-bg: #f6ecd6;
  --off: #7a2b2b;
  --off-bg: #f4e2e2;
  --focus: #135c9d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 8px 24px rgba(16, 40, 30, .07);
  --maxw: 66rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d100e;
    --surface: #161b17;
    --ink: #e9efe9;
    --ink-soft: #a7b3ab;
    --racing: #7fceaa;
    --racing-deep: #0f3d2e;
    --racing-tint: #14251d;
    --accent: #d7ab5a;
    --accent-strong: #e6bd6f;
    --line: #2b332d;
    --line-soft: #222a24;
    --live: #6fd39c;
    --live-bg: #122c20;
    --check: #e0b862;
    --check-bg: #2c2413;
    --off: #e89a9a;
    --off-bg: #2e1a1a;
    --focus: #7fb6ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 26px rgba(0,0,0,.4);
  }
}
:root[data-theme="light"] {
  --paper:#f5f7f4;--surface:#fff;--ink:#1a1f1c;--ink-soft:#47514b;--racing:#0f3d2e;--racing-tint:#e6efe9;
  --accent:#9c6f1f;--accent-strong:#7d5714;--line:#d5ddd6;--line-soft:#e6ebe6;
  --live:#146c43;--live-bg:#e2f2e9;--check:#8a5a00;--check-bg:#f6ecd6;--off:#7a2b2b;--off-bg:#f4e2e2;
}
:root[data-theme="dark"] {
  --paper:#0d100e;--surface:#161b17;--ink:#e9efe9;--ink-soft:#a7b3ab;--racing:#7fceaa;--racing-tint:#14251d;
  --accent:#d7ab5a;--accent-strong:#e6bd6f;--line:#2b332d;--line-soft:#222a24;
  --live:#6fd39c;--live-bg:#122c20;--check:#e0b862;--check-bg:#2c2413;--off:#e89a9a;--off-bg:#2e1a1a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.02rem;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0 0 .6rem; }
h3 { font-size: 1.15rem; margin: 1.2rem 0 .4rem; }
p { margin: 0 0 1rem; }
a { color: var(--racing); text-decoration-thickness: .08em; text-underline-offset: .15em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .92em; }

.gj-visually-hidden, .gj-skip:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.gj-skip {
  position: absolute; left: 1rem; top: .6rem; z-index: 50;
  background: var(--racing); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}

/* ---------- Masthead / nav ---------- */
.gj-masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.gj-masthead__inner {
  max-width: var(--maxw); margin: 0 auto; padding: .7rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.gj-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--racing); font-weight: 700; }
.gj-brand__name { font-size: 1.05rem; letter-spacing: -.01em; color: var(--ink); }
.gj-brand__mark { color: var(--racing); display: inline-flex; }
.gj-nav__list { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; flex-wrap: wrap; }
.gj-nav__list a {
  display: inline-block; padding: .4rem .6rem; border-radius: 8px; text-decoration: none;
  color: var(--ink-soft); font-size: .95rem;
}
.gj-nav__list a:hover { background: var(--racing-tint); color: var(--ink); }
.gj-nav__list a[aria-current="page"] { color: var(--racing); font-weight: 600; background: var(--racing-tint); }
.gj-nav__toggle {
  display: none; font: inherit; font-weight: 600; color: var(--ink);
  background: var(--racing-tint); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; cursor: pointer;
}

@media (max-width: 760px) {
  .gj-nav__toggle { display: inline-block; }
  .gj-nav__list {
    display: none; position: absolute; right: 1rem; left: 1rem; top: 100%;
    flex-direction: column; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .5rem; box-shadow: var(--shadow); gap: .1rem;
  }
  .gj-nav__list.is-open { display: flex; }
  .gj-nav { position: static; }
  .gj-masthead__inner { position: relative; }
}

/* ---------- Main / layout ---------- */
.gj-main { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.1rem 3rem; }
.gj-lede { margin: .6rem 0 1.4rem; }
.gj-lede__sub { font-size: 1.12rem; color: var(--ink-soft); max-width: 46rem; }

.gj-crumbs { font-size: .85rem; margin: .3rem 0 1rem; color: var(--ink-soft); }
.gj-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.gj-crumbs li:not(:last-child)::after { content: "›"; margin-left: .35rem; color: var(--line); }
.gj-crumbs a { color: var(--ink-soft); }

/* ---------- The vertical timeline / rail ---------- */
.gj-rail { list-style: none; margin: 1.2rem 0 2rem; padding: 0; position: relative; }
.gj-milestone {
  position: relative; padding: 0 0 1.6rem 3.6rem; margin: 0;
}
.gj-milestone::before {
  /* the connecting line */
  content: ""; position: absolute; left: 1.15rem; top: .4rem; bottom: -0.4rem; width: 2px;
  background: linear-gradient(var(--line), var(--line));
}
.gj-milestone:last-child::before { display: none; }
.gj-marker {
  position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface);
  border: 2px solid var(--racing); color: var(--racing); font-weight: 700; z-index: 1;
  box-shadow: 0 0 0 4px var(--paper);
}
.gj-marker--code { border-color: var(--accent); color: var(--accent-strong); background: var(--racing-tint); }
.gj-marker__num { font-size: 1.05rem; }
.gj-marker__glyph { font-size: 1rem; }
.gj-milestone__title { margin-top: .25rem; }

/* ---------- Code node (the first milestone token) ---------- */
.gj-codenode {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin: 0 0 1rem;
  border-left: 4px solid var(--accent);
}
.gj-codenode__label { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.gj-codenode__slot {
  /* fixed dimensions => zero CLS when the code rotates client-side */
  min-height: 3.2rem; display: flex; align-items: center;
  background: var(--racing-tint); border: 1px dashed var(--racing);
  border-radius: 10px; padding: .5rem .9rem; overflow: hidden;
}
.gj-codetext {
  font-family: var(--mono); font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 600;
  color: var(--racing); letter-spacing: .02em; word-break: break-all; line-height: 1.2;
}
.gj-codenode__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.gj-copy, .gj-openlink {
  font: inherit; font-weight: 600; border-radius: 10px; padding: .7rem 1.1rem;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2.9rem; border: 2px solid transparent;
}
.gj-copy { background: var(--racing); color: #fff; border-color: var(--racing); }
.gj-copy:hover { background: var(--racing-deep); color: #fff; }
.gj-copy.is-copied { background: var(--live-bg); color: var(--live); border-color: var(--live); }
.gj-openlink { background: transparent; color: var(--racing); border-color: var(--racing); }
.gj-openlink:hover { background: var(--racing-tint); }
.gj-openlink__ext { font-size: .9em; }
.gj-codenode__hint { margin: .7rem 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Content panels ---------- */
.gj-panel, .gj-article {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; margin: 0 0 1.2rem; box-shadow: var(--shadow);
}
.gj-article { max-width: 48rem; }
.gj-article h2 { margin-top: 1.6rem; padding-top: .3rem; }
.gj-article h2:first-of-type { margin-top: .8rem; }

.gj-beacon {
  display: inline-block; font-size: .85rem; color: var(--racing);
  background: var(--racing-tint); border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .8rem; margin: 0 0 1rem;
}

/* ---------- Ledger (benefit table) ---------- */
.gj-ledger { overflow-x: auto; margin: 1rem 0 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); }
.gj-ledger table { width: 100%; border-collapse: collapse; min-width: 32rem; }
.gj-ledger caption { text-align: left; }
.gj-ledger th, .gj-ledger td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.gj-ledger thead th { background: var(--racing-tint); color: var(--ink); font-size: .9rem; }
.gj-ledger tbody th { font-weight: 600; color: var(--ink); }
.gj-ledger tr:last-child td, .gj-ledger tr:last-child th { border-bottom: none; }
.gj-tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.gj-tag--live { background: var(--live-bg); color: var(--live); }
.gj-tag--check { background: var(--check-bg); color: var(--check); }
.gj-tag--off { background: var(--off-bg); color: var(--off); }

/* ---------- Value maths ---------- */
.gj-maths { background: var(--racing-tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1rem 0; }
.gj-maths h3 { margin-top: 0; }
.gj-maths__steps { margin: .5rem 0; padding-left: 1.2rem; }
.gj-maths__steps li { margin: .3rem 0; }
.gj-maths__note { margin-bottom: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.gj-faq { display: grid; gap: .6rem; margin: 1rem 0; }
.gj-faq__item { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.gj-faq__item summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; list-style: none; }
.gj-faq__item summary::-webkit-details-marker { display: none; }
.gj-faq__item summary::after { content: "+"; float: right; color: var(--accent-strong); font-weight: 700; }
.gj-faq__item[open] summary::after { content: "–"; }
.gj-faq__a { padding: 0 1rem .3rem; }
.gj-faq__a p { margin: 0 0 .8rem; }

/* ---------- Figure / mock ---------- */
.gj-figure { margin: 1.2rem 0; }
.gj-mock { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.gj-mock__bar { height: .5rem; background: var(--racing); }
.gj-mock__rows { list-style: none; margin: 0; padding: .5rem 0; }
.gj-mock__rows li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line-soft); font-size: .95rem; }
.gj-mock__rows li:last-child { border-bottom: none; }
.gj-mock__hl { background: var(--live-bg); color: var(--live); font-weight: 600; }
.gj-figure figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: .5rem; }
.gj-figure--photo img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.gj-figure__credit { display: block; margin-top: .2rem; }
.gj-figure__credit a { color: inherit; }

/* ---------- News badge (on cards + post meta) ---------- */
.gj-newsbadge {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--racing); background: var(--racing-tint);
  border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem; margin-right: .5rem;
}

/* ---------- Lists / misc ---------- */
.gj-checklist { padding-left: 1.2rem; }
.gj-checklist li { margin: .35rem 0; }
.gj-sources { padding-left: 1.2rem; font-size: .92rem; }
.gj-sources li { margin: .25rem 0; }
.gj-cta-row { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: 1.2rem; }
.gj-textcta { font-weight: 600; }
.gj-flag { font-size: .88rem; color: var(--check); background: var(--check-bg); border-radius: 8px; padding: .5rem .8rem; }

/* ---------- Blog ---------- */
.gj-postgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.gj-postcard a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.gj-postcard a:hover { border-color: var(--racing); }
.gj-postcard h2 { font-size: 1.15rem; color: var(--racing); }
.gj-postcard p { color: var(--ink-soft); margin-bottom: .5rem; }
.gj-postcard__meta { font-size: .82rem; }
.gj-post__meta { font-size: .9rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.gj-post__links { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: .8rem 0; margin: 1.4rem 0; font-size: .95rem; }
.gj-post .gj-codenode { margin-top: 1.4rem; }

/* ---------- Footer ---------- */
.gj-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.gj-footer__grid { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.1rem 1rem; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.gj-footer__h { font-size: .95rem; margin: 0 0 .5rem; }
.gj-footer__col ul { list-style: none; margin: 0; padding: 0; }
.gj-footer__col li { margin: .3rem 0; }
.gj-footer__col a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
.gj-footer__col a:hover { color: var(--racing); text-decoration: underline; }
.gj-footer__brand { font-weight: 700; color: var(--racing); margin-bottom: .4rem; }
.gj-footer__by { font-size: .9rem; color: var(--ink-soft); }
.gj-note { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.1rem 2rem; font-size: .85rem; color: var(--ink-soft); border-top: 1px solid var(--line-soft); }
.gj-note p { margin: 0 0 .7rem; }
.gj-footer__legal { color: var(--ink-soft); }

/* ---------- Wizard progress rail (dedicated step pages) ---------- */
.gj-wizard { margin: .2rem 0 1.4rem; }
.gj-wizard__list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.gj-wizard__step { flex: 1 1 8rem; }
.gj-wizard__step a {
  display: flex; align-items: center; gap: .5rem; text-decoration: none;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft); font-weight: 600; font-size: .92rem;
}
.gj-wizard__step a:hover { border-color: var(--racing); }
.gj-wizard__label { white-space: nowrap; }
.gj-wizard__badge {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); font-size: .85rem; flex: none;
}
.gj-wizard__step--done a { border-color: var(--live); color: var(--live); }
.gj-wizard__step--done .gj-wizard__badge { background: var(--live-bg); border-color: var(--live); color: var(--live); }
.gj-wizard__step--current a { border-color: var(--racing); color: var(--racing); background: var(--racing-tint); }
.gj-wizard__step--current .gj-wizard__badge { background: var(--racing); border-color: var(--racing); color: #fff; }

/* ---------- Step prev/next navigation ---------- */
.gj-stepnav {
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between;
  margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft);
}
.gj-stepnav__prev, .gj-stepnav__next {
  flex: 1 1 12rem; display: inline-flex; flex-direction: column; gap: .1rem;
  text-decoration: none; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface);
}
.gj-stepnav__prev { align-items: flex-start; }
.gj-stepnav__next { align-items: flex-end; text-align: right; }
.gj-stepnav__prev:hover, .gj-stepnav__next:hover { border-color: var(--racing); }
.gj-stepnav__next--done { background: var(--racing-tint); border-color: var(--racing); }
.gj-stepnav__dir { font-size: .8rem; color: var(--ink-soft); }
.gj-stepnav__ttl { font-weight: 600; color: var(--racing); }

/* ---------- Expandable step disclosure (homepage journey) ---------- */
.gj-disclose { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin: .8rem 0; }
.gj-disclose__summary { cursor: pointer; padding: .7rem .9rem; font-weight: 600; color: var(--racing); list-style: none; }
.gj-disclose__summary::-webkit-details-marker { display: none; }
.gj-disclose__summary::after { content: "+"; float: right; color: var(--accent-strong); font-weight: 700; }
.gj-disclose[open] .gj-disclose__summary::after { content: "–"; }
.gj-disclose__body { padding: 0 .9rem; }
.gj-disclose__body p { margin: 0 0 .8rem; }

/* ---------- Inline UK-benefit note (homepage step 3) ---------- */
.gj-inlinebenefit {
  background: var(--racing-tint); border: 1px solid var(--line);
  border-left: 4px solid var(--racing); border-radius: 10px; padding: .9rem 1.1rem; margin: 1rem 0;
}
.gj-inlinebenefit__lead { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.gj-inlinebenefit ul { margin: 0; padding-left: 1.1rem; }
.gj-inlinebenefit li { margin: .25rem 0; }
.gj-inlinebenefit__note { margin: .6rem 0 0; font-size: .85rem; color: var(--ink-soft); }

.gj-steplink { font-weight: 600; margin-top: .8rem; }

/* ---------- HowTo sub-step rail (nested inside Step 2) ---------- */
.gj-rail--howto { margin: 1rem 0 1.4rem; }
.gj-rail--howto .gj-milestone__title { font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
