/* T-61 / T-85 / T-154 — THE Thai flag as soft background bands, for every surface: the website's hero (index.html, .hero-flag) and the
   extension panel's header (extension/panel.html, .top-flag — the build copies this file to lib/flag-bands.css unchanged; T-90).
   His words (T-61): "maybe like a cool thai flag animation or something in the background … make it modern and cool"; (T-154, the
   panel): "make it like it is on the website where its in the background rather than the icon next to the logo".
   The flag's five stripes (red var(--flag-red) · white var(--flag-white) · blue var(--flag-blue), 1:1:2:1:1) as soft bands that ripple slowly like a flag in a
   breeze. Atmosphere only: low opacity, soft edges drawn INTO the gradients (no filter blur), transform-only animation, ONE constant sway (T-304, his 28 Oct: "i want a constant sway tbh and not glitching but subtle pls"; after T-280's slower, gentler wave):
   a 24 s loop, never `alternate` (that slowed to a stop and reversed at each end), five keyframes with 100% = 0% so the loop has no seam:
   left (-1.5%, skew -0.5deg) → middle, 1 px down → right (+1.5%, skew +0.5deg) → middle, 1 px up → left again. The easing is a sine curve
   in pieces: ease-in-sine into the middle, ease-out-sine out to each side, whose speeds MATCH where they meet (both 1.64× the average at the
   middle, 0 at the sides), so the sway reads as one smooth sine with no corners (plain linear would turn sharply at each side: a "glitch").
   The 1 px rise follows the same curve (too small to see its shape). Each band a little behind the one above (the negative delays);
   src/core/flag-bands.js pauses it off-screen and in a hidden page; still under reduced motion.
   Markup: <div class="flag-bands …" aria-hidden="true"><i class="fb r1"></i><i class="fb w1"></i><i class="fb bl"></i><i class="fb w2"></i><i class="fb r2"></i></div>
   The PLACEMENT (position, size, the fade at the bottom) is each surface's own class; this file draws the bands. */
.flag-bands { overflow: hidden; pointer-events: none; opacity: .16; }
/* T-197 (his 13 Oct: "the thai flag doesn't appear everywhere on dark mode as on light mode"): in dark — chosen with the site's button OR
   by the device's own setting (the old rule only knew the button) — the bands are stronger, and the blue band is a lighter navy: the flag's
   own var(--flag-blue) is almost the dark page's colour, so the middle band vanished */
:root[data-theme="dark"] .flag-bands { opacity: .3; }
:root[data-theme="dark"] .flag-bands .bl { background: linear-gradient(180deg, var(--flag-blue-dark-0), var(--flag-blue-dark) 20%, var(--flag-blue-dark) 80%, var(--flag-blue-dark-0)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .flag-bands { opacity: .3; }
  :root:not([data-theme="light"]) .flag-bands .bl { background: linear-gradient(180deg, var(--flag-blue-dark-0), var(--flag-blue-dark) 20%, var(--flag-blue-dark) 80%, var(--flag-blue-dark-0)); }
}
.flag-bands .fb { position: absolute; left: -12%; width: 124%; display: block; transform-origin: 50% 50%; animation: flagWave 24s linear infinite; will-change: transform; }
.flag-bands .r1, .flag-bands .r2 { height: 17%; background: linear-gradient(180deg, var(--flag-red-0), var(--flag-red) 30%, var(--flag-red) 70%, var(--flag-red-0)); }
.flag-bands .w1, .flag-bands .w2 { height: 17%; background: linear-gradient(180deg, var(--flag-white-0), var(--flag-white) 30%, var(--flag-white) 70%, var(--flag-white-0)); }
.flag-bands .bl { height: 34%; background: linear-gradient(180deg, var(--flag-blue-0), var(--flag-blue) 20%, var(--flag-blue) 80%, var(--flag-blue-0)); }
.flag-bands .r1 { top: 0; } .flag-bands .w1 { top: 16.6%; animation-delay: -2.4s; } .flag-bands .bl { top: 33.3%; animation-delay: -4.8s; } .flag-bands .w2 { top: 66.6%; animation-delay: -7.2s; } .flag-bands .r2 { top: 83.3%; animation-delay: -9.6s; }
/* the easing lives on each keyframe (it runs from that keyframe to the next): in = cubic-bezier(.12, 0, .39, 0), out = cubic-bezier(.61, 1, .88, 1) */
@keyframes flagWave {
  0% { transform: translate3d(-1.5%, 0, 0) skewY(-0.5deg); animation-timing-function: cubic-bezier(.12, 0, .39, 0); }
  25% { transform: translate3d(0, 1px, 0) skewY(0deg); animation-timing-function: cubic-bezier(.61, 1, .88, 1); }
  50% { transform: translate3d(1.5%, 0, 0) skewY(0.5deg); animation-timing-function: cubic-bezier(.12, 0, .39, 0); }
  75% { transform: translate3d(0, -1px, 0) skewY(0deg); animation-timing-function: cubic-bezier(.61, 1, .88, 1); }
  100% { transform: translate3d(-1.5%, 0, 0) skewY(-0.5deg); }
}
.flag-bands.paused .fb, .paused .flag-bands .fb { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .flag-bands .fb { animation: none; } }
/* T-512 (0.3.28, his answer 18 Nov to Q2: "can get hidden for now thats fine"): the new look (round 5) shows no flag bands, and the panel's
   light line would sit on top of them. HIDDEN everywhere they are placed (the panel's header, the website's hero and signed-in header), by
   this one rule; the markup, the placement rules and the pause script stay, so bringing them back is deleting this rule */
.flag-bands { display: none !important; }
