/* ============================================================
   FOUNDRY — SEOForge product skin (orange #FF6B35)
   Loads after foundry.css. Two jobs:
   1) Retint the suite "violet light source" to the SEOForge accent so
      the whole page reads as SEOForge (ambient glow, buttons, accents).
   2) Product-landing components + the SEO signature (SERP climber hero +
      rank-counter scroll scene).
   ============================================================ */

/* ---- 1. Accent skin ---------------------------------------- */
body.foundry {
  --fdry-violet:    #FF6B35;   /* SEOForge accent becomes the light source */
  --fdry-violet-lt: #FF8F66;
  --fdry-acc:       #FF6B35;
  --fdry-bg:        #100A06;   /* near-black with a warm orange undertone */
  --fdry-bg-2:      #1A120A;
}
/* Ambient light retint — warm orange glow */
body.foundry::before {
  background:
    radial-gradient(135% 85% at 62% -6%, rgba(255,107,53,.24), transparent 60%),
    radial-gradient(95% 65% at 4% 0%, rgba(255,143,102,.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), #c43e15); }

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

/* SERP panel */
.foundry .se-serp {
  width: 100%;
  max-width: 480px;
  padding: 0;
  border-radius: var(--fdry-r-lg);
  overflow: hidden;
}

/* Top search bar row */
.foundry .se-serp__top {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.foundry .se-serp__searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 100px;
}
.foundry .se-serp__searchbar-q {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.foundry .se-serp__searchbar-icon { color: var(--fdry-ink-faint); flex: 0 0 auto; }
.foundry .se-serp__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  padding-left: 4px;
}

/* Results list */
.foundry .se-serp__list {
  list-style: none;
  padding: 4px 0 8px;
  margin: 0;
  position: relative;
  min-height: 320px; /* stable height during reorder */
}
.foundry .se-serp__row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 18px;
  transition: background .35s ease, transform .55s cubic-bezier(.16,1,.3,1);
  border-bottom: 1px solid rgba(255,255,255,.04);
  position: relative;
}
.foundry .se-serp__row:last-child { border-bottom: 0; }

/* "Your page" row highlight */
.foundry .se-serp__row--you {
  background: rgba(255,107,53,.06);
  border-color: rgba(255,107,53,.14);
}
.foundry .se-serp__row--you.is-top {
  background: rgba(255,107,53,.14);
  box-shadow: 0 0 0 1px rgba(255,107,53,.32) inset;
}

/* Favicon dot */
.foundry .se-serp__favicon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255,255,255,.10);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.foundry .se-serp__favicon--you {
  background: linear-gradient(135deg, var(--fdry-violet), #c43e15);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .875rem;
  font-weight: 700;
}

/* Result text lines */
.foundry .se-serp__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.foundry .se-serp__title {
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.foundry .se-serp__url {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: rgba(134,239,172,.7); /* green url color like real SERP */
}
.foundry .se-serp__url--you { color: var(--fdry-violet-lt); }
.foundry .se-serp__snippet {
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Rank badge on "Your page" row */
.foundry .se-serp__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: var(--fdry-violet);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,107,53,.5);
  transition: background .3s ease;
}
.foundry .se-serp__row--you.is-top .se-serp__badge {
  background: linear-gradient(135deg, #FFD700, var(--fdry-violet-lt));
  box-shadow: 0 3px 14px rgba(255,215,0,.4);
}

/* Up arrow indicator */
.foundry .se-serp__arrow {
  flex: 0 0 auto;
  color: var(--fdry-violet-lt);
  font-size: .875rem;
  margin-top: 4px;
  animation: se-bob 1.6s ease-in-out infinite;
}
@keyframes se-bob { 0%,100% { transform: translateY(0); opacity:.7; } 50% { transform: translateY(-4px); opacity:1; } }

/* ---- 3. Scroll signature — rank counter scene -------------- */
.foundry .se-climb { text-align: center; }
.foundry .se-climb__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px 0 clamp(30px, 6vw, 70px); /* small top; nav clearance lives on the section */
}

/* Giant rank number */
.foundry .se-climb__num-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  line-height: 1;
}
.foundry .se-climb__hash {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 8vw, 5.5rem);
  color: var(--fdry-violet-lt);
  opacity: .6;
  margin-top: .12em;
}
.foundry .se-climb__num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(5rem, 19vw, 13rem);
  line-height: 1.08;            /* >=1 so background-clip:text doesn't crop the glyph top/bottom */
  /* Right padding widens the gradient paint box past the glyph's right edge —
     otherwise background-clip:text leaves the right of the digit transparent
     (looked "cut off"). Near-zero letter-spacing keeps the box from shrinking
     narrower than the glyph. */
  padding: .06em .16em .06em 0;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff 20%, var(--fdry-violet-lt) 80%, var(--fdry-violet) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  will-change: opacity, transform;
  transition: opacity .2s ease, transform .2s ease;
}
.foundry .se-climb__num.is-swap { opacity: 0; transform: translateY(-18px) scale(.94); }

