/*
Theme Name: Portfolio Device
Author: Your Name
Version: 1.0
Description: A custom WordPress theme converted from index.html.
*/
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700;900&display=swap');

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

:root {
  --bg: #0a0a0f;
  --fg: #e0e0e8;
  --accent: #00ffaa;
  --accent2: #ff3366;
  --accent3: #6633ff;
  --dim: #2a2a3a;
  --mono: 'Space Mono', monospace;
  --display: 'Orbitron', sans-serif;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow-x: hidden;
  cursor: crosshair;
}

/* --- LOADING SCREEN --- */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s, visibility 0.8s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader .bar-track {
  width: 300px; height: 3px; background: var(--dim);
  border-radius: 2px; overflow: hidden; margin-top: 24px;
}
#loader .bar-fill {
  height: 100%; width: 0%; background: var(--accent);
  transition: width 0.3s;
}
#loader .label {
  font-family: var(--display); font-size: 11px;
  letter-spacing: 6px; color: var(--accent); margin-top: 12px;
  text-transform: uppercase;
}
.glitch-title {
  font-family: var(--display); font-size: clamp(28px, 5vw, 48px);
  font-weight: 900; color: var(--fg); position: relative;
  text-transform: uppercase; letter-spacing: 4px;
}
.glitch-title::before, .glitch-title::after {
  content: attr(data-text); position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; overflow: hidden;
}
.glitch-title::before {
  color: var(--accent2); clip-path: inset(0 0 60% 0);
  animation: glitch1 2.5s infinite linear alternate-reverse;
}
.glitch-title::after {
  color: var(--accent); clip-path: inset(40% 0 0 0);
  animation: glitch2 2.5s infinite linear alternate-reverse;
}
@keyframes glitch1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-1px, 3px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
@keyframes glitch2 {
  0% { transform: translate(0); }
  20% { transform: translate(2px, -3px); }
  40% { transform: translate(-2px, 1px); }
  60% { transform: translate(3px, -2px); }
  80% { transform: translate(-3px, 3px); }
  100% { transform: translate(0); }
}

/* --- WEBGL CANVAS --- */
#webgl-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

/* --- NAVIGATION --- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 40px;
  display: flex; justify-content: space-between; align-items: center;
  mix-blend-mode: difference;
}
nav .logo {
  font-family: var(--display); font-size: 14px; font-weight: 700;
  letter-spacing: 6px; text-transform: uppercase; color: var(--fg);
}
nav .nav-links { display: flex; gap: 28px; }
nav .nav-links a {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--fg); text-decoration: none;
  transition: color 0.3s;
}
nav .nav-links a:hover { color: var(--accent); }

/* --- SECTIONS --- */
section {
  position: relative; z-index: 1;
  min-height: 100vh; padding: 120px 60px;
  display: flex; flex-direction: column; justify-content: center;
}

/* --- HERO --- */
#hero {
  align-items: center; text-align: center;
}
#hero h1 {
  font-family: var(--display); font-size: clamp(40px, 8vw, 100px);
  font-weight: 900; line-height: 1.05;
  text-transform: uppercase; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0; transform: translateY(40px);
}
#hero .subtitle {
  font-size: 13px; letter-spacing: 8px; text-transform: uppercase;
  color: var(--accent); margin-top: 20px;
  opacity: 0; transform: translateY(20px);
}
#hero .scroll-hint {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--dim); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* --- SOUND PAD --- */
#sound-section { align-items: center; }
#sound-section h2 {
  font-family: var(--display); font-size: 12px;
  letter-spacing: 8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 40px;
}

/* instructions box */
#instructions {
  max-width: 700px; margin: 0 auto 32px; padding: 16px;
  background: rgba(0, 255, 170, 0.05);
  border: 1px solid var(--dim); border-radius: 8px;
}
.instructions-label {
  font-size: 11px; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 12px;
  text-transform: uppercase;
}
.instructions-text {
  font-size: 10px; line-height: 1.8;
  color: rgba(224, 224, 232, 0.8);
}

/* loop/metronome status and controls */
#loop-status {
  text-align: center;
  font-size: 10px; color: var(--dim); margin-bottom: 12px;
}
#controls-row {
  text-align: center; margin-bottom: 24px;
}
.controls-group {
  display: inline-block; margin-bottom: 12px; margin-right: 16px;
}
.controls-group label {
  font-size: 10px; letter-spacing: 2px; margin-right: 8px;
}
#instr, #tempo-slider, #volume-slider {
  background: rgba(255,255,255,0.02);
  color: var(--fg);
  border: 1px solid var(--dim);
  padding: 4px 8px;
  border-radius: 4px;
}
#tempo-slider, #volume-slider {
  width: 120px; vertical-align: middle;
}

.sound-pad {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; max-width: 520px; width: 100%;
}
.pad-btn {
  aspect-ratio: 1; border: 1px solid var(--dim);
  background: rgba(255,255,255,0.02);
  border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim); transition: all 0.15s;
  position: relative; overflow: hidden;
  user-select: none;
}
.pad-btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, currentColor, transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.pad-btn:hover { border-color: var(--accent); color: var(--accent); }
.pad-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: rgba(0, 255, 170, 0.05);
  box-shadow: 0 0 30px rgba(0, 255, 170, 0.15),
              inset 0 0 30px rgba(0, 255, 170, 0.05);
}
.pad-btn.active::after { opacity: 0.1; }
/* drum pads get a different accent color */
.pad-drum { border-color: rgba(255, 51, 102, 0.2); }
.pad-drum:hover { border-color: var(--accent2); color: var(--accent2); }
.pad-drum.active {
  border-color: var(--accent2); color: var(--accent2);
  background: rgba(255, 51, 102, 0.05);
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.15),
              inset 0 0 30px rgba(255, 51, 102, 0.05);
}
.pad-key {
  font-family: var(--display); font-size: 18px; font-weight: 700;
}
.pad-label { font-size: 8px; opacity: 0.6; }

