/* The Question Lab — shared brand styles */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --tql-bg: #0B0B0F;
  --tql-bg-2: #111114;
  --tql-line: #1c1c22;
  --tql-line-2: #2a2a32;
  --tql-cool: #EDEDED;
  --tql-mid: #7A7A7A;
  --tql-mid-2: #4a4a52;
  --tql-accent: #C6FF00;
  --tql-accent-dim: #8aae00;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

.tql-root {
  font-family: var(--font-display);
  background: var(--tql-bg);
  color: var(--tql-cool);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

/* Subtle grid background */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

.bg-grid-fine {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Noise overlay */
.noise::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78 0 0 0 0 0.78 0 0 0 0 0.78 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Scanlines */
.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 2;
}

/* Glitch text utility */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  pointer-events: none;
}
.glitch::before {
  color: var(--tql-accent);
  transform: translate(-1px, 0);
  mix-blend-mode: screen;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  animation: glitch-a 4s steps(1) infinite;
}
.glitch::after {
  color: #ff00aa;
  transform: translate(1px, 0);
  mix-blend-mode: screen;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
  animation: glitch-b 5s steps(1) infinite;
}
@keyframes glitch-a {
  0%, 92%, 100% { transform: translate(0,0); opacity:0; }
  93% { transform: translate(-2px, 1px); opacity:.6; }
  94% { transform: translate(1px, -1px); opacity:.4; }
  95% { transform: translate(-1px, 0); opacity:.7; }
  96% { transform: translate(0,0); opacity:0; }
}
@keyframes glitch-b {
  0%, 88%, 100% { transform: translate(0,0); opacity:0; }
  89% { transform: translate(2px,-1px); opacity:.5; }
  91% { transform: translate(-1px,1px); opacity:.6; }
}

/* Scrollbar hide for marquees */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  display: inline-flex;
  animation: marquee 60s linear infinite;
  white-space: nowrap;
}

/* Blinking caret */
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.caret { display: inline-block; width: 0.55em; height: 1em; vertical-align: text-bottom; background: currentColor; animation: blink 1s steps(1) infinite; margin-left: 4px; }

/* Question stream cycle */
@keyframes q-fade {
  0%, 18% { opacity: 1; transform: translateY(0); filter: blur(0); }
  22%, 100% { opacity: 0; transform: translateY(-12px); filter: blur(4px); }
}

/* Signal interference shimmer */
@keyframes signal {
  0%, 100% { transform: translateY(0); opacity:.3; }
  50% { transform: translateY(-2px); opacity:.6; }
}

/* Pulse */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.pulse { animation: pulse-dot 1.6s ease-in-out infinite; }

/* Util classes */
.tql-h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.9; }
.tql-h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; line-height: 0.95; }
.tql-eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; color: var(--tql-mid); }
.tql-meta { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.15em; font-size: 10px; color: var(--tql-mid); }

.accent { color: var(--tql-accent); }
.bg-accent { background: var(--tql-accent); color: #0B0B0F; }

.divider { height: 1px; background: var(--tql-line); width: 100%; }

/* Hover underline grow */
.link-line { position: relative; display: inline-block; }
.link-line::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0.3);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.link-line:hover::after { transform: scaleX(1); }

/* Card hover */
.ep-card { transition: transform .35s cubic-bezier(.2,.7,.3,1); }
.ep-card:hover { transform: translateY(-2px); }
.ep-card .ep-img { transition: transform .8s cubic-bezier(.2,.7,.3,1), filter .35s; filter: grayscale(0.2) contrast(1.05); }
.ep-card:hover .ep-img { transform: scale(1.04); filter: grayscale(0) contrast(1.1); }

/* Terminal cursor block */
.term-cursor { display: inline-block; width: 10px; height: 22px; background: var(--tql-accent); margin-left: 4px; vertical-align: middle; animation: blink 1s steps(1) infinite; }
