/* ============================================================
   FOUNDRY — FieldForge product skin (rose #F43F5E)
   Loads after foundry.css. Two jobs:
   1) Retint the suite "violet light source" to the product accent so the
      whole page reads as FieldForge (ambient glow, buttons, accents).
   2) Product-landing components + the GraphQL console + schema signature.
   ============================================================ */

/* ---- 1. Accent skin ---------------------------------------- */
body.foundry {
  --fdry-violet:    #F43F5E;   /* product accent: rose */
  --fdry-violet-lt: #FB7185;   /* lighter rose */
  --fdry-acc:       #F43F5E;
  --fdry-bg:        #0E0608;   /* near-black with a rose undertone */
  --fdry-bg-2:      #1A0A10;
}

/* Ambient light retint */
body.foundry::before {
  background:
    radial-gradient(135% 85% at 62% -6%, rgba(244,63,94,.24), transparent 60%),
    radial-gradient(95% 65% at 4% 0%,    rgba(251,113,133,.10), transparent 58%),
    linear-gradient(180deg, var(--fdry-bg) 0%, var(--fdry-bg-2) 40%, var(--fdry-bg) 100%);
}

.foundry .fdry-grad {
  background: linear-gradient(92deg, var(--fdry-violet-lt), #fff 58%, var(--fdry-violet-lt));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.foundry .fdry-quote__av {
  background: linear-gradient(135deg, var(--fdry-violet), #9b1535);
}

/* ---- 2. Hero art shell ------------------------------------- */
.foundry .fdry-hero__art { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }

/* ---- 3. GraphQL console panel ------------------------------ */
.foundry .gf-console {
  width: 100%;
  max-width: 520px;
  padding: 0;
  border-radius: var(--fdry-r-lg);
  overflow: hidden;
}
.foundry .gf-console__top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.foundry .gf-console__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
}
.foundry .gf-console__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--fdry-ink-faint);
  margin-left: 6px;
}
.foundry .gf-console__live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fdry-violet-lt);
}
.foundry .gf-console__live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fdry-violet-lt);
  box-shadow: 0 0 10px var(--fdry-violet-lt);
  animation: gf-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes gf-pulse {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50%       { opacity: 1;  transform: scale(1.2); }
}

.foundry .gf-console__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 210px;
}
.foundry .gf-console__pane {
  padding: 18px 20px;
}
.foundry .gf-console__pane--query {
  border-right: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.18);
}
.foundry .gf-console__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fdry-ink-faint);
  margin-bottom: 10px;
}

/* Code/JSON shared */
.foundry .gf-code,
.foundry .gf-json {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  line-height: 1.65;
  margin: 0;
  word-break: break-word;
}
.foundry .gf-code { color: var(--fdry-ink); white-space: pre-wrap; }
/* The query side is one <pre> (pre-wrap is right). The response side is a stack
   of .gf-json__line DIVs, so the wrapper must be `normal` — otherwise the source
   newlines/indentation BETWEEN the divs render as blank lines (huge row gaps).
   Each line keeps its own white-space:pre + &nbsp; indentation. */
.foundry .gf-json { white-space: normal; }

