/* CSS Custom Properties */
:root {
  --bg: #0a0a0a;
  --text-dark: #131313;
  --text-hover: #ffffff;
  --row-height: 11vh;
  --font-size: clamp(90px, 14vh, 180px);
  --glow-size: 300px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  background: var(--bg);
}

/* Main container */
.container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Each row of scrolling text */
.text-row {
  display: flex;
  white-space: nowrap;
  height: var(--row-height);
  align-items: center;
  position: relative;
  overflow: hidden;
  user-select: none;
  width: 100vw;
  margin: -0.5vh 0;
}

/* The inner track that moves */
.text-track {
  display: flex;
  will-change: transform;
  position: absolute;
  left: 0;
}

/* Individual phrase */
.phrase {
  font-size: var(--font-size);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-dark);
  padding: 0 0.15em;
  position: relative;
  line-height: 0.85;
  pointer-events: auto;
  transition: color 0.1s ease-out;
}


/* Individual characters */
.char {
  display: inline-block;
  transition: transform 0.15s ease-out, color 0.1s ease-out;
  color: inherit;
}

/* Hover state - text lights up */
.phrase:hover {
  color: var(--text-hover);
}

/* Cursor glow follower */
.cursor-glow {
  position: fixed;
  width: var(--glow-size);
  height: var(--glow-size);
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(255,255,255,0.15) 0%,
    rgba(255,255,255,0.08) 25%,
    rgba(255,255,255,0.03) 50%,
    transparent 70%
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1000;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(2px);
}

.cursor-glow.visible {
  opacity: 1;
}

/* Subtle vignette overlay */
.container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.6) 100%
  );
  pointer-events: none;
  z-index: 10;
}

/* Scanline effect */
.container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 11;
  opacity: 0.3;
}

/* Control Panel */
.controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 400;
}

.controls-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #333;
  background: #111;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.controls-toggle:hover {
  background: #222;
  color: #fff;
  border-color: #555;
}

.controls-panel {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  min-width: 220px;
}

.controls.open .controls-panel {
  display: block;
}

.controls-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.controls-panel label:last-child {
  margin-bottom: 0;
}

.controls-panel input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  cursor: pointer;
}

.controls-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.controls-panel .value {
  color: #888;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --row-height: 60px;
    --font-size: 48px;
    --glow-size: 200px;
  }
}

@media (max-width: 480px) {
  :root {
    --row-height: 45px;
    --font-size: 36px;
    --glow-size: 150px;
  }
}
