/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ── BLUE PALETTE (replacing the original green) ── */
  --blue-primary:   #38bdf8;   /* sky-400 — main accent */
  --blue-bright:    #7dd3fc;   /* sky-300 — hover / highlight */
  --blue-dim:       #0ea5e9;   /* sky-500 — slightly deeper */
  --blue-muted:     #7dd3fccc; /* sky-300 80% — tagline */
  --blue-faint:     #7dd3fc99; /* sky-300 60% — subtle */
  --blue-glow:      rgba(56, 189, 248, 0.55);
  --blue-dot:       rgba(14, 165, 233, 0.45);
  --blue-separator: rgba(56, 189, 248, 0.3);

  /* Fonts */
  --font-mono: 'Martian Mono', 'JetBrains Mono', 'Courier New', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:   180ms var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════
   BASE RESET
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100dvh;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-mono);
  background: #000;
  color: var(--blue-primary);
  position: relative;
  cursor: default;
}

img, canvas { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
a { color: inherit; text-decoration: none; }

::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--blue-bright);
}

:focus-visible {
  outline: 1px solid var(--blue-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   TICKER MARQUEE
═══════════════════════════════════════════════════════════ */
.ticker-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  overflow: hidden;
  height: 2.2rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--blue-separator);
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 55s linear infinite;
  gap: var(--space-4);
  will-change: transform;
}

.ticker-item {
  font-size: var(--text-xs);
  color: var(--blue-primary);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.ticker-accent {
  color: var(--blue-bright);
  font-weight: 600;
}

.ticker-dot {
  color: var(--blue-dot);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════════════
   SOCIAL ICONS — TOP LEFT
═══════════════════════════════════════════════════════════ */
.social-icons {
  position: fixed;
  top: 3.2rem;
  left: var(--space-6);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-primary);
  transition: color var(--t-fast), transform var(--t-fast), filter var(--t-fast);
  line-height: 1;
}

.social-link svg {
  width: 22px;
  height: 22px;
}

.social-link:hover {
  color: var(--blue-bright);
  transform: scale(1.25);
  filter: drop-shadow(0 0 8px var(--blue-glow));
}

/* ═══════════════════════════════════════════════════════════
   MUSIC PLAYER — TOP RIGHT
═══════════════════════════════════════════════════════════ */
.music-player {
  position: fixed;
  top: 3.2rem;
  right: var(--space-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.music-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--blue-faint);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  transition: color var(--t-fast);
}

.music-toggle:hover {
  color: var(--blue-primary);
}

.music-note {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; text-shadow: none; }
  50% { opacity: 1; text-shadow: 0 0 12px var(--blue-glow); }
}

.music-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}

.music-controls.visible {
  opacity: 1;
  pointer-events: auto;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-primary);
  transition: color var(--t-fast), transform var(--t-fast);
  padding: var(--space-1);
}

.ctrl-btn svg {
  width: 16px;
  height: 16px;
}

.ctrl-btn:hover {
  color: var(--blue-bright);
  transform: scale(1.2);
}

/* Sound bars */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.sound-bars.playing {
  opacity: 1;
}

.bar {
  display: block;
  width: 3px;
  background: var(--blue-primary);
  border-radius: 1px;
  animation: sound-bar 1.2s ease-in-out infinite alternate;
  animation-delay: var(--d);
  min-height: 4px;
}

@keyframes sound-bar {
  from { height: 4px; opacity: 0.4; }
  to   { height: 18px; opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   CANVAS STAGE — FULL VIEWPORT
═══════════════════════════════════════════════════════════ */
.canvas-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.35;
}

#asciiCanvas {
  position: relative;
  z-index: 2;
  max-height: 88dvh;
  max-width: 80vw;
  margin-top: 2.2rem;
  /* cursor set by JS */
}

/* ═══════════════════════════════════════════════════════════
   CYCLING TITLE — BOTTOM LEFT
═══════════════════════════════════════════════════════════ */
.title-display {
  position: fixed;
  bottom: var(--space-10);
  left: var(--space-6);
  z-index: 100;
  overflow: hidden;
  height: calc(var(--text-xl) * 1.3);
}

.title-inner {
  transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
}

.title-text {
  display: block;
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--blue-primary);
  letter-spacing: -0.025em;
  line-height: 1.3;
  text-shadow: 0 0 30px var(--blue-glow);
}

/* ═══════════════════════════════════════════════════════════
   TAGLINE — BOTTOM RIGHT
═══════════════════════════════════════════════════════════ */
.tagline {
  position: fixed;
  bottom: var(--space-10);
  right: var(--space-6);
  z-index: 100;
  font-size: var(--text-sm);
  color: var(--blue-muted);
  line-height: 1.6;
  text-align: right;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.pplx-credit {
  font-size: var(--text-xs);
  color: var(--blue-separator);
  transition: color var(--t-fast);
  white-space: nowrap;
}

.pplx-credit:hover {
  color: var(--blue-faint);
}

/* ═══════════════════════════════════════════════════════════
   SCROLL HINT
═══════════════════════════════════════════════════════════ */
.scroll-hint {
  position: fixed;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.6rem;
  color: var(--blue-faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.1em;
  animation: fade-hint 3s ease-in-out 2s forwards;
  opacity: 0;
}

@keyframes fade-hint {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .social-icons { gap: var(--space-3); }
  .social-link svg { width: 18px; height: 18px; }
  .title-text { font-size: var(--text-lg); }
  .tagline {
    font-size: 0.65rem;
    right: var(--space-3);
    bottom: var(--space-16);
    max-width: 50vw;
  }
  .title-display {
    left: var(--space-4);
    bottom: var(--space-16);
  }
}

/* ═══════════════════════════════════════════════════════════
   VIGNETTE OVERLAY
═══════════════════════════════════════════════════════════ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}