/* Syntax tokens */
.foundry .gf-tok--kw     { color: var(--fdry-violet-lt); font-weight: 600; }
.foundry .gf-tok--fn     { color: #c3e4ff; }
.foundry .gf-tok--arg    { color: #ffd68a; }
.foundry .gf-tok--num    { color: #ffa07a; }
.foundry .gf-tok--field  { color: var(--fdry-ink-soft); }
.foundry .gf-tok--key    { color: var(--fdry-violet-lt); }
.foundry .gf-tok--str    { color: #a8e6a3; }

/* JSON lines — fade in per line via JS */
.foundry .gf-json__line {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .22s ease, transform .22s ease;
  white-space: pre;
}
.foundry .gf-json__line.is-visible {
  opacity: 1;
  transform: none;
}

/* Field type chips under console */
.foundry .gf-field-types {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 500px;
}
.foundry .gf-field-types span {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  padding: 5px 11px;
  border-radius: 100px;
  color: var(--fdry-ink-faint);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--fdry-glass-border);
  transition: color .3s ease, background .3s ease, border-color .3s ease, transform .3s ease;
}
.foundry .gf-field-types span.is-active {
  color: var(--fdry-bg);
  background: var(--fdry-violet-lt);
  border-color: var(--fdry-violet-lt);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(244,63,94,.4);
}

/* ============================================================
   HERO — visual field-group builder (the core product story:
   build typed custom fields visually). Field rows assemble one
   by one; the matching palette chip lights as each is added.
   ============================================================ */
.foundry .gf-builder {
  width: 100%; max-width: 480px; padding: 0;
  border-radius: var(--fdry-r-lg); overflow: hidden;
  box-shadow: 0 0 60px color-mix(in srgb, var(--fdry-violet) 14%, transparent), var(--fdry-shadow);
}
.foundry .gf-builder__top { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.foundry .gf-builder__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); }
.foundry .gf-builder__title { font-family: 'JetBrains Mono', monospace; font-size: .875rem; letter-spacing: .04em; color: var(--fdry-ink-soft); margin-left: 6px; }
.foundry .gf-builder__save { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: 'JetBrains Mono', monospace; font-size: .875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fdry-ink-faint); opacity: .5; transition: opacity .4s ease, color .4s ease; }
.foundry .gf-builder__save i { width: 7px; height: 7px; border-radius: 50%; background: var(--fdry-ink-faint); transition: background .4s ease, box-shadow .4s ease; }
.foundry .gf-builder__save.is-on { opacity: 1; color: #34D399; }
.foundry .gf-builder__save.is-on i { background: #34D399; box-shadow: 0 0 10px #34D399; }

.foundry .gf-builder__palette { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.foundry .gf-builder__palette span { font-family: 'JetBrains Mono', monospace; font-size: .875rem; padding: 4px 10px; border-radius: 100px; color: var(--fdry-ink-faint); background: rgba(255,255,255,.035); border: 1px solid var(--fdry-glass-border); transition: color .3s ease, background .3s ease, border-color .3s ease, transform .3s ease, box-shadow .3s ease; }
.foundry .gf-builder__palette span.is-active { color: #fff; background: color-mix(in srgb, var(--fdry-violet) 24%, transparent); border-color: color-mix(in srgb, var(--fdry-violet) 60%, transparent); transform: translateY(-2px); box-shadow: 0 6px 18px color-mix(in srgb, var(--fdry-violet) 40%, transparent); }

.foundry .gf-builder__rows { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 300px; }
.foundry .gf-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 11px; background: rgba(255,255,255,.03); border: 1px solid var(--fdry-glass-border);
  opacity: 0; transform: translateY(10px) scale(.99);
  transition: opacity .45s var(--fdry-ease), transform .45s var(--fdry-ease);
}
.foundry .gf-row.is-in { opacity: 1; transform: none; }
.foundry .gf-row__type { flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: .875rem; padding: 3px 9px; border-radius: 7px; color: var(--fdry-violet-lt); background: color-mix(in srgb, var(--fdry-violet) 13%, transparent); border: 1px solid color-mix(in srgb, var(--fdry-violet) 30%, transparent); }
.foundry .gf-row__label { flex: 0 0 auto; min-width: 84px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .95rem; color: #fff; }
.foundry .gf-row__field { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: 'JetBrains Mono', monospace; font-size: .875rem; color: var(--fdry-ink-soft); white-space: nowrap; }
.foundry .gf-row__muted { color: var(--fdry-ink-faint); }
.foundry .gf-row__caret { display: inline-block; width: 2px; height: 1em; vertical-align: -.12em; background: var(--fdry-violet-lt); animation: gfBuildCaret 1s steps(2) infinite; }
@keyframes gfBuildCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.foundry .gf-row__thumb { width: 22px; height: 18px; border-radius: 4px; background: linear-gradient(135deg, var(--fdry-violet), var(--fdry-violet-lt)); }
.foundry .gf-row__field--sel { padding: 3px 10px; border-radius: 7px; background: rgba(255,255,255,.05); border: 1px solid var(--fdry-glass-border); }
.foundry .gf-row__bar { display: inline-block; width: 13px; height: 5px; border-radius: 2px; background: color-mix(in srgb, var(--fdry-violet) 45%, transparent); }
.foundry .gf-row__chip { padding: 2px 9px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--fdry-glass-border); color: var(--fdry-ink-soft); font-size: .875rem; }

/* "Query anywhere" section — relocated GraphQL console + field-type palette */
.foundry .gf-query__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.foundry .gf-query__copy .fdry-kicker { margin-bottom: 16px; }
.foundry .gf-query__copy .fdry-lead { margin: 16px 0 0; }
.foundry .gf-query__copy .gf-field-types { justify-content: flex-start; margin-top: 24px; max-width: none; }
.foundry .gf-query__art .gf-console { max-width: 100%; }
@media (max-width: 900px) {
  .foundry .gf-query__grid { grid-template-columns: 1fr; gap: 32px; }
  .foundry .gf-query__copy .gf-field-types { justify-content: center; }
}
@media (max-width: 760px) {
  .foundry .gf-builder { max-width: 100%; }
  .foundry .gf-builder__rows { min-height: 0; }
  .foundry .gf-row { flex-wrap: wrap; gap: 8px; }
  .foundry .gf-row__field { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .foundry .gf-row { opacity: 1 !important; transform: none !important; transition: none !important; }
  .foundry .gf-row__caret { animation: none !important; }
}

/* ---- 4. Schema signature section --------------------------- */
.foundry .gf-schema {
  text-align: center;
}
.foundry .gf-schema__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 16px 0 clamp(40px, 7vw, 80px); /* small top; nav clearance lives on the section */
}

/* Graph container */
.foundry .gf-schema__graph {
  position: relative;
  width: min(540px, 90vw);
  height: 340px;
}

/* SVG connector lines */
.foundry .gf-schema__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;            /* wires sit BEHIND the nodes so they don't cross the boxes */
}
.foundry .gf-schema__line {
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0;
  stroke-dasharray: 240;   /* >= longest line (~203u) so it fully draws */
  stroke-dashoffset: 240;
  transition: opacity .3s ease, stroke-dashoffset .5s ease;
}
.foundry .gf-schema__line.is-drawn {
  opacity: 1;
  stroke-dashoffset: 0;
}

/* Central Post node */
.foundry .gf-schema__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fdry-violet) 22%, #1a0810);
  border: 2px solid var(--fdry-violet);
  box-shadow: 0 0 28px rgba(244,63,94,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.foundry .gf-schema__center-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
}

/* Field nodes — positioned via CSS, lit up by JS */
.foundry .gf-schema__node {
  position: absolute;
  padding: 8px 14px;
  border-radius: 10px;
  background: #1a0c12;   /* opaque so the wire end is hidden behind the box (clean join) */
  border: 1px solid var(--fdry-glass-border);
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-soft);
  white-space: nowrap;
  opacity: 0;
  /* All nodes are positioned by their CENTRE (left/top %) and pulled back by
     translate(-50%,-50%) so labels of any width sit exactly on the pentagon
     point — keeps the radial layout even regardless of label length. */
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .4s ease, transform .4s ease, border-color .4s ease, color .4s ease, box-shadow .4s ease;
  z-index: 2;
  pointer-events: none;
}
.foundry .gf-schema__node.is-lit {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  border-color: color-mix(in srgb, var(--fdry-violet) 55%, transparent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244,63,94,.25);
}

/* Node positions — evenly spaced on a 72° pentagon (point-up, left/right
   symmetric) around the centre of the 540×340 graph box. Coordinates are the
   node CENTRES as % of the box; translate(-50%,-50%) (above) does the rest. */
/* 72° pentagon on a gentle ellipse (rx 180 / ry 135 around centre 270,170);
   radii stay within ~1.3x of each other so the layout reads as even, and the
   top node sits far enough out that its connector reads clearly. */
.foundry .gf-schema__node--text     { left: 50%;    top: 10.3%; } /*   0° top   */
.foundry .gf-schema__node--repeater { left: 81.7%;  top: 37.7%; } /*  72° up-R  */
.foundry .gf-schema__node--gql      { left: 69.6%;  top: 82.1%; } /* 144° low-R */
.foundry .gf-schema__node--rel      { left: 30.4%;  top: 82.1%; } /* 216° low-L */
.foundry .gf-schema__node--number   { left: 18.3%;  top: 37.7%; } /* 288° up-L  */

/* Progress bar */
.foundry .gf-schema__bar-wrap {
  width: min(400px, 70vw);
}
.foundry .gf-schema__bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  width: 100%;
}
.foundry .gf-schema__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt));
  box-shadow: 0 0 14px var(--fdry-violet);
  transition: width .05s linear;
}

