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

/* ---- 1. Accent skin ---------------------------------------- */
body.foundry {
  --fdry-violet:    #0EC49E;   /* product accent becomes the light source */
  --fdry-violet-lt: #34D9B4;
  --fdry-acc:       #0EC49E;   /* default accent for accent-keyed parts */
  --fdry-bg:        #06100E;   /* near-black with a teal undertone */
  --fdry-bg-2:      #0A1A1E;
}
/* Ambient light retint (foundry.css hardcodes a violet rgba) */
body.foundry::before {
  background:
    radial-gradient(135% 85% at 62% -6%, rgba(14,196,158,.24), transparent 60%),
    radial-gradient(95% 65% at 4% 0%, rgba(52,217,180,.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), #0a9b7c); }

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

/* Live-translation panel */
.foundry .lf-trans { width: 100%; max-width: 460px; padding: 0; border-radius: var(--fdry-r-lg); }
.foundry .lf-trans__top { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.foundry .lf-trans__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); }
.foundry .lf-trans__file { font-family: 'JetBrains Mono',monospace; font-size: .875rem; color: var(--fdry-ink-faint); margin-left: 6px; }
.foundry .lf-trans__live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: 'JetBrains Mono',monospace; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fdry-violet-lt); }
.foundry .lf-trans__live i { width: 7px; height: 7px; border-radius: 50%; background: var(--fdry-violet-lt); box-shadow: 0 0 10px var(--fdry-violet-lt); animation: lf-pulse 1.4s ease-in-out infinite; }
@keyframes lf-pulse { 0%,100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.foundry .lf-trans__row { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px; }
.foundry .lf-trans__row p { font-family: 'Space Grotesk',sans-serif; font-size: 1.18rem; line-height: 1.32; margin: 0; }
.foundry .lf-trans__row--src p { color: var(--fdry-ink-soft); }
.foundry .lf-trans__row--out p { color: #fff; transition: opacity .4s var(--fdry-ease), filter .4s var(--fdry-ease); }
.foundry .lf-trans__row--out.is-swap p { opacity: 0; filter: blur(7px); }
.foundry .lf-trans__flag { flex: 0 0 auto; min-width: 38px; height: 30px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 9px; font-family: 'JetBrains Mono',monospace; font-size: .875rem; font-weight: 600; color: var(--fdry-violet-lt); background: color-mix(in srgb, var(--fdry-violet) 16%, #0b1a18); border: 1px solid color-mix(in srgb, var(--fdry-violet) 38%, transparent); }
.foundry .lf-trans__row--src .lf-trans__flag { color: var(--fdry-ink-soft); background: rgba(255,255,255,.05); border-color: var(--fdry-glass-border); }
.foundry .lf-trans__pipe { display: flex; align-items: center; gap: 10px; padding: 0 22px; color: var(--fdry-violet-lt); }
.foundry .lf-trans__pipe span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fdry-violet) 50%, transparent), transparent); }
.foundry .lf-trans__pipe svg { width: 18px; height: 18px; transform: rotate(90deg); }