/* Progress bar */
.foundry .se-climb__bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, 80vw);
}
.foundry .se-climb__bar {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}
.foundry .se-climb__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt), #FFD700);
  box-shadow: 0 0 20px var(--fdry-violet);
  transition: width .15s ease;
}
.foundry .se-climb__bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fdry-ink-faint);
}
.foundry .se-climb__sub {
  max-width: 52ch;
  color: var(--fdry-ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  margin: 0;
}

/* ---- 4. Highlight band (se- prefixed) ---------------------- */
.foundry .se-highlight { text-align: left; }
.foundry .se-highlight .fdry-cta__in { text-align: left; }
.foundry .se-highlight__list { display: grid; gap: 12px; margin: 24px 0 0; }
.foundry .se-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 .se-highlight__badge svg { width: 18px; height: 18px; color: var(--fdry-violet-lt); }

/* ---- 5. Comparison table (dark glass) — verbatim from LangForge */
.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; }

/* ---- 6. Switching cards — verbatim from LangForge ---------- */
.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); }

/* ---- 7. Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .foundry .fdry-hero__art { max-width: 520px; margin: 8px auto 0; }
  .foundry .se-serp { max-width: 100%; }
  /* Compact SERP list on tablet: no min-height so panel doesn't balloon */
  .foundry .se-serp__list { min-height: 0; }
}
@media (max-width: 760px) {
  .foundry .se-serp__top { padding: 10px 14px 8px; }
  .foundry .se-serp__row { padding: 8px 12px; gap: 8px; }
  .foundry .se-serp__snippet { display: none; }
  .foundry .se-serp__list { min-height: 0; }
  /* On mobile show only 3 rows to save space */
  .foundry .se-serp__row:nth-child(n+4):not([data-se-yours]) { display: none; }
  .foundry .se-climb__num { font-size: clamp(4.5rem, 28vw, 9rem); }
  .foundry .fdry-cmp { overflow-x: auto; }
  /* Compact hero on mobile */
  .foundry .fdry-hero__meta { margin-top: 22px; padding-top: 18px; gap: 14px; }
  .foundry .fdry-hero__meta div { padding-left: 10px; }
  /* Stack CTA buttons full-width on mobile */
  .foundry .fdry-hero__cta { flex-direction: column; }
  .foundry .fdry-hero__cta .forge-btn { width: 100%; justify-content: center; }
}

/* ---- 8. SCENE S1 — On-page rewrite, live ------------------- */

/* Outer section / stage layout */
.foundry .se-rewrite { text-align: center; }
.foundry .se-rewrite__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-bottom: clamp(32px, 6vw, 72px);
}

/* Score gauge */
.foundry .se-rewrite__score-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 140px;
}
.foundry .se-rewrite__gauge {
  overflow: visible;
}
.foundry .se-rewrite__gauge-track {
  stroke: rgba(255,255,255,.10);
  stroke-linecap: round;
}
.foundry .se-rewrite__gauge-fill {
  stroke: var(--fdry-violet);
  stroke-linecap: round;
  stroke-dasharray: 172.79;          /* circumference of the arc: π × r = π × 55 */
  stroke-dashoffset: 172.79;         /* start fully hidden; JS drives this */
  filter: drop-shadow(0 0 8px var(--fdry-violet));
  transition: stroke-dashoffset .25s ease, stroke .25s ease;
}
.foundry .se-rewrite__score-num {
  margin-top: -4px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1;
}
.foundry .se-rewrite__score-num [data-se-score] {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #fff;
}
.foundry .se-rewrite__score-max {
  font-size: .875rem;
  color: var(--fdry-ink-faint);
}
.foundry .se-rewrite__score-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fdry-ink-faint);
}