.foundry .gf-schema__sub {
  max-width: 52ch;
  color: var(--fdry-ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  margin: 0;
}

/* ---- 5. Highlight band ------------------------------------- */
.foundry .gf-highlight { text-align: left; }
.foundry .gf-highlight .fdry-cta__in { text-align: left; }
.foundry .gf-highlight__list { display: grid; gap: 12px; margin: 24px 0 0; }
.foundry .gf-highlight__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--fdry-glass-border);
  color: var(--fdry-ink);
}
.foundry .gf-highlight__badge svg { width: 18px; height: 18px; color: var(--fdry-violet-lt); }

/* ---- 6. Comparison table (dark glass) ---------------------- */
.foundry .fdry-cmp { max-width: 900px; margin: 0 auto; background: var(--fdry-glass); border: 1px solid var(--fdry-glass-border); border-radius: var(--fdry-r-lg); overflow: hidden; box-shadow: var(--fdry-shadow); }
.foundry .fdry-cmp table { width: 100%; border-collapse: collapse; }
.foundry .fdry-cmp th, .foundry .fdry-cmp td { padding: 16px 22px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.07); }
.foundry .fdry-cmp thead th { font-family: 'JetBrains Mono',monospace; font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fdry-ink-soft); font-weight: 500; }
.foundry .fdry-cmp thead th.is-us { color: #fff; }
.foundry .fdry-cmp td:first-child { color: var(--fdry-ink); }
.foundry .fdry-cmp .is-us { background: color-mix(in srgb, var(--fdry-violet) 16%, transparent); text-align: center; }
.foundry .fdry-cmp td.is-us { color: #fff; font-weight: 600; }
.foundry .fdry-cmp td:not(:first-child) { text-align: center; }
.foundry .fdry-cmp td.yes { color: var(--fdry-violet-lt); }
.foundry .fdry-cmp td.no  { color: var(--fdry-ink-faint); }
.foundry .fdry-cmp tr:last-child th, .foundry .fdry-cmp tr:last-child td { border-bottom: 0; }

/* ---- 7. Switching cards ------------------------------------ */
.foundry .fdry-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.foundry .fdry-switch__card { padding: clamp(26px,3vw,38px); background: var(--fdry-glass); border: 1px solid var(--fdry-glass-border); border-radius: var(--fdry-r); position: relative; overflow: hidden; transition: transform .5s var(--fdry-ease), border-color .4s ease; }
.foundry .fdry-switch__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--fdry-glass-edge), transparent); }
.foundry .fdry-switch__card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--fdry-violet) 45%, transparent); }
.foundry .fdry-switch__card p { color: var(--fdry-ink-soft); line-height: 1.6; margin-top: 10px; }
.foundry .fdry-switch__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--fdry-violet-lt); font-weight: 600; font-size: .94rem; }
.foundry .fdry-switch__link svg { width: 17px; height: 17px; transition: transform .3s var(--fdry-ease); }
.foundry .fdry-switch__card:hover .fdry-switch__link svg { transform: translateX(4px); }