/* Language chips */
.foundry .lf-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0; max-width: 440px; }
.foundry .lf-chips li { font-family: 'JetBrains Mono',monospace; font-size: .875rem; padding: 6px 12px; 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 .lf-chips li.is-active { color: #04130f; background: var(--fdry-violet-lt); border-color: var(--fdry-violet-lt); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(14,196,158,.4); }

/* ---- 3. Signature morph scene ------------------------------ */
.foundry .lf-morph { text-align: center; }
.foundry .lf-morph__stage { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 16px 0 clamp(30px,6vw,70px); }
.foundry .lf-morph__word {
  font-family: 'Space Grotesk',sans-serif; font-weight: 600;
  /* line-height >=1.2 + vertical padding so the gradient paint box (background-
     clip:text) covers tall glyphs and diacritics — Arabic marks / CJK were
     getting cropped at the top with the old .9 line-height. */
  font-size: clamp(3rem, 12vw, 9rem); line-height: 1.2; letter-spacing: -.04em;
  padding: .16em .04em .06em; margin: 0;
  background: linear-gradient(180deg, #fff, var(--fdry-violet-lt));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  will-change: opacity, transform;
}
.foundry .lf-morph__word.is-swap { opacity: 0; transform: translateY(14px) scale(.97); }
.foundry .lf-morph__word { transition: opacity .28s var(--fdry-ease), transform .28s var(--fdry-ease); }
.foundry .lf-morph__bar { width: min(420px, 70vw); height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.foundry .lf-morph__bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt)); box-shadow: 0 0 16px var(--fdry-violet); }
.foundry .lf-morph__sub { max-width: 50ch; color: var(--fdry-ink-soft); font-size: clamp(1rem,1.4vw,1.2rem); line-height: 1.6; margin: 0; }

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

/* ---- 5. 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; }

/* ---- 6. 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); }

/* ---- Scene L1: One source → every locale (cascade) -------- */
.foundry .lf-cascade__stage {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Source row */
.foundry .lf-cascade__source {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: color-mix(in srgb, var(--fdry-violet) 12%, var(--fdry-glass));
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 38%, transparent);
  border-radius: var(--fdry-r) var(--fdry-r) 0 0;
}

/* Progress rail between source and rows */
.foundry .lf-cascade__rail {
  height: 3px;
  background: rgba(255,255,255,.07);
  position: relative;
  overflow: hidden;
}
.foundry .lf-cascade__rail-fill {
  display: block;
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt));
  box-shadow: 0 0 12px var(--fdry-violet);
  transition: width .1s linear;
}

/* Translation rows container */
.foundry .lf-cascade__rows {
  border: 1px solid var(--fdry-glass-border);
  border-top: none;
  border-radius: 0 0 var(--fdry-r) var(--fdry-r);
  overflow: hidden;
  background: var(--fdry-glass);
}

/* Individual row */
.foundry .lf-cascade__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  /* authored visible — JS will set opacity:0 translateY(12px) before animating in */
  opacity: 1;
  transform: translateY(0);
  transition: background .3s ease;
}
.foundry .lf-cascade__row:last-child { border-bottom: none; }
.foundry .lf-cascade__row[dir="rtl"] { flex-direction: row-reverse; justify-content: flex-end; text-align: right; }

/* Locale badge */
.foundry .lf-cascade__locale {
  flex: 0 0 auto;
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  font-weight: 600;
  color: var(--fdry-violet-lt);
  background: color-mix(in srgb, var(--fdry-violet) 14%, #0b1a18);
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 36%, transparent);
}
.foundry .lf-cascade__locale--src {
  color: var(--fdry-ink-soft);
  background: rgba(255,255,255,.05);
  border-color: var(--fdry-glass-border);
}

/* Text */
.foundry .lf-cascade__text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fff;
}
.foundry .lf-cascade__text--src {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fdry-ink-soft);
}

/* ---- Scene L2: SEO carried across -------------------------- */
.foundry .lf-seo__wrap {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Locale switcher dots */
.foundry .lf-seo__dots {
  display: flex;
  gap: 12px;
}
.foundry .lf-seo__dot {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  color: var(--fdry-ink-faint);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--fdry-glass-border);
  cursor: default;
  transition: color .3s ease, background .3s ease, border-color .3s ease, transform .3s ease;
}
.foundry .lf-seo__dot.is-active {
  color: #04130f;
  background: var(--fdry-violet-lt);
  border-color: var(--fdry-violet-lt);
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(14,196,158,.38);
}

/* Card */
.foundry .lf-seo__card {
  width: 100%;
  border-radius: var(--fdry-r-lg);
  overflow: hidden;
}

/* Browser chrome */
.foundry .lf-seo__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}
.foundry .lf-seo__chrome-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
}
.foundry .lf-seo__chrome-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 5px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--fdry-glass-border);
  overflow: hidden;
}
.foundry .lf-seo__chrome-lock svg {
  width: 13px;
  height: 13px;
  color: var(--fdry-violet-lt);
  flex: 0 0 auto;
}
.foundry .lf-seo__chrome-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .35s ease, filter .35s ease;
}
.foundry .lf-seo__chrome-url.is-swap { opacity: 0; filter: blur(5px); }

