/* ═══════════════════════════════════════════════════
   RYTHMIX — Bemani-inspired personal site theme
   Palette: Deep navy / cyan / electric blue
═══════════════════════════════════════════════════ */

:root {
  --bg:        #03070f;
  --bg2:       #070d1a;
  --bg3:       #0a1428;
  --cyan:      #00d4ff;
  --cyan-dim:  #0099bb;
  --cyan-glow: rgba(0, 212, 255, 0.18);
  --blue:      #0055cc;
  --text:      #c8e8f8;
  --text-dim:  #6a9ab8;
  --border:    rgba(0, 212, 255, 0.25);
  --border-hi: rgba(0, 212, 255, 0.6);
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --font-head: 'Orbitron', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Scan lines ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.12) 3px,
    rgba(0,0,0,0.12) 4px
  );
}

/* ── Animated grid bg ── */
.grid-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
  animation: gridScroll 20s linear infinite;
}
@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

/* ── Utility ── */
a { text-decoration: none; color: inherit; }

/* ═══════════════════ HEADER ═══════════════════ */
.site-header {
  position: relative;
  z-index: 10;
  padding: 0 0 3rem;
  border-bottom: 1px solid var(--border-hi);
  box-shadow: 0 1px 40px var(--cyan-glow);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 2rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan-dim);
  letter-spacing: 0.12em;
}

#bpm-counter {
  font-size: 1.1rem;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
}

/* ── Hero ── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: 900px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}

.hero-accent-line {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80%;
  background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
  filter: blur(1px);
}

/* ── Avatar ── */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: none;
  display: block;
  filter: saturate(0.9) contrast(1.1);
  transition: filter 0.3s ease;
}
.avatar:hover { filter: saturate(1.2) contrast(1.1) drop-shadow(0 0 12px var(--cyan)); }

.avatar-ring {
  position: absolute;
  inset: -6px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 2px solid var(--cyan);
  opacity: 0.6;
  animation: ringPulse 2.4s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.03); }
}

/* ── Hero text ── */
.hero-text { flex: 1; }

.hero-handle {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.handle-prefix {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--cyan-dim);
}
.handle {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 0 0 30px rgba(0,212,255,0.5), 0 0 60px rgba(0,212,255,0.2);
  line-height: 1;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan-dim);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.location {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.label {
  background: var(--cyan);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  letter-spacing: 0.08em;
}

/* ── Turntable ── */
.turntable-wrap {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
}
.turntable {
  width: 90px;
  height: 90px;
  animation: turntableSpin 2s linear infinite;
  transform-origin: center center;
  filter:
    drop-shadow(0 0 8px rgba(0, 212, 255, 0.55))
    drop-shadow(0 0 20px rgba(0, 212, 255, 0.2));
}
@keyframes turntableSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════ MAIN ═══════════════════ */
main {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* ── Section chrome ── */
.section { margin-top: 4rem; }

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.1em;
}
.section-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan);
}
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-hi), transparent);
}

/* ═══════════════════ NOW PLAYING ═══════════════════ */
.now-playing {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 2rem;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.np-playpause {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: none;
  border: 1px solid var(--border-hi);
  color: var(--cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.np-playpause:hover {
  background: var(--cyan);
  color: var(--bg);
}
.np-playpause svg {
  width: 0.75rem;
  height: 0.75rem;
}

.np-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 0;
}
.np-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  line-height: 1;
}
.np-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  letter-spacing: 0.04em;
}

.np-progress-wrap {
  flex: 1;
  height: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.np-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  transition: width 0.25s linear;
  pointer-events: none;
}

.np-time {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.np-select {
  margin-top: 4px;
  max-width: 200px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  outline: none;
}
.np-select:focus,
.np-select:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ═══════════════════ SOCIAL ═══════════════════ */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.social-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cyan);
  transform: scaleY(0);
  transition: transform 0.2s ease;
  transform-origin: bottom;
}
.social-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 24px var(--cyan-glow), inset 0 0 24px rgba(0,212,255,0.03);
  transform: translateX(4px);
}
.social-card:hover::before { transform: scaleY(1); }

.social-icon {
  width: 38px; height: 38px;
  color: var(--cyan);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.social-icon svg { width: 100%; height: 100%; }

.social-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.social-platform {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
}
.social-handle {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.social-arrow {
  font-size: 1.2rem;
  color: var(--cyan-dim);
  transition: color 0.2s, transform 0.2s;
}
.social-card:hover .social-arrow {
  color: var(--cyan);
  transform: translateX(4px);
}

/* ═══════════════════ BIO ═══════════════════ */
.bio-panel {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 2rem 2.5rem;
}
.bio-corner {
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--cyan);
  border-style: solid;
}
.bio-corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.bio-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.bio-corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.bio-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.bio-text {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 2rem;
  font-weight: 400;
}

.bio-stats {
  display: flex;
  gap: 0;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.stat-val {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
  letter-spacing: 0.1em;
}
.stat-key {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}
.stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ═══════════════════ GITHUB ═══════════════════ */
.github-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}
.github-img-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.github-img-wrap:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.github-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* ═══════════════════ GALLERY ═══════════════════ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.8) brightness(0.9);
  transition: transform 0.4s ease, filter 0.4s ease;
}
.gallery-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  background: rgba(0,0,0,0.6);
  padding: 0.1rem 0.4rem;
  letter-spacing: 0.1em;
}

/* ═══════════════════ LIGHTBOX ═══════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 15, 0.92);
  backdrop-filter: blur(4px);
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border-hi);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
  background: var(--bg2);
  animation: fadeUp 0.2s ease both;
}

.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 2rem;
  height: 2rem;
  background: var(--cyan);
  color: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover {
  background: #fff;
}

.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  padding: 0.4rem 0.8rem;
  align-self: flex-start;
}

/* ═══════════════════ FOOTER ═══════════════════ */
.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
}
.footer-bar {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  background: var(--bg2);
}
.footer-tag {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .hero-handle { justify-content: center; }
  .hero-accent-line { display: none; }
  .turntable-wrap { display: none; }
  .bio-panel { padding: 1.4rem; }
}

/* ── Page load animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.site-header  { animation: fadeUp 0.6s ease both; }
.section      { animation: fadeUp 0.6s ease both; }
.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