/* ---- 8. Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .foundry .fdry-hero__art { max-width: 540px; margin: 8px auto 0; }
  .foundry .gf-console { max-width: 100%; }
}
@media (max-width: 760px) {
  .foundry .gf-console__body { grid-template-columns: 1fr; }
  .foundry .gf-console__pane--query { border-right: none; border-bottom: 1px solid rgba(255,255,255,.07); }
  .foundry .gf-code, .foundry .gf-json { font-size: .875rem; }
  /* The radial node graph can't fit a phone — reflow it to a clean vertical
     stack (Post on top, field nodes below) and drop the SVG wires. The
     opacity reveal still carries the build-in animation. The body.foundry +
     .gf-schema prefix lifts specificity so it also beats the reduced-motion
     overrides below. */
  body.foundry .gf-schema .gf-schema__graph { position: static; width: 100%; height: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
  body.foundry .gf-schema .gf-schema__svg { display: none; }
  body.foundry .gf-schema .gf-schema__center { position: static; transform: none !important; margin-bottom: 4px; }
  body.foundry .gf-schema .gf-schema__node,
  body.foundry .gf-schema .gf-schema__node--text,
  body.foundry .gf-schema .gf-schema__node.is-lit,
  body.foundry .gf-schema .gf-schema__node--text.is-lit { position: static !important; top: auto; left: auto; right: auto; bottom: auto; transform: none !important; font-size: .875rem; padding: 8px 14px;
    /* Always show the full stack on a phone (no scrub here) — the JS reveal
       loop only pulses the box-shadow; nodes never flash blank on reset. */
    opacity: 1 !important; color: #fff; border-color: color-mix(in srgb, var(--fdry-violet) 55%, transparent); }
  .foundry .fdry-cmp { overflow-x: auto; }
}

/* ============================================================
   SCENE D1 — "Custom-table storage = speed"
   Performance race: two query bars scroll-scrubbed left→right
   at very different speeds; ms-counters tick up with progress.
   ============================================================ */
.foundry .gf-speed-scene {
  overflow: hidden;
}
.foundry .gf-speed__stage {
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
}
/* Race tracks */
.foundry .gf-speed__races {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 44px;
}
.foundry .gf-speed__race {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foundry .gf-speed__race-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.foundry .gf-speed__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--fdry-ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.foundry .gf-speed__label--ff {
  color: #fff;
}
.foundry .gf-speed__tag {
  font-size: .875rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--fdry-glass-border);
  color: var(--fdry-ink-faint);
}
.foundry .gf-speed__tag--ff {
  background: color-mix(in srgb, var(--fdry-violet) 18%, transparent);
  border-color: color-mix(in srgb, var(--fdry-violet) 50%, transparent);
  color: var(--fdry-violet-lt);
}
.foundry .gf-speed__ms {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--fdry-ink-faint);
  min-width: 70px;
  text-align: right;
  white-space: nowrap;
}
.foundry .gf-speed__ms--ff {
  color: var(--fdry-violet-lt);
  text-shadow: 0 0 14px color-mix(in srgb, var(--fdry-violet) 60%, transparent);
}
/* Bar track */
.foundry .gf-speed__track {
  height: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
  position: relative;
}
.foundry .gf-speed__fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  transition: width .04s linear;
  position: relative;
}
.foundry .gf-speed__fill--ff {
  background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt));
  box-shadow: 0 0 16px color-mix(in srgb, var(--fdry-violet) 55%, transparent);
}
/* Payoff chip — hidden until JS reveals it */
.foundry .gf-speed__payoff {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  opacity: 0;
  transform: translateY(10px) scale(.94);
  transition: opacity .5s var(--fdry-ease), transform .5s var(--fdry-ease);
}
.foundry .gf-speed__payoff.is-visible {
  opacity: 1;
  transform: none;
}
.foundry .gf-speed__chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: var(--fdry-r);
  background: color-mix(in srgb, var(--fdry-violet) 14%, var(--fdry-glass));
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 50%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--fdry-violet) 22%, transparent);
}
.foundry .gf-speed__chip-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.foundry .gf-speed__chip-label {
  font-size: .9375rem;
  color: var(--fdry-ink-soft);
  line-height: 1.35;
}
.foundry .gf-speed__chip-label strong {
  color: var(--fdry-violet-lt);
  font-weight: 700;
}