/* SERP result */
.foundry .lf-seo__serp {
  padding: 26px 28px 20px;
}
.foundry .lf-seo__serp-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: #5cb392;
  margin-bottom: 5px;
  transition: opacity .35s ease, filter .35s ease;
}
.foundry .lf-seo__serp-url.is-swap { opacity: 0; filter: blur(5px); }
.foundry .lf-seo__serp-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #8fb8e8;
  line-height: 1.35;
  margin-bottom: 8px;
  transition: opacity .35s ease, filter .35s ease;
}
.foundry .lf-seo__serp-title.is-swap { opacity: 0; filter: blur(5px); }
.foundry .lf-seo__serp-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fdry-ink-soft);
  transition: opacity .35s ease, filter .35s ease;
}
.foundry .lf-seo__serp-desc.is-swap { opacity: 0; filter: blur(5px); }

/* hreflang tag line */
.foundry .lf-seo__tag-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.02);
}
.foundry .lf-seo__tag-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-ink-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.foundry .lf-seo__tag-label svg {
  width: 14px;
  height: 14px;
  color: var(--fdry-violet);
}
.foundry .lf-seo__tag-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--fdry-violet-lt);
  background: color-mix(in srgb, var(--fdry-violet) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--fdry-violet) 32%, transparent);
  border-radius: 6px;
  padding: 3px 10px;
  transition: opacity .35s ease, filter .35s ease;
}
.foundry .lf-seo__tag-val.is-swap { opacity: 0; filter: blur(5px); }

/* SEO scroll progress rail */
.foundry .lf-seo__rail {
  width: min(360px, 72vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
}
.foundry .lf-seo__rail-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fdry-violet), var(--fdry-violet-lt));
  box-shadow: 0 0 12px var(--fdry-violet);
  transition: width .1s linear;
}

/* ---- 7. Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .foundry .fdry-hero__art { max-width: 520px; margin: 8px auto 0; }
}
@media (max-width: 760px) {
  .foundry .lf-trans__row p { font-size: 1.05rem; }
  .foundry .lf-morph__word { font-size: clamp(2.6rem, 16vw, 5rem); }
  .foundry .fdry-cmp { overflow-x: auto; }
}

/* ---- 8. Responsive: scenes --------------------------------- */
@media (max-width: 760px) {
  .foundry .lf-cascade__source,
  .foundry .lf-cascade__row { padding: 15px 18px; }
  .foundry .lf-cascade__text { font-size: 1rem; }
  .foundry .lf-cascade__text--src { font-size: 1.05rem; }
  .foundry .lf-seo__serp { padding: 20px 18px 16px; }
  .foundry .lf-seo__tag-line { padding: 12px 18px; }
  .foundry .lf-seo__serp-title { font-size: 1.05rem; }
}

/* ---- 9. Reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .foundry .lf-trans__live i { animation: none !important; }
  .foundry .lf-trans__row--out p,
  .foundry .lf-morph__word { opacity: 1 !important; filter: none !important; transform: none !important; }
  /* L1 cascade: all rows fully visible */
  .foundry .lf-cascade__row { opacity: 1 !important; transform: none !important; }
  .foundry .lf-cascade__rail-fill { width: 100% !important; }
  /* L2 SEO: card elements fully visible */
  .foundry .lf-seo__chrome-url,
  .foundry .lf-seo__serp-url,
  .foundry .lf-seo__serp-title,
  .foundry .lf-seo__serp-desc,
  .foundry .lf-seo__tag-val { opacity: 1 !important; filter: none !important; }
  .foundry .lf-seo__rail-fill { width: 100% !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 (shell-sticky alone doesn't
     hold — the sticky element must be a CHILD of the tall element). Heading
     scrolls up and away; the content stage holds while the JS scrubs. */
  .foundry .lf-cascade, .foundry .lf-seo-scene { padding-top: 0; padding-bottom: 0; overflow: visible; }
  .foundry .lf-cascade > .fdry-shell, .foundry .lf-seo-scene > .fdry-shell { min-height: 170vh; overflow: visible; }
  .foundry .lf-cascade__stage, .foundry .lf-seo__wrap {
    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;
  }
}