/* Card */
.foundry .se-rewrite__card {
  width: min(700px, 100%);
  padding: clamp(20px, 3vw, 36px) clamp(18px, 3vw, 32px);
  border-radius: var(--fdry-r-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

/* Progress steps */
.foundry .se-rewrite__steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
}
.foundry .se-rewrite__step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  transition: color .3s ease;
}
.foundry .se-rewrite__step.is-active { color: var(--fdry-violet-lt); }
.foundry .se-rewrite__step.is-done { color: var(--fdry-violet); }
.foundry .se-rewrite__step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
  transition: background .3s ease, box-shadow .3s ease;
}
.foundry .se-rewrite__step.is-active .se-rewrite__step-dot {
  background: var(--fdry-violet-lt);
  box-shadow: 0 0 10px var(--fdry-violet);
}
.foundry .se-rewrite__step.is-done .se-rewrite__step-dot {
  background: var(--fdry-violet);
}
.foundry .se-rewrite__step-line {
  flex: 1;
  height: 1px;
  min-width: 24px;
  background: rgba(255,255,255,.12);
  margin: 0 8px;
}

/* Field rows */
.foundry .se-rewrite__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foundry .se-rewrite__field-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.foundry .se-rewrite__field-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--fdry-ink-faint);
}
.foundry .se-rewrite__field-chars {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  margin-left: auto;
}
/* Highlight when this field is active */
.foundry .se-rewrite__field.is-active .se-rewrite__field-tag {
  color: var(--fdry-violet-lt);
}
.foundry .se-rewrite__field.is-done .se-rewrite__field-tag {
  color: var(--fdry-violet);
}

/* Before / after version lines */
.foundry .se-rewrite__versions {
  position: relative;
  min-height: 1.6em;
}
.foundry .se-rewrite__before,
.foundry .se-rewrite__after {
  font-size: 1rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: var(--fdry-r);
  border: 1px solid rgba(255,255,255,.09);
  transition: opacity .4s ease, transform .4s ease;
}
.foundry .se-rewrite__before {
  color: var(--fdry-ink-soft);
  background: rgba(255,255,255,.03);
  /* "done" state: shown in default — JS will strike when active+done */
}
.foundry .se-rewrite__before.is-struck {
  text-decoration: line-through;
  color: var(--fdry-ink-faint);
}
.foundry .se-rewrite__after {
  color: #fff;
  background: color-mix(in srgb, var(--fdry-violet) 8%, transparent);
  border-color: color-mix(in srgb, var(--fdry-violet) 35%, transparent);
  /* Hidden by default — JS shows; non-JS: shown as final fallback via class se-rewrite--static */
  display: none;
}
/* Non-JS / static final state: show after, hide before */
.foundry .se-rewrite--static .se-rewrite__after { display: block; }
.foundry .se-rewrite--static .se-rewrite__before { display: none; }

/* Keyword highlights inside .after */
.foundry .se-rewrite__after .se-kw {
  background: color-mix(in srgb, var(--fdry-violet) 25%, transparent);
  color: var(--fdry-violet-lt);
  border-radius: 3px;
  padding: 1px 4px;
  font-style: normal;
}

