/* Headline treatments for the reel landing pages. A page picks one with `reel.type` in shop-items.json:
   glitch | gradient | ascii | distort | bevel. Each one is plain CSS/SVG on real text, so it stays sharp,
   selectable and tiny. Loaded only on reel pages; the fonts are subsets of Inter, Poppins and DM Mono (all OFL). */
@font-face { font-family: "Reel Grotesk"; src: url("/assets/reel-kit/fonts/reel-inter-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Reel Poppins"; src: url("/assets/reel-kit/fonts/reel-poppins-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Reel Poppins"; src: url("/assets/reel-kit/fonts/reel-poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Reel Mono"; src: url("/assets/reel-kit/fonts/reel-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

.rt { position: relative; }
.rt .rt-face { display: block; }

/* ---------- glitch: a clean sliced headline, with a short signal burst every few seconds ---------- */
html.is-reel .reel-h1.rt-glitch { font-family: "Reel Grotesk", "Inter", "Helvetica Neue", Arial, sans-serif !important; font-weight: 900; letter-spacing: -.035em; line-height: .96; text-shadow: none; }
.rt-glitch::before, .rt-glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; font: inherit; letter-spacing: inherit; line-height: inherit; }
/* a permanent hairline slice: one band of the headline is nudged sideways, like a cut in the tape */
.rt-glitch::before { color: #fff; clip-path: inset(41% 0 47% 0); transform: translateX(.07em); animation: rt-slice 6.5s steps(1, end) infinite; }
.rt-glitch::after { color: var(--reel-accent); mix-blend-mode: screen; opacity: 0; clip-path: inset(0 0 100% 0); animation: rt-burst 6.5s steps(1, end) infinite; }
@keyframes rt-slice {
  0%, 84%, 100% { clip-path: inset(41% 0 47% 0); transform: translateX(.07em); }
  86% { clip-path: inset(12% 0 74% 0); transform: translateX(-.09em); }
  88% { clip-path: inset(63% 0 22% 0); transform: translateX(.12em); }
  90% { clip-path: inset(30% 0 58% 0); transform: translateX(-.05em); }
  93% { clip-path: inset(74% 0 12% 0); transform: translateX(.08em); }
  96% { clip-path: inset(41% 0 47% 0); transform: translateX(.07em); }
}
@keyframes rt-burst {
  0%, 85%, 97%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  86% { opacity: .9; clip-path: inset(20% 0 66% 0); transform: translateX(-.06em); }
  89% { opacity: .9; clip-path: inset(55% 0 30% 0); transform: translateX(.05em); }
  92% { opacity: .9; clip-path: inset(8% 0 80% 0); transform: translateX(-.04em); }
  95% { opacity: .9; clip-path: inset(70% 0 18% 0); transform: translateX(.06em); }
}

/* ---------- gradient: blue into orange, set in Poppins ---------- */
html.is-reel .reel-h1.rt-gradient { font-family: "Reel Poppins", "Poppins", "Inter", system-ui, sans-serif !important; font-weight: 800; letter-spacing: -.04em; line-height: 1.02; text-shadow: none; }
.rt-gradient .rt-face {
  color: transparent; -webkit-text-fill-color: transparent;
  width: fit-content; background: linear-gradient(100deg, #2f6bff 0%, #6aa2ff 30%, #c9d8ff 46%, #ffd0a6 58%, #ff9448 80%, #ff6a1a 100%) 0 0 / 130% 100%;
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 6px 28px rgba(0, 0, 0, .5));
  animation: rt-sweep 9s ease-in-out infinite alternate;
}
@keyframes rt-sweep { from { background-position: 0 0; } to { background-position: 100% 0; } }

/* ---------- ascii: monospaced, decoding from a character ramp ---------- */
html.is-reel .reel-h1.rt-ascii { font-family: "Reel Mono", "DM Mono", ui-monospace, Consolas, monospace !important; font-weight: 400; font-size: clamp(34px, 6.2vw, 78px); letter-spacing: -.045em; line-height: 1.08; text-shadow: 0 0 34px color-mix(in srgb, var(--reel-accent) 55%, transparent); }
.rt-ascii .rt-face::after { content: ""; display: inline-block; width: .5em; height: .86em; margin-left: .08em; vertical-align: -.08em; background: var(--reel-accent); animation: rt-caret 1.05s steps(1, end) infinite; }
.rt-ascii::after { content: "@%#*+=-:.  .:-=+*#%@@%#*+=-:.  .:-=+*#%@"; display: block; margin-top: .4em; font-size: .26em; letter-spacing: .12em; white-space: nowrap; overflow: hidden; color: var(--reel-accent); opacity: .7;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 85%); mask-image: linear-gradient(90deg, #000, transparent 85%); text-shadow: none; }
@keyframes rt-caret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* ---------- distort: a slight liquid wobble through an SVG displacement map ---------- */
html.is-reel .reel-h1.rt-distort { font-family: "Reel Grotesk", "Inter", "Helvetica Neue", Arial, sans-serif !important; font-weight: 900; letter-spacing: -.03em; line-height: .98; }
.rt-distort .rt-word { display: inline-block; white-space: nowrap; }
.rt-distort .rt-ch { display: inline-block; transform-origin: 50% 80%; animation: rt-ripple 4.2s ease-in-out infinite; will-change: transform; }
@keyframes rt-ripple {
  0%, 100% { transform: translateY(.012em) skewX(-2.5deg) scale(1, .985); }
  50% { transform: translateY(-.026em) skewX(3deg) scale(1.01, 1.03); }
}

/* ---------- bevel: slightly 3D, raised edges and a short extrusion ---------- */
html.is-reel .reel-h1.rt-bevel { font-family: "Reel Poppins", "Poppins", "Inter", system-ui, sans-serif !important; font-weight: 800; letter-spacing: -.035em; line-height: 1.02; text-shadow: none; transform-style: preserve-3d; transition: transform .25s ease-out; }
.rt-bevel::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; font: inherit; letter-spacing: inherit; line-height: inherit; color: transparent; pointer-events: none;
  text-shadow: .012em .012em 0 #2a3347, .024em .024em 0 #232b3d, .036em .036em 0 #1c2333, .048em .048em 0 #161c29, .055em .075em .2em rgba(0, 0, 0, .5); }
.rt-bevel .rt-face { color: transparent; -webkit-text-fill-color: transparent; background: linear-gradient(180deg, #eef2f9 0%, #c3cde0 48%, #8f9fbd 100%); -webkit-background-clip: text; background-clip: text; filter: url(#rt-bevel); }

@media (prefers-reduced-motion: reduce) {
  .rt-glitch::before, .rt-glitch::after, .rt-gradient .rt-face, .rt-ascii .rt-face::after, .rt-distort .rt-ch { animation: none; }
  .rt-glitch::after { display: none; }
}
