/* =========================================================
   DENMA SOLUTIONS — Cyber Aurora Theme
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #05060f;
  --bg-elevated: #0b0e1c;
  --surface: rgba(18, 22, 42, 0.65);
  --surface-hover: rgba(26, 32, 58, 0.85);
  --primary: #00e6d4;
  --primary-glow: rgba(0, 230, 212, 0.45);
  --primary-soft: rgba(0, 230, 212, 0.12);
  --secondary: #8b5cf6;
  --accent: #f472b6;
  --text: #eaf0ff;
  --text-dim: #8a93b0;
  --border: rgba(139, 92, 246, 0.18);
  --border-bright: rgba(0, 230, 212, 0.35);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px -10px var(--primary-glow);
  --radius: 22px;
  --transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-theme {
  --bg: #f2f5fc;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(255, 255, 255, 0.95);
  --primary: #009b8a;
  --primary-glow: rgba(0, 155, 138, 0.35);
  --primary-soft: rgba(0, 155, 138, 0.1);
  --secondary: #7c3aed;
  --accent: #db2777;
  --text: #0a0f1f;
  --text-dim: #5a6280;
  --border: rgba(124, 58, 237, 0.15);
  --border-bright: rgba(0, 155, 138, 0.3);
  --shadow: 0 20px 60px -20px rgba(20, 30, 60, 0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.4s, color 0.4s;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,230,212,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,230,212,.04) 1px, transparent 1px);
  background-size: 55px 55px;
  pointer-events: none;
  z-index: -4;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  position: relative;
  z-index: 2;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }

h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  display: inline-block;
  position: relative;
  margin-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), transparent);
  border-radius: 4px;
}

.section-subtitle {
  color: var(--text-dim);
  margin: 1.4rem 0 2.2rem;
  font-size: 1rem;
  max-width: 640px;
}

a { text-decoration: none; color: inherit; }

/* ---------- HEADER ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header::before {
  content: '';
  position: absolute;
  inset: -8px -20px;
  background: rgba(5, 6, 15, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: -1;
}

body.light-theme header::before { background: rgba(242, 245, 252, 0.75); }

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), var(--secondary) 70%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo i {
  color: var(--primary);
  font-size: 1.5rem;
  -webkit-text-fill-color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo span { font-weight: 300; margin-left: 2px; }

.nav-links { display: flex; gap: 1.8rem; font-weight: 500; align-items: center; }

.nav-links a {
  color: var(--text-dim);
  transition: var(--transition);
  font-size: 0.92rem;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover { color: var(--primary); }

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: var(--transition);
  border-radius: 2px;
}

.nav-links a:hover::after { width: 100%; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
  margin-left: 1rem;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: rotate(25deg) scale(1.08);
  box-shadow: 0 0 20px -5px var(--primary-glow);
}

/* ---------- HERO ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  margin: 3rem 0 6rem;
}

.hero-content { flex: 1 1 420px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.45rem 1.1rem;
  border-radius: 40px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: 1px solid var(--border-bright);
  margin-bottom: 1.6rem;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 var(--primary-glow);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  letter-spacing: -0.035em;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--primary), var(--secondary) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 230, 212, 0.3));
}

.typing-line {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1rem;
  min-height: 1.6em;
  letter-spacing: 0.4px;
}

.cursor {
  display: inline-block;
  color: var(--primary);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.94rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #00b8a8);
  color: #05060f;
  box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s;
}

.btn-primary:hover::before { left: 100%; }

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -10px var(--primary);
}

.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -12px var(--primary-glow);
}

.hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; }

.stat h4 {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.03em;
  text-shadow: 0 0 20px var(--primary-glow);
}

.stat span {
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.hero-visual { flex: 1 1 320px; display: flex; justify-content: center; align-items: center; }

/* ---------- PROFILE CHIP ---------- */
.chip-wrap {
  perspective: 1000px;
  display: inline-block;
  animation: float 6s ease-in-out infinite;
}

.glowing-chip {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 230, 212, 0.08), rgba(5, 6, 15, 0.9));
  border-radius: 50%;
  position: relative;
  border: 1px solid var(--border-bright);
  box-shadow: 0 0 90px rgba(0, 230, 212, 0.25), inset 0 0 40px rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