/* AI done badge */
.foundry .se-rewrite__done {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: var(--fdry-r);
  background: color-mix(in srgb, var(--fdry-violet) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 40%, transparent);
  color: var(--fdry-violet-lt);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: .9375rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
  /* Non-JS: shown in final static state */
}
.foundry .se-rewrite__done.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.foundry .se-rewrite--static .se-rewrite__done {
  opacity: 1;
  transform: translateY(0);
}
.foundry .se-rewrite__done-spark {
  color: var(--fdry-violet-lt);
  animation: se-spark-pulse 2s ease-in-out infinite;
}
@keyframes se-spark-pulse {
  0%, 100% { opacity: .7; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

/* ---- 9. SCENE S2 — Rich results & AI Overview -------------- */

.foundry .se-rich { text-align: center; }
.foundry .se-rich__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-bottom: clamp(32px, 6vw, 72px);
}
/* se-rewrite + se-rich hold via CSS position:sticky (smooth, no pin jump/overlap).
   The shell is made tall so the sticky stage has room to hold; the heading
   scrolls up and away while the card stays put and its steps build on scrub. */
@media (min-width: 1024px) {
  .foundry .se-rewrite, .foundry .se-rich { padding-top: 0; padding-bottom: 0; }
  .foundry .se-rewrite > .fdry-shell, .foundry .se-rich > .fdry-shell { min-height: 170vh; }
  .foundry .se-rewrite .fdry-sechead, .foundry .se-rich .fdry-sechead { padding-top: clamp(110px, 13vh, 150px); }
  .foundry .se-rewrite__stage, .foundry .se-rich__stage { position: sticky; top: 84px; }
}

/* Step labels */
.foundry .se-rich__labels {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.foundry .se-rich__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.10);
  color: var(--fdry-ink-faint);
  transition: color .3s ease, border-color .3s ease, background .3s ease;
}
.foundry .se-rich__label.is-active {
  color: var(--fdry-violet-lt);
  border-color: color-mix(in srgb, var(--fdry-violet) 50%, transparent);
  background: color-mix(in srgb, var(--fdry-violet) 10%, transparent);
}

/* SERP card */
.foundry .se-rich__serp {
  width: min(660px, 100%);
  padding: clamp(20px, 3vw, 36px) clamp(18px, 3vw, 32px);
  border-radius: var(--fdry-r-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

/* Result row */
.foundry .se-rich__result {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.foundry .se-rich__favicon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--fdry-violet), #c43e15);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.foundry .se-rich__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Breadcrumb — hidden until step 1 */
.foundry .se-rich__breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  opacity: 0;
  transition: opacity .4s ease;
}
.foundry .se-rich__breadcrumb.is-visible { opacity: 1; }
.foundry .se-rich__breadcrumb-sep { color: var(--fdry-ink-faint); }

.foundry .se-rich__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.0625rem;
  color: color-mix(in srgb, var(--fdry-violet-lt) 80%, #fff 20%);
  line-height: 1.35;
}
.foundry .se-rich__snippet {
  font-size: .9375rem;
  color: var(--fdry-ink-soft);
  line-height: 1.55;
}

/* Stars — hidden until step 1 */
.foundry .se-rich__stars {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity .4s ease;
}
.foundry .se-rich__stars.is-visible { opacity: 1; }
.foundry .se-rich__star {
  color: #FFB830;
  font-size: 1rem;
}
.foundry .se-rich__star--half { opacity: .5; }
.foundry .se-rich__rating-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: #FFB830;
  margin-left: 3px;
}
.foundry .se-rich__rating-count {
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  margin-left: 2px;
}

/* FAQ snippet rows — hidden until step 2 */
.foundry .se-rich__faqs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
  overflow: hidden;
}
.foundry .se-rich__faq {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .4s ease, max-height .5s ease, padding .4s ease;
}
.foundry .se-rich__faq.is-visible {
  opacity: 1;
  max-height: 120px;
}
.foundry .se-rich__faq-q {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: .9375rem;
  color: color-mix(in srgb, var(--fdry-violet-lt) 80%, #fff 20%);
}
.foundry .se-rich__faq-a {
  font-size: .875rem;
  color: var(--fdry-ink-soft);
  line-height: 1.5;
}

/* Schema badge strip — grows step by step */
.foundry .se-rich__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.foundry .se-rich__badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--fdry-ink-faint);
  opacity: 0;
  transform: scale(.88);
  transition: opacity .35s ease, transform .35s ease, background .3s ease, border-color .3s ease, color .3s ease;
}
.foundry .se-rich__badge.is-visible {
  opacity: 1;
  transform: scale(1);
}
.foundry .se-rich__badge.is-active {
  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);
}