/* ============================================================
   SCENE D2 — "32 field types, one builder"
   A grid of field-type tiles that populates as the user scrolls.
   ============================================================ */
.foundry .gf-types-scene {
  overflow: hidden;
}
.foundry .gf-types__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 44px;
}
.foundry .gf-types__tile {
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--fdry-glass);
  border: 1px solid var(--fdry-glass-border);
  font-family: 'JetBrains Mono', monospace;
  font-size: .9375rem;
  color: var(--fdry-ink-soft);
  white-space: nowrap;
  /* initial hidden state for JS */
  opacity: 0;
  transform: translateY(12px) scale(.95);
  transition: opacity .35s var(--fdry-ease), transform .35s var(--fdry-ease),
              border-color .3s ease, color .3s ease, box-shadow .3s ease;
}
/* accent variant — every 4th tile and the first */
.foundry .gf-types__tile--accent {
  background: color-mix(in srgb, var(--fdry-violet) 12%, var(--fdry-glass));
  border-color: color-mix(in srgb, var(--fdry-violet) 40%, transparent);
  color: var(--fdry-violet-lt);
}
.foundry .gf-types__tile.is-in {
  opacity: 1;
  transform: none;
}
.foundry .gf-types__tile:hover {
  border-color: color-mix(in srgb, var(--fdry-violet) 55%, transparent);
  color: #fff;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--fdry-violet) 22%, transparent);
}
/* The "+32 types" emphasis pill */
.foundry .gf-types__more {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 28px;
  /* visible by default — JS hides then reveals with animation */
  opacity: 1;
}
.foundry .gf-types__more-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--fdry-r);
  background: color-mix(in srgb, var(--fdry-violet) 10%, var(--fdry-glass));
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 35%, transparent);
}
.foundry .gf-types__more-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.875rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.foundry .gf-types__more-text {
  font-size: .9375rem;
  color: var(--fdry-ink-soft);
}

