{# Chrome horizontal-marquee defs: embedded fonts, envelope (drift-animated),
   well, env-rail, chrome-text gradient, rim sweep, bevel filter.
   Specimen: chrome-marquees-v2 + production marquee-horizontal.svg.
   v0.2.16: LIVE-block separator gradient deleted; bevel filter expanded with
   feSpecularLighting (replaces basic drop-shadow), rim sweep added.
   v0.2.16-fix: fonts embedded so Orbitron actually renders (was advertised
   via data-hw-fonts="self-contained" but never emitted into the SVG).
   Chrome-text gradient brightened so short words don't fade into the dim chrome.
   Guard on data presence (envelope_stops), not profile identity. #}

  {# Embed Orbitron + JetBrains Mono via @font-face base64 data URIs so the
     marquee renders consistently in any context (Camo proxy, Finder Quick
     Look, email) without depending on system-installed fonts. #}
  <style>{{ font_faces | safe }}
  {# v0.3.12 — DECORATIVE LIVE diamond pulse (own @keyframes, phi-timed; not the
     state cascade, no data-hw-status). prefers-reduced-motion freezes it. #}
  .hw-mq-diamond { will-change: opacity; animation: hw-mq-pulse 2.618s ease-in-out infinite; }
  @keyframes hw-mq-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.15 } }
  @media (prefers-reduced-motion: reduce) { .hw-mq-diamond { animation: none !important; opacity: 0.8; } }
  </style>

  {# 11-stop chrome envelope · drift-animated 6.854s (φ⁴) on the body fill #}
  <linearGradient id="{{ uid }}-envelope" x1="0" x2="0" y1="{{ gradient_y_neg_005 }}" y2="{{ gradient_y_095 }}">
  {% for stop in envelope_stops %}
    <stop offset="{{ stop.offset }}" stop-color="{{ stop.color }}"/>
  {% endfor %}
    <animateTransform attributeName="gradientTransform" type="translate"
      values="0 -0.15; 0 0.15; 0 -0.15" dur="6.854s"
      repeatCount="indefinite" calcMode="spline"
      keySplines="0.4 0 0.2 1;0.4 0 0.2 1"/>
  </linearGradient>

  {# Static env-rail · vertical sliver for the 6px left accent rail #}
  <linearGradient id="{{ uid }}-env-rail" x1="0" x2="0" y1="0" y2="1">
  {% for stop in envelope_stops %}
    <stop offset="{{ stop.offset }}" stop-color="{{ stop.color }}"/>
  {% endfor %}
  </linearGradient>

  {# Well · dark card interior #}
  <linearGradient id="{{ uid }}-well" x1="0" x2="0" y1="0" y2="1">
    <stop offset="0%" stop-color="{{ well_top }}"/>
    <stop offset="100%" stop-color="{{ well_bottom }}"/>
  </linearGradient>

  {# Chrome-text gradient · the marquee scroll-text fill (text_fill_mode=gradient
     in chrome paradigm yaml; resolver references this id via text_fill_gradient_id="ct").
     Stops sourced from genome.chrome_text_gradient — variant_overrides supply
     per-variant tonal envelopes (abyssal teal, lightning blue, graphite warm
     gray, moth umber); horizon's bare stops keep the byte-equal flagship
     output. Without this loop the gradient stayed at hardcoded chrome-horizon
     stops on every variant. #}
  <linearGradient id="{{ uid }}-ct" x1="0" y1="0" x2="1" y2="0">
  {% for stop in chrome_text_gradient %}
    <stop offset="{{ stop.offset }}" stop-color="{{ stop.color }}"/>
  {% endfor %}
  </linearGradient>

  {# Rim sweep · 17.944s phi-cubed travelling chrome highlight on the inner stroke #}
  <linearGradient id="{{ uid }}-rim" x1="0" y1="0" x2="1" y2="0">
    <stop offset="0%"   stop-color="{{ specular_light }}" stop-opacity="0"/>
    <stop offset="38%"  stop-color="{{ specular_light }}" stop-opacity="0"/>
    <stop offset="46%"  stop-color="{{ chrome_rim_soft }}" stop-opacity="0.28"/>
    <stop offset="50%"  stop-color="{{ chrome_rim_core }}" stop-opacity="0.55"/>
    <stop offset="54%"  stop-color="{{ chrome_rim_soft }}" stop-opacity="0.28"/>
    <stop offset="62%"  stop-color="{{ specular_light }}" stop-opacity="0"/>
    <stop offset="100%" stop-color="{{ specular_light }}" stop-opacity="0"/>
    <animate attributeName="x1" values="-0.5;1.1;-0.5" dur="17.944s" repeatCount="indefinite"
      calcMode="spline" keySplines="0.4 0 0.6 1;0.4 0 0.6 1"/>
    <animate attributeName="x2" values="0.5;2.1;0.5" dur="17.944s" repeatCount="indefinite"
      calcMode="spline" keySplines="0.4 0 0.6 1;0.4 0 0.6 1"/>
  </linearGradient>

  {# Top specular · static horizontal milled highlight (prototype mq-C-specular).
     The 1px top line reads as a machined edge without the glare of a full
     feSpecularLighting pass. #}
  <linearGradient id="{{ uid }}-specular" x1="0" y1="0" x2="1" y2="0">
    <stop offset="0%" stop-color="{{ specular_light }}" stop-opacity="0"/>
    <stop offset="50%" stop-color="{{ specular_light }}" stop-opacity="0.18"/>
    <stop offset="100%" stop-color="{{ specular_light }}" stop-opacity="0"/>
  </linearGradient>

  {# Bottom shadow band · static vertical darkening (prototype mq-C-shadow-band)
     that seats the well into the envelope. #}
  <linearGradient id="{{ uid }}-shadow-band" x1="0" y1="0" x2="0" y2="1">
    <stop offset="0%" stop-color="{{ bevel_shadow_color }}" stop-opacity="0"/>
    <stop offset="100%" stop-color="{{ bevel_shadow_color }}" stop-opacity="0.45"/>
  </linearGradient>

  {# LIVE-zone seam · subtle gradient stroke that fades to nothing at both ends
     (prototype mq-C-sep). Replaces a solid --dna-highlight line that read as a
     hard "|"; the 0 -> 0.45 -> 0 vertical fade matches the prototype's soft
     seam between the fixed LIVE panel and the scroll track. #}
  <linearGradient id="{{ uid }}-sep" x1="0" y1="0" x2="0" y2="1">
    <stop offset="0%" stop-color="var(--dna-highlight, var(--dna-signal))" stop-opacity="0"/>
    <stop offset="50%" stop-color="var(--dna-highlight, var(--dna-signal))" stop-opacity="0.45"/>
    <stop offset="100%" stop-color="var(--dna-highlight, var(--dna-signal))" stop-opacity="0"/>
  </linearGradient>

  {# Frame shadow · flat drop shadow (prototype mq-C-shadow). v0.3.12-fix:
     replaces the feSpecularLighting bevel, whose 3D edge highlight thickened
     the border and blurs under mobile rasterization (badge drop-shadow-only
     discipline is the reference). id stays {{ uid }}-bevel for the content rect. #}
  <filter id="{{ uid }}-bevel" x="-1%" y="-4%" width="102%" height="112%">
    <feDropShadow dx="0" dy="1" stdDeviation="1.5" flood-color="{{ bevel_shadow_color }}" flood-opacity="0.30"/>
  </filter>