.sound-info {
  margin-top: 24px; font-size: 10px; color: var(--dim);
  letter-spacing: 3px; text-transform: uppercase;
}

/* step sequencer */
#step-sequencer-container {
  margin-top: 24px; text-align: center;
}
#step-sequencer {
  display: inline-grid;
  grid-template-columns: repeat(16, minmax(20px, 1fr));
  gap: 2px;
}
.step-btn {
  width: 20px; height: 20px;
  border: 1px solid var(--dim);
  background: rgba(255,255,255,0.01);
  cursor: pointer; border-radius: 2px;
  transition: all 0.15s;
}
.step-btn:hover { border-color: var(--accent); }
.step-btn.active {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.3);
}

/* control buttons */
#control-buttons {
  margin-top: 20px; text-align: center;
}
.control-btn {
  background: rgba(255,255,255,0.02);
  color: var(--fg);
  border: 1px solid var(--dim);
  padding: 6px 16px; margin: 0 4px;
  border-radius: 4px; cursor: pointer;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 1px;
  transition: all 0.2s;
}
.control-btn:hover {
  border-color: var(--accent); color: var(--accent);
}

/* --- VISUALIZER BAR --- */
#visualizer {
  width: 100%; max-width: 520px; height: 60px;
  margin-top: 20px; display: flex; align-items: flex-end;
  gap: 2px;
}
#visualizer .vbar {
  flex: 1; background: var(--accent); min-height: 2px;
  border-radius: 1px 1px 0 0; transition: height 0.05s;
  opacity: 0.7;
}

/* --- PROJECTS --- */
#projects h2 {
  font-family: var(--display); font-size: 12px;
  letter-spacing: 8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 60px;
}
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; max-width: 1100px; width: 100%;
}
.project-card {
  border: 1px solid var(--dim); border-radius: 12px;
  padding: 32px; background: rgba(255,255,255,0.01);
  transition: all 0.4s; position: relative; overflow: hidden;
  opacity: 0; transform: translateY(40px);
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  opacity: 0; transition: opacity 0.4s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 255, 170, 0.08);
}
.project-card:hover::before { opacity: 1; }
.project-card .p-number {
  font-family: var(--display); font-size: 36px; font-weight: 900;
  color: var(--dim); line-height: 1; margin-bottom: 16px;
}
.project-card h3 {
  font-family: var(--display); font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px;
}
.project-card p {
  font-size: 13px; line-height: 1.7; color: rgba(224, 224, 232, 0.6);
}
.project-card .tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px;
}
.project-card .tag {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 10px; border: 1px solid var(--dim);
  border-radius: 20px; color: var(--dim);
}
.project-card:hover .tag { border-color: var(--accent); color: var(--accent); }

/* --- ABOUT --- */
#about {
  max-width: 800px; margin: 0 auto;
}
#about h2 {
  font-family: var(--display); font-size: 12px;
  letter-spacing: 8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 40px;
}
#about .about-text {
  font-size: 15px; line-height: 2; color: rgba(224, 224, 232, 0.7);
}
#about .about-text span {
  color: var(--accent); font-weight: 700;
}
.stats-row {
  display: flex; gap: 60px; margin-top: 60px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--display); font-size: 36px; font-weight: 900;
  color: var(--fg);
}
.stat .lbl {
  font-size: 9px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--dim); margin-top: 8px;
}

/* --- CONTACT --- */
#contact { align-items: center; text-align: center; }
#contact h2 {
  font-family: var(--display); font-size: clamp(24px, 4vw, 48px);
  font-weight: 900; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
#contact .contact-sub {
  font-size: 13px; color: var(--dim); margin-top: 16px;
  letter-spacing: 3px;
}
.contact-links {
  display: flex; gap: 24px; margin-top: 40px; flex-wrap: wrap;
  justify-content: center;
}
.contact-link {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--fg); text-decoration: none;
  padding: 12px 28px; border: 1px solid var(--dim);
  border-radius: 30px; transition: all 0.3s;
}
.contact-link:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.15);
}

/* --- FOOTER --- */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 40px;
  font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--dim);
}

/* --- SCANLINE OVERLAY --- */
#scanlines {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* --- CURSOR GLOW --- */
#cursor-glow {
  position: fixed; width: 400px; height: 400px;
  border-radius: 50%; pointer-events: none; z-index: 2;
  background: radial-gradient(circle, rgba(0,255,170,0.04) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* --- NOISE OVERLAY --- */
#noise {
  position: fixed; inset: -50%; z-index: 49;
  pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseAnim 0.5s steps(8) infinite;
}
@keyframes noiseAnim {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-5%, 5%); }
  50% { transform: translate(5%, -5%); }
  75% { transform: translate(-5%, -5%); }
  100% { transform: translate(5%, 5%); }
}

/* --- GLITCH FLASH --- */
.glitch-flash {
  position: fixed; inset: 0; z-index: 48;
  pointer-events: none; opacity: 0;
  background: var(--accent); mix-blend-mode: overlay;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  section { padding: 80px 24px; }
  nav { padding: 16px 20px; }
  nav .nav-links { gap: 16px; }
  nav .nav-links a { font-size: 9px; }
  .sound-pad { grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; }
  .project-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 32px; }
}