body.light-theme .glowing-chip {
  background: radial-gradient(circle at 30% 30%, #dbe7ff, #f8faff);
  box-shadow: 0 0 90px rgba(0, 155, 138, 0.2), inset 0 0 40px rgba(124, 58, 237, 0.1);
}

.chip-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #0f1626, #1a2338);
}

body.light-theme .chip-photo { background: linear-gradient(135deg, #e0e7ff, #f0f4ff); }

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s, box-shadow 0.4s, filter 0.4s;
}

.chip-wrap.hovering .profile-img {
  transform: scale(1.06);
  box-shadow: 0 0 50px rgba(0, 230, 212, 0.65);
  filter: saturate(1.2) brightness(1.05);
}

.chip-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(255, 255, 255, 0.35) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
  mix-blend-mode: screen;
}

.chip-wrap.hovering .chip-spotlight { opacity: 1; }

.chip-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: rotate(-45deg) translateY(-100%);
  transition: transform 0.7s ease-out;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.chip-wrap.hovering .chip-shine { transform: rotate(-45deg) translateY(100%); }

.chip-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  animation: spin 8s linear infinite;
}

.chip-wrap.hovering .chip-ring { opacity: 0.7; }

.chip-pulse {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  pointer-events: none;
  animation: pulse 2s ease-out infinite;
}

.chip-wrap.hovering .chip-pulse { opacity: 0.5; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.35); opacity: 0; }
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(0, 230, 212, 0.35);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin linear infinite;
  pointer-events: none;
}

.orbit-1 { width: 340px; height: 340px; animation-duration: 18s; }
.orbit-2 { width: 400px; height: 400px; animation-duration: 28s; animation-direction: reverse; }
.orbit-3 { width: 460px; height: 460px; animation-duration: 40s; }

.orbit::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--primary);
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ---------- ABOUT ---------- */
.about-section { margin: 6rem 0; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  backdrop-filter: blur(14px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.about-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-bright);
  background: var(--surface-hover);
  box-shadow: var(--shadow-glow);
}

.about-card:hover::before { transform: scaleX(1); }

.about-card i {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.about-card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.about-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- SKILLS ---------- */
.skills-section { margin: 5rem 0; }

.skills-grid { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.skill-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.7rem 1.4rem;
  border-radius: 60px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
  cursor: default;
}

.skill-tag i { color: var(--primary); font-size: 1.1rem; }

.skill-tag:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  background: var(--primary-soft);
  box-shadow: 0 10px 30px -12px var(--primary-glow);
}

/* ---------- PROJECTS ---------- */
.projects-section { margin: 6rem 0; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.8rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-bright);
  background: var(--surface-hover);
  box-shadow: 0 30px 60px -25px rgba(0, 230, 212, 0.3), 0 0 0 1px var(--border-bright);
}

.project-preview {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #06070f;
  border-bottom: 1px solid var(--border);
}

.preview-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 6, 15, 0.7));
  pointer-events: none;
  transition: opacity 0.4s;
}

.preview-overlay i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 230, 212, 0.95);
  color: #05060f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding-left: 4px;
  box-shadow: 0 0 30px rgba(0, 230, 212, 0.7);
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .preview-overlay i { opacity: 1; transform: scale(1); }

/* WEATHER PREVIEW */
.preview-weather .sun {
  position: absolute;
  top: 30px;
  right: 40px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe082, #ffb300);
  box-shadow: 0 0 40px rgba(255, 193, 7, 0.7);
  animation: sun-pulse 3s ease-in-out infinite;
}

@keyframes sun-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

.preview-weather .cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 60px;
  height: 22px;
}