/* ---- 9. Reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .foundry .gf-console__live i { animation: none !important; }
  /* Show all JSON lines in final state */
  .foundry .gf-json__line { opacity: 1 !important; transform: none !important; transition: none !important; }
  /* Show all nodes and lines in final state — keep the centring transform so
     the pentagon stays even (desktop). The mobile stack rule above has higher
     specificity and still wins on phones. */
  .foundry .gf-schema__node { opacity: 1 !important; transform: translate(-50%, -50%) !important; border-color: color-mix(in srgb, var(--fdry-violet) 55%, transparent) !important; color: #fff !important; }
  .foundry .gf-schema__line { opacity: 1 !important; stroke-dashoffset: 0 !important; transition: none !important; }
  .foundry .gf-schema__bar i { width: 100% !important; transition: none !important; }
  /* D1 speed scene */
  .foundry .gf-speed__fill { width: var(--gf-speed-final, 100%) !important; transition: none !important; }
  .foundry .gf-speed__payoff { opacity: 1 !important; transform: none !important; transition: none !important; }
  /* D2 types grid */
  .foundry .gf-types__tile { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Hold via CSS position:sticky (smooth, no pin jump). Section tall; shell
   sticks centred in the viewport while the JS scrubs the animation by scroll
   progress. Desktop only. ───────────────────────────────────────────────── */
@media (min-width: 1024px) {
  /* PROVEN: tall STATIC shell + sticky inner stage. Heading scrolls up; stage holds. */
  .foundry .gf-types-scene, .foundry .gf-speed-scene { padding-top: 0; padding-bottom: 0; overflow: visible; }
  .foundry .gf-types-scene > .fdry-shell, .foundry .gf-speed-scene > .fdry-shell { min-height: 170vh; overflow: visible; }
  .foundry .gf-types__hold, .foundry .gf-speed__stage {
    position: sticky; top: 0; min-height: 100vh;
    justify-content: center;            /* centre content vertically in viewport */
    padding-top: 120px;                 /* clear the fixed ~110px nav */
    padding-bottom: 52px;
  }
  /* gf-types: wrapper holds the tile grid + "+32" pill together, centred */
  .foundry .gf-types__hold { display: flex; flex-direction: column; align-items: center; gap: 28px; }
}
