/* FatFrank web font, the signal gauge, the tuning wordmark, and the five interference levels.
   data-chaos on <html>: 0 still, 1 steady (default), 2 drift, 3 storm, 4 collapse. */
@font-face { font-family: "FatFrank"; src: url("/fonts/fatfrank.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

/* ---------- hero wordmark: real text, tunes through font "channels" ---------- */
html[data-look="sodium"] .wm { position: relative; width: auto; height: auto; overflow: visible; clip-path: none; font-family: "FatFrank", "League Spartan", "Arial Black", sans-serif; font-weight: 800; letter-spacing: 0; color: var(--bone); text-shadow: 4px 0 0 rgba(238,90,46,.85), -4px 0 0 rgba(124,136,255,.8), 0 0 26px rgba(245,166,35,.28); }
html[data-look="sodium"] .wm-box .wm-svg { display: none !important; }
html[data-look="sodium"] .wm-font { display: block; color: var(--peri); }
html[data-look="sodium"] .wm-font.is-lock { color: var(--sodium); }
.wm-box::after { content: ""; position: absolute; inset: -6% -2%; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: repeating-linear-gradient(0deg, rgba(255,248,230,.17) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(255,248,230,.07) 0 2px, transparent 2px 5px); }
.wm-box.tuning::after { opacity: 1; animation: wmstatic .18s steps(3) infinite; }
@keyframes wmstatic { 0% { background-position: 0 0, 0 0; } 33% { background-position: 0 7px, 13px 0; } 66% { background-position: 0 -5px, -9px 0; } }
.pron small { font-size: .78em; color: var(--ink-dim); letter-spacing: .02em; }

/* ---------- signal gauge ---------- */
.sg { position: relative; }
.sg-btn { display: inline-flex; align-items: center; gap: 8px; font: 600 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; background: transparent; color: var(--ink); border: 1px solid var(--ink-dim); padding: 7px 10px; min-height: 34px; cursor: pointer; }
.sg-btn:hover, .sg-btn[aria-expanded="true"] { border-color: var(--sodium, #f5a623); color: var(--bone); }
.sg-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sg-bars i { width: 3px; background: var(--ink-dim); opacity: .35; }
.sg-bars i:nth-child(1) { height: 4px; } .sg-bars i:nth-child(2) { height: 6px; } .sg-bars i:nth-child(3) { height: 9px; } .sg-bars i:nth-child(4) { height: 12px; } .sg-bars i:nth-child(5) { height: 14px; }
html[data-chaos="0"] .sg-bars i, html[data-chaos="1"] .sg-bars i:nth-child(-n+4), html[data-chaos="2"] .sg-bars i:nth-child(-n+3), html[data-chaos="3"] .sg-bars i:nth-child(-n+2) { background: var(--sodium, #f5a623); opacity: 1; }
html[data-chaos="4"] .sg-bars i:nth-child(1) { background: var(--rust, #ee5a2e); opacity: 1; animation: blink .5s steps(1) infinite; }
.sg-name { min-width: 4.6em; text-align: left; }
.sg-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(290px, 88vw); z-index: 160; background: #070605; border: 1px solid var(--line-warm, #5a3a14); box-shadow: 0 14px 40px rgba(0,0,0,.7), 0 0 40px rgba(245,166,35,.07) inset; padding: 14px 14px 12px; }
.sg-panel[hidden] { display: none; }
@media (max-width: 760px) {
  .sg { position: static; }
  .sg-panel { left: 12px; right: 12px; top: 100%; width: auto; max-width: 340px; }
}
.sg-meter { display: block; width: 100%; height: auto; }
.sg-meter .arc { fill: none; stroke: var(--ink-dim); stroke-width: 2; }
.sg-meter .hot { fill: none; stroke: var(--rust, #ee5a2e); stroke-width: 5; }
.sg-meter .tick { stroke: var(--ink-dim); stroke-width: 1.5; }
.sg-meter text { font: 600 8px var(--mono); fill: var(--ink-dim); letter-spacing: .08em; }
.sg-needle { stroke: var(--sodium, #f5a623); stroke-width: 2.5; stroke-linecap: round; transform-origin: 100px 100px; transform: rotate(var(--sg-a, 45deg)); transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
html[data-chaos="3"] .sg-needle { animation: sgjit .4s steps(2) infinite; }
html[data-chaos="4"] .sg-needle { animation: sgjit .13s steps(2) infinite; stroke: var(--rust, #ee5a2e); }
@keyframes sgjit { 0% { transform: rotate(calc(var(--sg-a) - 5deg)); } 50% { transform: rotate(calc(var(--sg-a) + 6deg)); } }
.sg-read { margin: 2px 0 10px; font: 600 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-align: center; }
.sg-read b { color: var(--sodium, #f5a623); }
.sg-lab { display: block; font: 600 .62rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 4px; }
.sg-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
.sg-range::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--ink-dim), var(--sodium, #f5a623) 55%, var(--rust, #ee5a2e)); }
.sg-range::-moz-range-track { height: 6px; background: linear-gradient(90deg, var(--ink-dim), var(--sodium, #f5a623) 55%, var(--rust, #ee5a2e)); }
.sg-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; margin-top: -10px; background: var(--bone, #fff8e6); border: 2px solid #0b0908; box-shadow: 2px 0 0 var(--rust, #ee5a2e), -2px 0 0 var(--cy, #7c88ff); }
.sg-range::-moz-range-thumb { width: 14px; height: 24px; border-radius: 0; background: var(--bone, #fff8e6); border: 2px solid #0b0908; box-shadow: 2px 0 0 var(--rust, #ee5a2e), -2px 0 0 var(--cy, #7c88ff); }
.sg-ends { display: flex; justify-content: space-between; font: 400 .6rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.sg-quip { margin: 10px 0 0; font: 400 .78rem/1.45 var(--type, "Special Elite", monospace); color: var(--ink); min-height: 3.4em; }
#sg-restore { position: fixed; right: 14px; bottom: 14px; z-index: 260; display: none; font: 600 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #0b0908; background: var(--sodium, #f5a623); border: 0; padding: 10px 12px; min-height: 40px; cursor: pointer; box-shadow: 3px 0 0 var(--rust, #ee5a2e), -3px 0 0 var(--cy, #7c88ff); }
html[data-chaos="3"] #sg-restore, html[data-chaos="4"] #sg-restore { display: block; }
#ch-msg { position: fixed; left: 14px; bottom: 14px; z-index: 260; display: none; max-width: min(60vw, 420px); font: 600 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--rust, #ee5a2e); background: rgba(5,4,3,.9); border: 1px solid var(--rust, #ee5a2e); padding: 8px 10px; pointer-events: none; }
html[data-chaos="4"] #ch-msg { display: block; }

/* ---------- level 1, steady: the calm default ---------- */
html[data-chaos="1"] .loop.strobe.on::after { display: none; }
html[data-chaos="1"] .fx-scratch { opacity: .45; }

/* ---------- level 3, storm ---------- */
html[data-chaos="3"] main, html[data-chaos="4"] main { overflow-x: clip; }
html[data-chaos="3"] h2, html[data-chaos="4"] h2, html[data-chaos="4"] h3, html[data-chaos="4"] .nav-mark { animation: ch-split 2.6s steps(1) infinite; }
html[data-chaos="4"] h2, html[data-chaos="4"] h3, html[data-chaos="4"] .nav-mark { animation-duration: .9s; }
@keyframes ch-split { 0%, 100% { text-shadow: 2px 0 0 rgba(238,90,46,.6), -2px 0 0 rgba(124,136,255,.55); transform: none; } 40% { text-shadow: 9px 0 0 rgba(238,90,46,.9), -9px 0 0 rgba(124,136,255,.9); transform: translateX(-3px); } 43% { text-shadow: -6px 2px 0 rgba(238,90,46,.9), 6px -2px 0 rgba(124,136,255,.9); transform: translateX(4px) skewX(-6deg); } 46% { text-shadow: 2px 0 0 rgba(238,90,46,.6), -2px 0 0 rgba(124,136,255,.55); transform: none; } }
html[data-chaos="3"] main > section:nth-of-type(odd) { animation: ch-sway 7s ease-in-out infinite; }
html[data-chaos="3"] main > section:nth-of-type(even) { animation: ch-sway 9s ease-in-out infinite reverse; }
@keyframes ch-sway { 0%, 100% { transform: none; } 50% { transform: skewX(-.5deg) translateX(3px); } }
html[data-chaos="3"] .hero-bg { opacity: .34; }
html[data-chaos="3"] .fx-scratch, html[data-chaos="4"] .fx-scratch { animation-duration: .9s; }

/* ---------- level 4, collapse ---------- */
html[data-chaos="4"] main { animation: ch-quake .45s steps(2) infinite; }
@keyframes ch-quake { 0% { transform: translate(1px, -1px); } 50% { transform: translate(-2px, 1px); } }
html[data-chaos="4"] main > section, html[data-chaos="4"] main > header { animation: ch-tilt 3.1s steps(1) infinite; }
html[data-chaos="4"] main > section:nth-of-type(2n) { animation-delay: -1.1s; animation-duration: 2.3s; }
html[data-chaos="4"] main > section:nth-of-type(3n) { animation-delay: -2s; animation-duration: 3.7s; }
@keyframes ch-tilt { 0%, 100% { transform: none; filter: none; } 18% { transform: rotate(-.7deg) translateX(-10px); } 22% { transform: none; } 47% { transform: skewX(2.5deg) translateX(12px); filter: hue-rotate(40deg) saturate(1.6); } 52% { transform: none; filter: none; } 78% { transform: rotate(.5deg) scaleY(1.015); filter: hue-rotate(-30deg); } 81% { transform: none; filter: none; } }
html[data-chaos="4"] main img { animation: ch-hue 1.7s steps(4) infinite; }
@keyframes ch-hue { 0% { filter: grayscale(1) sepia(1) saturate(3) hue-rotate(-20deg) contrast(1.4); } 25% { filter: grayscale(1) sepia(1) saturate(2) hue-rotate(190deg) contrast(1.3); } 50% { filter: grayscale(1) contrast(1.9); } 75% { filter: grayscale(1) sepia(1) saturate(4) hue-rotate(-40deg) contrast(1.5) brightness(.8); } }
html[data-chaos="4"] .hero-bg { opacity: .5; }
html[data-chaos="4"] .foot-spin { animation: ch-spinwild .7s steps(6) infinite; }
@keyframes ch-spinwild { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.2); } 100% { transform: rotate(360deg) scale(1); } }
.ch-tear { transform: translateX(var(--tx, 12px)) !important; clip-path: inset(var(--c1, 10%) 0 var(--c2, 30%) 0); filter: drop-shadow(4px 0 0 var(--mag, #ee5a2e)) drop-shadow(-4px 0 0 var(--cy, #7c88ff)); }
.ch-inv { filter: invert(1) hue-rotate(180deg) !important; }

@media (prefers-reduced-motion: reduce) {
  .wm-box.tuning::after, .sg-needle, html[data-chaos] main, html[data-chaos] main > section, html[data-chaos] main > header, html[data-chaos] main img, html[data-chaos] h2, html[data-chaos] h3, html[data-chaos] .nav-mark, html[data-chaos] .foot-spin { animation: none !important; }
}