.preview-weather .cloud::before,
.preview-weather .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.preview-weather .cloud-1 { top: 55px; left: -30px; width: 90px; animation: cloud-drift 12s linear infinite; }
.preview-weather .cloud-1::before { width: 30px; height: 30px; top: -14px; left: 14px; }
.preview-weather .cloud-1::after { width: 24px; height: 24px; top: -10px; left: 40px; }
.preview-weather .cloud-2 { top: 95px; left: -60px; width: 70px; opacity: 0.55; animation: cloud-drift 18s linear infinite; animation-delay: -4s; }
.preview-weather .cloud-2::before { width: 24px; height: 24px; top: -12px; left: 12px; }
.preview-weather .cloud-2::after { width: 20px; height: 20px; top: -8px; left: 34px; }
.preview-weather .cloud-3 { top: 25px; left: -100px; width: 60px; opacity: 0.4; animation: cloud-drift 22s linear infinite; animation-delay: -8s; }
.preview-weather .cloud-3::before { width: 20px; height: 20px; top: -10px; left: 10px; }

@keyframes cloud-drift { 0%{transform:translateX(0)} 100%{transform:translateX(420px)} }

.preview-weather .rain { position: absolute; inset: 0; pointer-events: none; }

.preview-weather .rain span {
  position: absolute;
  top: -10px;
  width: 1.5px;
  height: 12px;
  background: linear-gradient(to bottom, transparent, rgba(0, 230, 212, 0.9));
  border-radius: 2px;
  animation: rain-fall 1.4s linear infinite;
}

.preview-weather .rain span:nth-child(1){left:15%;animation-delay:0s}
.preview-weather .rain span:nth-child(2){left:28%;animation-delay:.3s}
.preview-weather .rain span:nth-child(3){left:42%;animation-delay:.6s}
.preview-weather .rain span:nth-child(4){left:55%;animation-delay:.15s}
.preview-weather .rain span:nth-child(5){left:68%;animation-delay:.5s}
.preview-weather .rain span:nth-child(6){left:78%;animation-delay:.85s}
.preview-weather .rain span:nth-child(7){left:88%;animation-delay:.4s}
.preview-weather .rain span:nth-child(8){left:35%;animation-delay:.75s}

@keyframes rain-fall {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(220px); opacity: 0; }
}

.preview-weather .temp-readout {
  position: absolute;
  bottom: 20px;
  left: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
  letter-spacing: -0.03em;
}

/* SNAKE PREVIEW */
.preview-snake { background: #050a08; }

.snake-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,230,212,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,230,212,.12) 1px, transparent 1px);
  background-size: 20px 20px;
}

.snake-body { position: absolute; inset: 0; }

.snake-body span {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--primary-glow);
  animation: snake-move 4s linear infinite;
}