/* AI Overview card — hidden until step 3 */
.foundry .se-rich__ai-overview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(14px, 2vw, 22px) clamp(14px, 2vw, 22px);
  border-radius: var(--fdry-r);
  background: color-mix(in srgb, var(--fdry-violet) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 40%, transparent);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
.foundry .se-rich__ai-overview.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.foundry .se-rich__ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.foundry .se-rich__ai-spark {
  color: var(--fdry-violet-lt);
  animation: se-spark-pulse 2s ease-in-out infinite;
}
.foundry .se-rich__ai-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .9375rem;
  color: var(--fdry-violet-lt);
  letter-spacing: .04em;
}
.foundry .se-rich__ai-body {
  font-size: .9375rem;
  color: var(--fdry-ink-soft);
  line-height: 1.6;
  margin: 0;
}
.foundry .se-rich__ai-source {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
}
.foundry .se-rich__ai-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fdry-violet);
  box-shadow: 0 0 8px var(--fdry-violet);
}

/* Static (non-JS) final states for S2 */
.foundry .se-rich--static .se-rich__breadcrumb,
.foundry .se-rich--static .se-rich__stars,
.foundry .se-rich--static .se-rich__faq,
.foundry .se-rich--static .se-rich__ai-overview { opacity: 1 !important; transform: none !important; max-height: 200px !important; }
.foundry .se-rich--static .se-rich__badge { opacity: 1 !important; transform: scale(1) !important; }
.foundry .se-rich--static .se-rich__badge.is-active,
.foundry .se-rich--static .se-rich__badge { 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); }

/* ---- 10. Responsive for new scenes ------------------------- */
@media (max-width: 760px) {
  .foundry .se-rewrite__card { padding: 18px 16px; }
  .foundry .se-rewrite__steps { flex-wrap: nowrap; overflow-x: auto; }
  .foundry .se-rich__serp { padding: 18px 16px; }
  .foundry .se-rich__labels { gap: 6px; }
}

/* ---- 11. Reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  /* Existing scenes */
  .foundry .se-serp__arrow { animation: none !important; }
  .foundry .se-climb__num { opacity: 1 !important; transform: none !important; }
  .foundry .se-climb__bar i { transition: none !important; }
  .foundry .se-serp__row { transition: none !important; }
  @keyframes se-bob { 0%,100% { transform: none; opacity: 1; } }

  /* S1 — On-page rewrite: force final optimised state visible */
  .foundry .se-rewrite__after { display: block !important; opacity: 1 !important; transform: none !important; }
  .foundry .se-rewrite__before { display: none !important; }
  .foundry .se-rewrite__done { opacity: 1 !important; transform: none !important; }
  .foundry .se-rewrite__gauge-fill { stroke-dashoffset: 0 !important; transition: none !important; }
  .foundry .se-rewrite__done-spark { animation: none !important; }
  .foundry .se-rewrite__step { color: var(--fdry-violet) !important; }
  .foundry .se-rewrite__step-dot { background: var(--fdry-violet) !important; box-shadow: none !important; }

  /* S2 — Rich results: force all steps visible */
  .foundry .se-rich__breadcrumb { opacity: 1 !important; transition: none !important; }
  .foundry .se-rich__stars { opacity: 1 !important; transition: none !important; }
  .foundry .se-rich__faq { opacity: 1 !important; max-height: 200px !important; transition: none !important; }
  .foundry .se-rich__ai-overview { opacity: 1 !important; transform: none !important; transition: none !important; }
  .foundry .se-rich__badge { opacity: 1 !important; transform: scale(1) !important; transition: none !important; background: color-mix(in srgb, var(--fdry-violet) 18%, transparent) !important; border-color: color-mix(in srgb, var(--fdry-violet) 50%, transparent) !important; color: var(--fdry-violet-lt) !important; }
  .foundry .se-rich__label { color: var(--fdry-violet-lt) !important; border-color: color-mix(in srgb, var(--fdry-violet) 50%, transparent) !important; }
  .foundry .se-rich__ai-spark { animation: none !important; }
  .foundry @keyframes se-spark-pulse { 0%,100% { opacity: 1; transform: none; } }
}
