/* v109 Labs Journal Custom Motion System
   100% Safari & iOS Safari safe: pure 2D SVG transforms (never translate3d on SVG child nodes),
   expressive stroke-dashoffset draw-ins, orbital geometry & breath glides matching ambient.css.
   Strict brand typography only: Fraunces (--display), Commissioner (--body), Parisienne (--script).
   Animations start immediately on paint under prefers-reduced-motion:no-preference, pause offscreen/hidden,
   and disable completely under prefers-reduced-motion:reduce. */

/* === Shared Hero Atmosphere Container === */
.l106-journal-hero,
.l106-article-hero{position:relative;isolation:isolate;overflow:hidden}
.l106-journal-hero>.wrap,
.l106-article-hero>.wrap{position:relative;z-index:2}

.j108-atmo{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.j108-light{position:absolute;inset:-16%;opacity:.76}
.j108-art{position:absolute;right:-3%;top:-10%;width:min(760px,74vw);height:auto;max-height:132%;overflow:visible}
.j108-art path,.j108-art circle,.j108-art line,.j108-art rect{vector-effect:non-scaling-stroke}

/* Light pools per theme */
[data-j108-theme="journal-index"] .j108-light{
  background:radial-gradient(ellipse at 78% 36%,#fff6dfcc,transparent 52%),
             radial-gradient(ellipse at 18% 82%,#c5cbb34a,transparent 54%);
}
[data-j108-theme="human-ai"] .j108-light{
  background:radial-gradient(ellipse at 76% 42%,#f5dcc094,transparent 50%),
             radial-gradient(ellipse at 22% 78%,#b9c4a73f,transparent 52%);
}
[data-j108-theme="honest-seo"] .j108-light{
  background:radial-gradient(ellipse at 80% 48%,#dce2cf7d,transparent 50%),
             radial-gradient(ellipse at 24% 26%,#fff7e2ab,transparent 52%);
}
[data-j108-theme="craft-speed"] .j108-light{
  background:radial-gradient(ellipse at 75% 40%,#fff5dfd4,transparent 52%),
             radial-gradient(ellipse at 24% 78%,#d7dfc84d,transparent 54%);
}

/* === Theme 1: Journal Index — Studio Notebook, Organic Waves & Orbital Ink === */
.j108-idx-trace{fill:none;stroke:#b45a1d;stroke-width:1.45;opacity:.38;stroke-linecap:round}
.j108-idx-trace--sage{stroke:#718567;stroke-width:1.3;opacity:.34}
.j108-idx-trace--soft{stroke:#c6854d;stroke-width:1.15;opacity:.26}
.j108-idx-ring{fill:none;stroke:#a87044;stroke-width:1.1;opacity:.24}
.j108-idx-ring--sage{stroke:#718567;opacity:.22;stroke-dasharray:4 6}
.j108-idx-dot{fill:#b45a1d;opacity:.78}
.j108-idx-dot--sage{fill:#718567;opacity:.72}
.j108-idx-orbit{transform-origin:520px 210px}
.j108-idx-orbit-rev{transform-origin:520px 210px}
.j108-idx-wave{transform-origin:420px 230px}
.j108-idx-wave-late{transform-origin:420px 230px}

/* === Theme 2: Human-First AI — The Human Line (Grid softening into living stroke) === */
.j108-ai-grid line{stroke:#7f8a72;stroke-width:.95;opacity:.2;stroke-dasharray:3 5}
.j108-ai-tick{stroke:#8b7f6c;stroke-width:1.05;opacity:.3}
.j108-ai-stroke{fill:none;stroke:#b45a1d;stroke-width:1.75;stroke-linecap:round;opacity:.48}
.j108-ai-stroke--echo{fill:none;stroke:#748465;stroke-width:1.2;stroke-linecap:round;opacity:.32}
.j108-ai-spark{fill:#b45a1d;opacity:.7;transform-box:fill-box;transform-origin:center}

/* === Theme 3: Honest SEO — Wayfinding & Signal Ripples === */
.j108-seo-ring{fill:none;stroke:#748465;stroke-width:1.2;opacity:.28;transform-box:fill-box;transform-origin:center}
.j108-seo-ring--warm{stroke:#b45a1d;opacity:.26}
.j108-seo-path{fill:none;stroke:#a87044;stroke-width:1.25;opacity:.3;stroke-dasharray:5 6;stroke-linecap:round}
.j108-seo-path--sage{stroke:#718567;opacity:.28}
.j108-seo-core{fill:#b45a1d;opacity:.68;transform-box:fill-box;transform-origin:center}
.j108-seo-node{fill:#718567;opacity:.6}

/* === Theme 4: Craft & Speed — Weightless Ribbons, Travelling Light & Rising Motes === */
.j108-calm-line{fill:none;stroke:#b45a1d;stroke-width:1.35;stroke-linecap:round;opacity:.34}
.j108-calm-line--sage{stroke:#718567;stroke-width:1.25;opacity:.3}
.j108-calm-line--pale{stroke:#c6854d;stroke-width:1.1;opacity:.26}
.j108-calm-pulse{fill:none;stroke:#b45a1d;stroke-width:2.1;stroke-linecap:round;opacity:.66;stroke-dasharray:68 780}
.j108-calm-pulse--sage{stroke:#718567;stroke-width:1.8;opacity:.58;stroke-dasharray:54 780}
.j108-calm-mote{fill:#b45a1d;opacity:.65}
.j108-calm-mote--sage{fill:#718567;opacity:.58}
.j108-calm-ribbon--1,.j108-calm-ribbon--2,.j108-calm-ribbon--3{transform-origin:420px 220px}

/* === Active Animations (Immediate start, 2D Safari-safe, visibility-paused offscreen) === */
@media(prefers-reduced-motion:no-preference){
  .j108-light{animation:j108LightDrift 14s ease-in-out infinite alternate}

  /* Journal Index */
  [data-j108-theme="journal-index"] .j108-idx-trace{stroke-dasharray:920;animation:j108DrawIn920 1.9s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="journal-index"] .j108-idx-trace--sage{stroke-dasharray:920;animation:j108DrawIn920 2.15s .15s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="journal-index"] .j108-idx-trace--soft{stroke-dasharray:920;animation:j108DrawIn920 2.35s .25s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="journal-index"] .j108-idx-wave{animation:j108WaveSoft 8.5s ease-in-out infinite alternate}
  [data-j108-theme="journal-index"] .j108-idx-wave-late{animation:j108WaveSoft 10.5s -3s ease-in-out infinite alternate-reverse}
  [data-j108-theme="journal-index"] .j108-idx-orbit{animation:j108OrbitFull 26s linear infinite}
  [data-j108-theme="journal-index"] .j108-idx-orbit-rev{animation:j108OrbitFull 36s linear infinite reverse}

  /* Human-First AI */
  [data-j108-theme="human-ai"] .j108-ai-grid{animation:j108GridQuiet 10s ease-in-out infinite alternate}
  [data-j108-theme="human-ai"] .j108-ai-stroke{stroke-dasharray:820;animation:j108DrawIn820 2s cubic-bezier(.22,1,.36,1) both,j108BreatheLine 9s 2.1s ease-in-out infinite alternate}
  [data-j108-theme="human-ai"] .j108-ai-stroke--echo{stroke-dasharray:820;animation:j108DrawIn820 2.3s .2s cubic-bezier(.22,1,.36,1) both,j108BreatheLine 11s 2.4s ease-in-out infinite alternate-reverse}
  [data-j108-theme="human-ai"] .j108-ai-spark{animation:j108SoftPulse 5.5s ease-in-out infinite alternate}

  /* Honest SEO */
  [data-j108-theme="honest-seo"] .j108-seo-ring--1{animation:j108Ripple 10s ease-out infinite}
  [data-j108-theme="honest-seo"] .j108-seo-ring--2{animation:j108Ripple 10s -3.3s ease-out infinite}
  [data-j108-theme="honest-seo"] .j108-seo-ring--3{animation:j108Ripple 10s -6.6s ease-out infinite}
  [data-j108-theme="honest-seo"] .j108-seo-path{animation:j108DashFlow 20s linear infinite}
  [data-j108-theme="honest-seo"] .j108-seo-core{animation:j108SoftPulse 5s ease-in-out infinite alternate}

  /* Craft & Speed */
  [data-j108-theme="craft-speed"] .j108-calm-line{stroke-dasharray:820;animation:j108DrawIn820 1.55s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="craft-speed"] .j108-calm-line--sage{stroke-dasharray:820;animation:j108DrawIn820 1.75s .15s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="craft-speed"] .j108-calm-line--pale{stroke-dasharray:820;animation:j108DrawIn820 1.95s .28s cubic-bezier(.22,1,.36,1) both}
  [data-j108-theme="craft-speed"] .j108-calm-ribbon--1{animation:j108BreathGlide 7.5s ease-in-out infinite alternate}
  [data-j108-theme="craft-speed"] .j108-calm-ribbon--2{animation:j108BreathGlide 9.5s -3s ease-in-out infinite alternate-reverse}
  [data-j108-theme="craft-speed"] .j108-calm-ribbon--3{animation:j108BreathGlide 11s -5s ease-in-out infinite alternate}
  [data-j108-theme="craft-speed"] .j108-calm-pulse--1{animation:j108SpeedGlide 5.2s linear infinite}
  [data-j108-theme="craft-speed"] .j108-calm-pulse--2{animation:j108SpeedGlide 6.8s -2.2s linear infinite}
  [data-j108-theme="craft-speed"] .j108-calm-pulse--3{animation:j108SpeedGlide 8s -4.1s linear infinite}
  [data-j108-theme="craft-speed"] .j108-calm-motes{animation:j108MoteRise 7.5s ease-in-out infinite alternate}
  [data-j108-theme="craft-speed"] .j108-calm-motes-late{animation:j108MoteRise 9.5s -3.5s ease-in-out infinite alternate-reverse}

  /* Pause cleanly only when hero scrolls offscreen or tab is hidden */
  [data-j108-state="paused"] .j108-light,
  [data-j108-state="paused"] .j108-art,
  [data-j108-state="paused"] .j108-anim{animation-play-state:paused!important}
}

@keyframes j108LightDrift{
  from{transform:translate(-2%,1.5%) scale(1);opacity:.62}
  to{transform:translate(2.5%,-1.5%) scale(1.07);opacity:.92}
}
@keyframes j108DrawIn920{
  from{stroke-dashoffset:920}
  to{stroke-dashoffset:0}
}
@keyframes j108DrawIn820{
  from{stroke-dashoffset:820}
  to{stroke-dashoffset:0}
}
@keyframes j108WaveSoft{
  from{transform:translate(-20px,10px) rotate(-1.6deg)}
  to{transform:translate(22px,-12px) rotate(1.6deg)}
}
@keyframes j108OrbitFull{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}
@keyframes j108GridQuiet{
  from{opacity:.55;transform:translate(0,0)}
  to{opacity:.95;transform:translate(-10px,6px)}
}
@keyframes j108BreatheLine{
  from{transform:translate(-10px,8px)}
  to{transform:translate(12px,-9px)}
}
@keyframes j108SoftPulse{
  from{opacity:.35;transform:scale(.88)}
  to{opacity:.85;transform:scale(1.16)}
}
@keyframes j108Ripple{
  0%{transform:scale(.76);opacity:0}
  20%{opacity:.34}
  72%{opacity:.18}
  100%{transform:scale(1.26);opacity:0}
}
@keyframes j108DashFlow{
  from{stroke-dashoffset:0}
  to{stroke-dashoffset:-110}
}
@keyframes j108BreathGlide{
  from{transform:translate(-24px,9px)}
  to{transform:translate(26px,-10px)}
}
@keyframes j108SpeedGlide{
  from{stroke-dashoffset:848}
  to{stroke-dashoffset:0}
}
@keyframes j108MoteRise{
  from{transform:translate(-6px,16px);opacity:.35}
  to{transform:translate(14px,-20px);opacity:.88}
}

/* === Hero Byline & Hairline Ink-Draw Accent === */
.l106-byline{position:relative}
.l106-byline::before{content:"";position:absolute;left:0;top:-1px;width:64px;height:1.5px;background:var(--rust);opacity:.68;transform-origin:left;animation:j108LineGrow 900ms cubic-bezier(.22,1,.36,1) both}
@keyframes j108LineGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* === Editorial Prose Scroll Choreography (Non-destructive: always readable without JS) === */
.l106-prose h2{position:relative;padding-top:14px}
.l106-prose h2::before{content:"";position:absolute;left:0;top:0;width:28px;height:1.5px;background:var(--rust);opacity:.55;transform-origin:left;transition:transform 650ms cubic-bezier(.22,1,.36,1),opacity 650ms ease}
html.j108-js .l106-prose h2:not(.j108-in)::before{transform:scaleX(0);opacity:0}

.l106-prose blockquote{position:relative;border-left:0;padding-left:28px}
.l106-prose blockquote::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:3px;background:var(--rust);transform-origin:top;transition:transform 800ms cubic-bezier(.22,1,.36,1)}
html.j108-js .l106-prose blockquote:not(.j108-in)::before{transform:scaleY(0)}

/* === Micro-emblems on Journal Index Rows & /labs Preview Cards === */
.j108-emblem{width:34px;height:20px;flex:none;display:inline-flex;align-items:center;justify-content:center;color:#8c5b32;opacity:.88}
.j108-emblem svg{width:34px;height:20px;overflow:visible}
.j108-emblem path,.j108-emblem circle,.j108-emblem line{vector-effect:non-scaling-stroke;transition:transform 420ms var(--ease),opacity 320ms ease}
.l106-jrow:hover .j108-emblem--ai path,
.l106-jcard:hover .j108-emblem--ai path{transform:translateX(2px)}
.l106-jrow:hover .j108-emblem--seo circle:last-of-type,
.l106-jcard:hover .j108-emblem--seo circle:last-of-type{transform:scale(1.18);transform-box:fill-box;transform-origin:center}
.l106-jrow:hover .j108-emblem--calm path,
.l106-jcard:hover .j108-emblem--calm path{transform:translateX(3px)}

/* === Bespoke Inline Editorial Diagrams (Article-Specific) === */
.j108-line-study{margin:2.1em 0;padding:clamp(22px,3vw,30px);background:#fffaf1;border:1px solid #dfd0b8;border-radius:20px}
.j108-study-eyebrow{font:500 .7rem/1.6 var(--body);letter-spacing:.1em;text-transform:uppercase;color:#8c5b32;margin:0 0 16px}
.j108-line-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
.j108-line-col{padding:18px 20px;border-radius:14px;border:1px solid #e3d5be;background:var(--paper)}
.j108-line-col--human{background:#f7efe1;border-color:#d6b894}
.j108-line-col h3{font:400 1.15rem/1.3 var(--display);color:var(--forest);margin:10px 0 8px}
.j108-line-col p{font:400 .88rem/1.7 var(--body);color:var(--muted);margin:0}
.j108-line-svg{width:100%;height:34px;display:block;overflow:visible}
.j108-line-svg line,.j108-line-svg path{vector-effect:non-scaling-stroke}
.j108-line-curve{fill:none;stroke:#b45a1d;stroke-width:1.8;stroke-linecap:round;stroke-dasharray:260;stroke-dashoffset:0;transition:stroke-dashoffset 1.2s cubic-bezier(.22,1,.36,1)}
html.j108-js .j108-line-study:not(.j108-in) .j108-line-curve{stroke-dashoffset:260}

.j108-seo-strip{list-style:none;padding:0;margin:0 0 16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.j108-seo-strip li{padding:14px 16px;border-radius:14px;background:var(--paper-2);border:1px solid #e1d1b8;display:flex;flex-direction:column;gap:3px}
.j108-seo-strip strong{font:400 clamp(1.35rem,2.2vw,1.7rem)/1.15 var(--display);color:var(--forest);letter-spacing:-.025em;font-variant-numeric:tabular-nums}
.j108-seo-strip span{font:400 .78rem/1.45 var(--body);color:var(--muted)}

.j108-weight-study{margin:2.1em 0;padding:clamp(22px,3vw,30px);background:#fffaf1;border:1px solid #dfd0b8;border-radius:20px}
.j108-weight-rows{display:grid;gap:18px}
.j108-weight-row{display:grid;gap:8px}
.j108-weight-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:6px 14px}
.j108-weight-head strong{font:400 1.08rem/1.3 var(--display);color:var(--forest)}
.j108-weight-head span{font:400 .8rem/1.5 var(--body);color:var(--muted)}
.j108-track{position:relative;height:10px;border-radius:999px;background:#efe6d7;overflow:hidden}
.j108-fill{display:block;height:100%;border-radius:999px;transform-origin:left;transition:transform 1.1s cubic-bezier(.22,1,.36,1)}
.j108-fill--heavy{width:92%;background:repeating-linear-gradient(90deg,#c5b59e 0 14px,#d8cab4 14px 18px);transition-duration:1.35s}
.j108-fill--light{width:24%;background:linear-gradient(90deg,#b45a1d,#d06d26);transition-delay:180ms}
html.j108-js .j108-weight-study:not(.j108-in) .j108-fill{transform:scaleX(0)}
.j108-weight-note{margin:14px 0 0;font:italic 400 .94rem/1.6 var(--display);color:var(--forest)}

/* === Responsive Framing for Mobile (keep focal SVG visibly alive without fighting text) === */
@media(max-width:820px){
  .j108-art{width:620px;right:-150px;top:-14px;opacity:.85}
  [data-j108-theme="craft-speed"] .j108-art{width:640px;right:-110px;top:4px;opacity:.88}
  [data-j108-theme="journal-index"] .j108-art{width:620px;right:-145px;top:-10px;opacity:.86}
  .j108-line-cols{grid-template-columns:1fr}
  .j108-seo-strip{grid-template-columns:1fr}
}
@media(max-width:520px){
  .j108-art{width:540px;right:-165px;top:6px;opacity:.76}
  [data-j108-theme="craft-speed"] .j108-art{width:560px;right:-120px;top:14px;opacity:.82}
  [data-j108-theme="journal-index"] .j108-art{width:540px;right:-155px;top:4px;opacity:.78}
  .l106-prose blockquote{padding-left:20px}
  .j108-line-study,.j108-weight-study{padding:20px 18px}
}
@media(prefers-reduced-motion:reduce){
  .j108-light,.j108-art,.j108-anim,.l106-byline::before,.l106-prose h2::before,.l106-prose blockquote::before,.j108-line-curve,.j108-fill,.j108-emblem *{
    animation:none!important;transition:none!important;transform:none!important;stroke-dashoffset:0!important
  }
}