.snake-body span:nth-child(1){animation-delay:0s;background:#00e6d4}
.snake-body span:nth-child(2){animation-delay:.08s;background:#00d0bf}
.snake-body span:nth-child(3){animation-delay:.16s;background:#00b8a8}
.snake-body span:nth-child(4){animation-delay:.24s;background:#009e8f}
.snake-body span:nth-child(5){animation-delay:.32s;background:#00857a}
.snake-body span:nth-child(6){animation-delay:.4s;background:#006c63}

@keyframes snake-move {
  0%   { top: 100px; left: 40px; }
  20%  { top: 100px; left: 160px; }
  25%  { top: 100px; left: 180px; }
  45%  { top: 40px;  left: 180px; }
  50%  { top: 40px;  left: 180px; }
  70%  { top: 40px;  left: 60px; }
  75%  { top: 40px;  left: 40px; }
  95%  { top: 100px; left: 40px; }
  100% { top: 100px; left: 40px; }
}

.snake-food {
  position: absolute;
  top: 140px;
  left: 230px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  animation: food-pulse 1s ease-in-out infinite;
}

@keyframes food-pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.7} }

.snake-score {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 1px;
  text-shadow: 0 0 8px var(--primary-glow);
}

/* TODO PREVIEW */
.preview-todo { background: #07090f; }

.todo-window {
  width: 78%;
  max-width: 260px;
  background: rgba(18, 22, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.8);
}

.todo-bar {
  height: 3px;
  width: 40%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  margin-bottom: 12px;
}

.todo-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; }

.todo-item .check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--border-bright);
  position: relative;
  flex-shrink: 0;
}

.todo-item .check::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #05060f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.25s ease 0.1s;
}

.todo-line { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; }
.todo-line.short { width: 60%; }

.todo-item:nth-child(2) .check { animation: check-anim 6s infinite .5s; }
.todo-item:nth-child(3) .check { animation: check-anim 6s infinite 2s; }
.todo-item:nth-child(4) .check { animation: check-anim 6s infinite 3.5s; }
.todo-item:nth-child(5) .check { animation: check-anim 6s infinite 5s; }

.todo-item:nth-child(2) .check::after { animation: check-tick 6s infinite .5s; }
.todo-item:nth-child(3) .check::after { animation: check-tick 6s infinite 2s; }
.todo-item:nth-child(4) .check::after { animation: check-tick 6s infinite 3.5s; }
.todo-item:nth-child(5) .check::after { animation: check-tick 6s infinite 5s; }

.todo-item:nth-child(2) .todo-line { animation: line-out 6s infinite .5s; }
.todo-item:nth-child(3) .todo-line { animation: line-out 6s infinite 2s; }
.todo-item:nth-child(4) .todo-line { animation: line-out 6s infinite 3.5s; }
.todo-item:nth-child(5) .todo-line { animation: line-out 6s infinite 5s; }

@keyframes check-anim {
  0%, 10% { background: transparent; }
  15%, 100% { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
}

@keyframes check-tick {
  0%, 12% { transform: rotate(45deg) scale(0); }
  18%, 100% { transform: rotate(45deg) scale(1); }
}

@keyframes line-out {
  0%, 15% { opacity: 1; }
  25%, 100% { opacity: 0.35; }
}

/* CALC PREVIEW */
.preview-calc { background: #07090f; }

.calc-window {
  width: 74%;
  max-width: 220px;
  background: rgba(18, 22, 42, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.8);
}

.calc-display {
  background: rgba(0, 230, 212, 0.08);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}

.calc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px var(--primary-glow);
  position: relative;
  width: 100%;
  text-align: right;
}

.calc-num span {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--primary);
  animation: num-cycle 8s steps(1) infinite;
}

.calc-num span::before { content: '128'; }

@keyframes num-cycle {
  0%, 12.5% { content: '128'; }
  12.6%, 25% { content: '256'; }
  25.1%, 37.5% { content: '512'; }
  37.6%, 50% { content: '1024'; }
  50.1%, 62.5% { content: '2048'; }
  62.6%, 75% { content: '4096'; }
  75.1%, 100% { content: '8192'; }
}

.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.calc-keys span {
  height: 22px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: key-flash 5s infinite;
}

.calc-keys span:nth-child(1){animation-delay:.5s}
.calc-keys span:nth-child(2){animation-delay:1s}
.calc-keys span:nth-child(3){animation-delay:1.5s}
.calc-keys span:nth-child(4){animation-delay:2s}
.calc-keys span:nth-child(6){animation-delay:.3s}
.calc-keys span:nth-child(7){animation-delay:.9s}
.calc-keys span:nth-child(11){animation-delay:1.7s}
.calc-keys span:nth-child(15){animation-delay:2.4s}

@keyframes key-flash {
  0%, 100% { background: rgba(255,255,255,.06); box-shadow: none; }
  2% { background: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
  6% { background: rgba(255,255,255,.06); }
}

/* TTT PREVIEW */
.preview-ttt { background: #06070f; }

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
  gap: 4px;
  background: var(--border);
  padding: 4px;
  border-radius: 10px;
  box-shadow: 0 20px 40px -20px rgba(0, 230, 212, 0.3);
}

.ttt-grid .cell {
  background: #0b0e1c;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.ttt-grid .x { color: var(--primary); text-shadow: 0 0 14px var(--primary-glow); animation: pop-in .5s backwards; }
.ttt-grid .o { color: var(--accent); text-shadow: 0 0 14px rgba(244,114,182,.7); animation: pop-in .5s backwards; }

.ttt-grid .x:nth-child(1) { animation-delay: .2s; }
.ttt-grid .o:nth-child(3) { animation-delay: .6s; }
.ttt-grid .x:nth-child(5) { animation-delay: 1s; }
.ttt-grid .o:nth-child(7) { animation-delay: 1.4s; }
.ttt-grid .x:nth-child(9) { animation-delay: 1.8s; }

@keyframes pop-in {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  70% { transform: scale(1.2) rotate(0); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.ttt-winner {
  position: absolute;
  bottom: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
  animation: winner-glow 2s ease-in-out infinite;
}

@keyframes winner-glow { 0%,100%{opacity:.6} 50%{opacity:1} }

/* ARDUINO PREVIEW */
.preview-arduino { background: #050a08; }

.arduino-board {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 110px;
  height: 80px;
  background: linear-gradient(145deg, #0a4d3a, #063826);
  border-radius: 8px;
  border: 1px solid #0e6b51;
  box-shadow: 0 10px 30px -10px rgba(0, 230, 212, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.arduino-chip {
  position: absolute;
  top: 20px;
  left: 30px;
  width: 44px;
  height: 32px;
  background: #1a1a1a;
  border-radius: 3px;
  border: 1px solid #2a2a2a;
}

.arduino-chip::before,
.arduino-chip::after {
  content: '';
  position: absolute;
  top: 0;
  width: 2px;
  height: 32px;
  background: repeating-linear-gradient(to bottom, #999 0 2px, transparent 2px 4px);
}

.arduino-chip::before { left: -4px; }
.arduino-chip::after { right: -4px; }

.arduino-pins {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
}

.arduino-pins span {
  width: 4px;
  height: 10px;
  background: #c9a227;
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(201, 162, 39, 0.6);
}

.arduino-leds {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arduino-leds .led {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
}

.arduino-leds .led-1 { animation: led-glow 1.5s infinite; }
.arduino-leds .led-2 { animation: led-glow 1.5s infinite .5s; }
.arduino-leds .led-3 { animation: led-glow 1.5s infinite 1s; }

@keyframes led-glow {
  0%, 40% { background: #2a2a2a; box-shadow: none; }
  50%, 60% { background: var(--primary); box-shadow: 0 0 16px var(--primary), 0 0 30px var(--primary-glow); }
  70%, 100% { background: #2a2a2a; box-shadow: none; }
}

.arduino-wave {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  height: 30px;
  opacity: 0.6;
  overflow: hidden;
}

.arduino-wave svg { width: 100%; height: 100%; }

.arduino-wave path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.2;
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* PROJECT BODY */
.project-body {
  padding: 1.5rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }

.project-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  flex: 1;
  line-height: 1.55;
}

.tech-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }

.tech-stack span {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  border: 1px solid var(--border-bright);
  font-weight: 600;
  letter-spacing: 0.3px;
  font-family: 'JetBrains Mono', monospace;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  align-self: flex-start;
}

.project-link i { transition: var(--transition); }
.project-link:hover i { transform: translateX(6px); }

/* ---------- CONTACT ---------- */
.contact-section {
  margin: 6rem 0 3rem;
  background: linear-gradient(145deg, rgba(18, 22, 42, 0.6), rgba(11, 14, 28, 0.6));
  border-radius: 32px;
  padding: 3rem 2.5rem;
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body.light-theme .contact-section {
  background: linear-gradient(145deg, #ffffff, #eef2ff);
}

.contact-header { text-align: center; margin-bottom: 2.5rem; position: relative; z-index: 1; }
.contact-header h2 { margin-bottom: 0.5rem; }
.contact-header h2::after { left: 20%; width: 60%; }
.contact-header p { color: var(--text-dim); font-size: 1rem; margin-top: 1rem; }

.social-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.social-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 0.7rem 1.5rem 0.7rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
}

.social-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  background: var(--surface-hover);
  box-shadow: 0 15px 35px -15px var(--primary-glow);
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icon i { color: var(--primary); font-size: 1.1rem; transition: transform 0.3s; }

.social-card:hover .social-icon {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 25px var(--primary-glow);
}

.social-card:hover .social-icon i { color: #05060f; }

.social-card.dance-swing:hover .social-icon i { animation: dance-swing 0.6s ease-in-out infinite; }
.social-card.dance-bounce:hover .social-icon i { animation: dance-bounce 0.6s ease-in-out infinite; }
.social-card.dance-ring:hover .social-icon i { animation: dance-ring 0.9s ease-in-out infinite; }
.social-card.dance-flip:hover .social-icon i { animation: dance-flip 0.8s ease-in-out infinite; }

@keyframes dance-swing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-18deg); }
  75% { transform: rotate(18deg); }
}

@keyframes dance-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-6px) scale(1.1); }
  60% { transform: translateY(2px) scale(0.95); }
}

@keyframes dance-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(15deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(10deg); }
}

@keyframes dance-flip {
  0%, 100% { transform: rotateY(0); }
  50% { transform: rotateY(360deg); }
}

.email-wrap { text-align: center; position: relative; z-index: 1; }

.email-highlight {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px dashed var(--border-bright);
  border-radius: 80px;
  padding: 0.85rem 1.8rem;
  transition: var(--transition);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
}

.email-highlight i { color: var(--primary); }

.email-highlight:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -15px var(--primary-glow);
}

.copy-icon {
  cursor: pointer;
  margin-left: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
  color: var(--primary);
}

.copy-icon:hover { transform: scale(1.25); }

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 3rem;
}

.footer-brand { color: var(--primary); font-weight: 700; }
.footer-sub { margin-top: 0.5rem; font-size: 0.8rem; }

/* SCROLL TOP */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #00b8a8);
  color: #05060f;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -10px var(--primary-glow);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 200;
}

.scroll-top.visible { opacity: 1; pointer-events: auto; }

.scroll-top:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 18px 40px -10px var(--primary);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.85rem 1.5rem;
  border-radius: 40px;
  border: 1px solid var(--primary);
  box-shadow: 0 20px 40px -10px rgba(0, 230, 212, 0.4);
  font-weight: 500;
  font-size: 0.88rem;
  opacity: 0;
  transition: all 0.4s;
  z-index: 300;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    padding: 1.2rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: var(--transition);
    min-width: 180px;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .menu-toggle { display: block; }
}

@media (max-width: 768px) {
  .container { padding: 1rem 1.4rem; }
  .hero { gap: 2rem; margin: 2rem 0 4rem; }
  .glowing-chip { width: 240px; height: 240px; }
  .orbit-1 { width: 270px; height: 270px; }
  .orbit-2 { width: 320px; height: 320px; }
  .orbit-3 { width: 370px; height: 370px; }
  .contact-section { padding: 2.2rem 1.5rem; border-radius: 24px; }
  .social-card { padding: 0.6rem 1.2rem 0.6rem 0.6rem; font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .btn { padding: 0.75rem 1.4rem; font-size: 0.85rem; }
  .skill-tag { padding: 0.55rem 1rem; font-size: 0.82rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .logo { font-size: 1.1rem; }
  .glowing-chip { width: 200px; height: 200px; }
  .orbit-1 { width: 220px; height: 220px; }
  .orbit-2 { width: 260px; height: 260px; }
  .orbit-3 { width: 300px; height: 300px; }
  .social-card .social-label { display: none; }
  .social-card { padding: 0.5rem; }
  .email-highlight { font-size: 0.78rem; padding: 0.75rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chip-wrap { animation: none; }
  .orbit { animation: none; }
}

/* BACKGROUND LAYERS */
.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -3;
  pointer-events: none;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  animation: floatBlob 14s infinite ease-in-out alternate;
}

.blob-1 { background: #00e6d4; width: 420px; height: 420px; top: -120px; left: -120px; }
.blob-2 { background: #8b5cf6; width: 380px; height: 380px; bottom: -120px; right: -120px; animation-delay: -7s; }
.blob-3 { background: #f472b6; width: 300px; height: 300px; top: 40%; left: 50%; opacity: 0.15; animation-delay: -3s; }

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(90px, 60px) scale(1.2); }
}

#tsparticles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  opacity: 0.75;
}

.mouse-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,230,212,.12) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.3s;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #00e6d4, #8b5cf6, #f472b6);
  z-index: 9999;
  transition: width 0.1s;
  box-shadow: 0 0 12px rgba(0,230,212,.45);
}
/* =========================================================
   APP MODAL + LIVE PROJECTS
   ========================================================= */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  padding: 20px;
}
.app-modal.open { opacity: 1; pointer-events: auto; }

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-modal-window {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  background: linear-gradient(145deg, #0d1220, #0a0e18);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0, 230, 212, 0.35), 0 0 0 1px rgba(0, 230, 212, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-modal.open .app-modal-window { transform: translateY(0) scale(1); }

body.light-theme .app-modal-window {
  background: linear-gradient(145deg, #ffffff, #eef2ff);
}

.app-modal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

body.light-theme .app-modal-bar { background: rgba(0, 0, 0, 0.04); }

.app-modal-dots { display: flex; gap: 6px; }
.app-modal-dots span { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3a; }
.app-modal-dots span:nth-child(1) { background: #ff5f57; }
.app-modal-dots span:nth-child(2) { background: #febc2e; }
.app-modal-dots span:nth-child(3) { background: #28c840; }

.app-modal-title {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: center;
}

.app-modal-close {
  background: rgba(0, 230, 212, 0.1);
  border: 1px solid var(--border-bright);
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-modal-close:hover { background: var(--primary); color: #05060f; }

.app-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  color: var(--text);
}

/* ========== WEATHER APP ========== */
.wx-app { display: flex; flex-direction: column; gap: 18px; }
.wx-search { display: flex; gap: 10px; }
.wx-search input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color .2s;
}
.wx-search input:focus { border-color: var(--primary); }
.wx-search button {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #05060f;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .2s;
}
.wx-search button:hover { transform: translateY(-2px); }

.wx-result {
  background: linear-gradient(135deg, rgba(0, 230, 212, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  transition: all .3s;
}
.wx-city { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.wx-country { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 12px; letter-spacing: 1px; }
.wx-temp { font-size: 3.6rem; font-weight: 800; color: var(--primary); font-family: 'JetBrains Mono', monospace; line-height: 1; text-shadow: 0 0 30px var(--primary-glow); }
.wx-cond { font-size: 1rem; color: var(--text-dim); margin: 8px 0 16px; }
.wx-details { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; font-size: 0.85rem; }
.wx-details div { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.wx-details i { color: var(--primary); }
.wx-loading { color: var(--text-dim); font-style: italic; }
.wx-hint { color: var(--text-dim); font-size: 0.85rem; text-align: center; }

/* ========== SNAKE GAME ========== */
.snake-app { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.snake-hud { display: flex; gap: 24px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }
.snake-hud span { color: var(--primary); }
.snake-hud b { color: var(--text); }
.snake-canvas {
  background: #060a12;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  display: block;
  box-shadow: 0 0 40px -10px var(--primary-glow);
  touch-action: none;
}
.snake-controls { display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px); gap: 6px; }
.snake-controls button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.snake-controls button:hover { background: var(--primary-soft); border-color: var(--primary); }
.snake-controls button:active { transform: scale(0.92); background: var(--primary); color: #05060f; }
.snake-controls .up { grid-column: 2; grid-row: 1; }
.snake-controls .left { grid-column: 1; grid-row: 2; }
.snake-controls .down { grid-column: 2; grid-row: 2; }
.snake-controls .right { grid-column: 3; grid-row: 2; }
.snake-btn {
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--primary);
  color: #05060f;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ========== CALCULATOR ========== */
.calc-app {
  max-width: 340px;
  margin: 0 auto;
  background: #0a0e18;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.7);
}
body.light-theme .calc-app { background: #f8fafc; }
.calc-display-live {
  background: rgba(0, 230, 212, 0.06);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 14px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.calc-history { color: var(--text-dim); font-size: 0.8rem; min-height: 18px; }
.calc-current { color: var(--primary); font-size: 2rem; font-weight: 700; word-break: break-all; text-shadow: 0 0 20px var(--primary-glow); }
.calc-keys-live { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-keys-live button {
  padding: 18px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.calc-keys-live button:hover { background: var(--primary-soft); border-color: var(--primary); }
.calc-keys-live button:active { transform: scale(0.95); }
.calc-keys-live .op { color: var(--primary); }
.calc-keys-live .eq { background: var(--primary); color: #05060f; grid-column: span 1; }
.calc-keys-live .eq:hover { background: #00ff99; }
.calc-keys-live .span2 { grid-column: span 2; }
.calc-keys-live .danger { color: #ff6b8a; }

/* ========== TIC TAC TOE ========== */
.ttt-app { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ttt-status { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; color: var(--primary); letter-spacing: 1px; text-align: center; }
.ttt-board-live {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
  gap: 8px;
  background: var(--border);
  padding: 8px;
  border-radius: 16px;
  box-shadow: 0 0 40px -15px var(--primary-glow);
}
.ttt-board-live button {
  background: #0a0e18;
  border: none;
  border-radius: 10px;
  font-size: 2.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.light-theme .ttt-board-live button { background: #f8fafc; }
.ttt-board-live button:hover:not(:disabled) { background: rgba(0, 230, 212, 0.12); }
.ttt-board-live button.x { color: var(--primary); text-shadow: 0 0 20px var(--primary-glow); }
.ttt-board-live button.o { color: var(--accent); text-shadow: 0 0 20px rgba(244, 114, 182, 0.6); }
.ttt-board-live button.win { background: rgba(0, 230, 212, 0.25); animation: win-pulse 0.8s ease-in-out infinite; }
@keyframes win-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0, 230, 212, 0.5); } 50% { box-shadow: 0 0 0 10px transparent; } }
.ttt-scores { display: flex; gap: 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }
.ttt-scores div { color: var(--text-dim); }
.ttt-scores b { color: var(--primary); font-size: 1.2rem; }
.ttt-reset { padding: 10px 24px; border-radius: 10px; background: var(--primary); color: #05060f; border: none; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ========== TO-DO ========== */
.todo-app { display: flex; flex-direction: column; gap: 16px; max-width: 500px; margin: 0 auto; }
.todo-input-row { display: flex; gap: 10px; }
.todo-input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}
body.light-theme .todo-input-row input { background: rgba(255,255,255,.7); }
.todo-input-row input:focus { border-color: var(--primary); }
.todo-input-row button {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #05060f;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.todo-filters { display: flex; gap: 8px; justify-content: center; }
.todo-filters button {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  transition: all .2s;
}
.todo-filters button.active { background: var(--primary); color: #05060f; border-color: var(--primary); font-weight: 700; }
.todo-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.todo-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0, 230, 212, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all .2s;
}
.todo-list-item:hover { border-color: var(--border-bright); background: rgba(0, 230, 212, 0.1); }
.todo-list-item.done { opacity: 0.5; }
.todo-list-item.done .todo-list-text { text-decoration: line-through; }
.todo-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-bright);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  color: transparent;
}
.todo-list-item.done .todo-check { background: var(--primary); border-color: var(--primary); color: #05060f; }
.todo-list-text { flex: 1; font-size: 0.92rem; word-break: break-word; }
.todo-del {
  background: transparent;
  border: none;
  color: #ff6b8a;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .2s;
}
.todo-del:hover { background: rgba(255, 107, 138, 0.15); }
.todo-empty { text-align: center; color: var(--text-dim); font-style: italic; padding: 30px 0; font-size: 0.9rem; }

/* ========== ARDUINO LAB ========== */
.arduino-app { display: flex; flex-direction: column; gap: 18px; }
.arduino-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .arduino-top { grid-template-columns: 1fr; } }
.arduino-panel {
  background: rgba(0, 230, 212, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.arduino-panel h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary); margin-bottom: 12px; font-family: 'JetBrains Mono', monospace; }
.sensor-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.85rem; }
.sensor-row label { color: var(--text-dim); }
.sensor-row input[type=range] { width: 55%; accent-color: var(--primary); }
.sensor-row b { font-family: 'JetBrains Mono', monospace; color: var(--primary); min-width: 55px; text-align: right; }

.led-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.led-grid button {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #2a2a2a;
  background: #151a24;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.led-grid button.on {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary-glow);
}

.serial {
  background: #05070d;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  height: 140px;
  overflow-y: auto;
  color: var(--primary);
}
.serial-line { padding: 2px 0; opacity: 0.9; }
.serial-line::before { content: '> '; color: var(--secondary); }

.arduino-lcd {
  background: linear-gradient(135deg, #0a2818, #041a10);
  border: 1px solid #0e6b51;
  border-radius: 10px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  color: #00ff88;
  text-shadow: 0 0 10px #00ff88;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-top: 10px;
}
.arduino-lcd div { margin: 3px 0; }