:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --text: #ffffff;
  --muted: #cfcfcf;
  --line: rgba(255, 255, 255, 0.2);
  --accent: #eaff00;
  --accent-strong: #f4ff67;
  --neon-cyan: #00f7ff;
  --neon-magenta: #ff2dff;
  --neon-lime: #62ff00;
  --card: rgba(12, 12, 12, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  background-color: #000;
  background:
    radial-gradient(circle at 12% 6%, rgba(234, 255, 0, 0.16), transparent 32%),
    radial-gradient(circle at 86% 14%, rgba(0, 247, 255, 0.18), transparent 34%),
    radial-gradient(circle at 60% 78%, rgba(255, 45, 255, 0.15), transparent 36%),
    linear-gradient(180deg, #000000 0%, #000000 100%);
  overflow-x: hidden;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}

.fx-particle,
.fx-ring {
  position: fixed;
  pointer-events: none;
}

.fx-particle {
  width: var(--size, 8px);
  height: var(--size, 8px);
  left: var(--x, 50vw);
  top: var(--y, 50vh);
  border-radius: 50%;
  background: var(--tone, #eaff00);
  box-shadow: 0 0 14px var(--tone, #eaff00);
  animation: popOut 620ms ease-out forwards;
}

.fx-ring {
  width: 16px;
  height: 16px;
  left: var(--x, 50vw);
  top: var(--y, 50vh);
  border-radius: 50%;
  border: 2px solid var(--tone, #00f7ff);
  transform: translate(-50%, -50%);
  animation: ringOut 720ms ease-out forwards;
}

.bg-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  width: 38vw;
  height: 38vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  filter: blur(12px);
  mix-blend-mode: screen;
  opacity: 0.4;
}

.orb-a {
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(234, 255, 0, 0.65) 0%, rgba(234, 255, 0, 0) 65%);
  animation: driftA 12s ease-in-out infinite alternate;
}

.orb-b {
  top: 14%;
  right: -10%;
  background: radial-gradient(circle, rgba(0, 247, 255, 0.58) 0%, rgba(0, 247, 255, 0) 65%);
  animation: driftB 14s ease-in-out infinite alternate;
}

.orb-c {
  bottom: -20%;
  left: 32%;
  background: radial-gradient(circle, rgba(255, 45, 255, 0.52) 0%, rgba(255, 45, 255, 0) 65%);
  animation: driftC 16s ease-in-out infinite alternate;
}

.scanline {
  position: absolute;
  inset: -20% 0 0 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 47%,
    rgba(234, 255, 0, 0.09) 50%,
    rgba(255, 255, 255, 0) 55%
  );
  animation: scan 7s linear infinite;
}

.cursor-glow {
  position: fixed;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle, rgba(234, 255, 0, 0.2) 0%, rgba(0, 247, 255, 0.08) 40%, rgba(0, 0, 0, 0) 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.page-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(234, 255, 0, 0.3) 0%, rgba(234, 255, 0, 0) 58%),
    linear-gradient(120deg, rgba(234, 255, 0, 0.18), rgba(0, 247, 255, 0.18), rgba(255, 45, 255, 0.16));
}

.page-flash.active {
  animation: pageFlash 420ms ease-out;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(to right, rgba(0, 247, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 45, 255, 0.2) 1px, transparent 1px);
  background-size: 44px 44px;
}

main,
.topbar,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 8px rgba(234, 255, 0, 0.65),
    0 0 16px rgba(0, 247, 255, 0.4);
  animation: softFlicker 4.2s infinite;
}

nav {
  display: flex;
  gap: 18px;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 4px;
  background: rgba(8, 8, 8, 0.8);
  box-shadow:
    0 0 12px rgba(234, 255, 0, 0.25),
    inset 0 0 8px rgba(0, 247, 255, 0.15);
}

.mode-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  transition: 180ms ease;
}

.mode-btn:hover {
  color: var(--accent);
}

.mode-btn.active {
  border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(120deg, rgba(234, 255, 0, 0.24), rgba(0, 247, 255, 0.22), rgba(255, 45, 255, 0.2));
  box-shadow:
    0 0 14px rgba(234, 255, 0, 0.4),
    0 0 20px rgba(0, 247, 255, 0.2);
}

a {
  color: var(--text);
  text-decoration: none;
}

nav a {
  color: var(--muted);
}

nav a:hover {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(234, 255, 0, 0.7);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px 60px;
}

.hero {
  padding: 60px 0 42px;
}

.kicker {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-shadow:
    0 0 8px rgba(234, 255, 0, 0.9),
    0 0 14px rgba(98, 255, 0, 0.4);
}

h1,
h2,
h3 {
  font-family: "Syne", sans-serif;
  margin: 0;
}

h1 {
  margin-top: 16px;
  font-size: clamp(2.3rem, 7vw, 5.7rem);
  line-height: 0.96;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.35),
    0 0 22px rgba(234, 255, 0, 0.45),
    0 0 34px rgba(0, 247, 255, 0.2);
}

.neon-flicker {
  animation: neonFlicker 3.6s infinite steps(1);
}

#hero-logo {
  display: block;
  width: min(56vw, 380px);
  height: auto;
  margin: 0 auto;
  filter:
    drop-shadow(0 0 16px rgba(234, 255, 0, 0.42))
    drop-shadow(0 0 24px rgba(0, 247, 255, 0.24));
}

#hero-tagline {
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  margin-top: 14px;
  color: var(--muted);
  text-transform: none;
  line-height: 1.3;
  text-align: center;
}

.lead {
  max-width: 680px;
  color: #efefef;
  margin-top: 20px;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: 150ms ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transform-style: preserve-3d;
  animation: buttonPulse 2.6s ease-in-out infinite;
}

.btn-mini {
  padding: 7px 12px;
  font-size: 0.75rem;
}

.btn-primary {
  background: var(--accent);
  color: #111111;
  font-weight: 700;
  border-color: var(--accent);
  box-shadow:
    0 0 14px rgba(234, 255, 0, 0.72),
    0 0 28px rgba(234, 255, 0, 0.4);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow:
    0 0 18px rgba(234, 255, 0, 0.95),
    0 0 36px rgba(234, 255, 0, 0.5);
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow:
    0 0 16px rgba(0, 247, 255, 0.72),
    0 0 24px rgba(0, 247, 255, 0.35);
  transform: translateY(-2px) scale(1.02);
}

section {
  margin-top: 36px;
}

.card {
  border: 1px solid rgba(255, 45, 255, 0.32);
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow:
    inset 0 0 18px rgba(255, 45, 255, 0.07),
    0 0 20px rgba(0, 247, 255, 0.08);
  position: relative;
  overflow: hidden;
}

h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  margin-bottom: 16px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.showcase-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.project {
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(
    180deg,
    rgba(0, 247, 255, 0.11) 0%,
    rgba(255, 45, 255, 0.08) 45%,
    rgba(12, 12, 12, 0.85) 100%
  );
  box-shadow:
    0 0 16px rgba(0, 247, 255, 0.2),
    0 0 24px rgba(255, 45, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.card::before,
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(120deg, rgba(234, 255, 0, 0.5), rgba(0, 247, 255, 0.65), rgba(255, 45, 255, 0.5))
    border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  animation: borderFlow 4.2s linear infinite;
}

.project h3 {
  margin-bottom: 8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.6);
}

.project-links {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.read-block {
  margin-top: 12px;
}

.read-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
}

.read-toggle::-webkit-details-marker {
  display: none;
}

.read-content {
  margin: 12px 0 0;
  line-height: 1.6;
  color: #ececec;
}

.shock {
  animation: shock 280ms ease-out;
}

footer {
  max-width: 1100px;
  margin: 20px auto 0;
  padding: 14px 20px 24px;
  color: var(--muted);
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes driftA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(9vw, 6vh) scale(1.18);
  }
}

@keyframes driftB {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-10vw, 8vh) scale(1.14);
  }
}

@keyframes driftC {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-8vw, -7vh) scale(1.2);
  }
}

@keyframes scan {
  0% {
    transform: translateY(-60%);
  }
  100% {
    transform: translateY(160%);
  }
}

@keyframes borderFlow {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

@keyframes neonFlicker {
  0%,
  18%,
  22%,
  53%,
  57%,
  100% {
    opacity: 1;
  }
  20%,
  55% {
    opacity: 0.85;
  }
}

@keyframes softFlicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.88;
  }
}

@keyframes buttonPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.14);
  }
}

@keyframes pageFlash {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

@keyframes popOut {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -40px))) scale(0.05);
    opacity: 0;
  }
}

@keyframes ringOut {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@keyframes shock {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(1px, -1px);
  }
  50% {
    transform: translate(-1px, 1px);
  }
  75% {
    transform: translate(1px, 1px);
  }
}

body.mode-crazy .orb {
  opacity: 0.52;
}

body.mode-crazy .orb-a {
  animation-duration: 8s;
}

body.mode-crazy .orb-b {
  animation-duration: 10s;
}

body.mode-crazy .orb-c {
  animation-duration: 11s;
}

body.mode-crazy .scanline {
  animation-duration: 4.5s;
}

body.mode-crazy .grid-overlay {
  opacity: 0.52;
}

body.mode-chill {
  --text: #111111;
  --muted: #555555;
  --accent: #0084ff;
  --accent-strong: #3ca0ff;
  --neon-cyan: #00a8c5;
  --neon-magenta: #6b7dff;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(0, 0, 0, 0.12);
  background-color: #ffffff;
  background:
    radial-gradient(circle at 12% 6%, rgba(0, 132, 255, 0.12), transparent 36%),
    radial-gradient(circle at 86% 14%, rgba(0, 168, 197, 0.1), transparent 36%),
    radial-gradient(circle at 60% 78%, rgba(107, 125, 255, 0.08), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
}

body.mode-chill .bg-fx {
  filter: saturate(0.6);
}

body.mode-chill .orb {
  opacity: 0.16;
}

body.mode-chill .orb-a,
body.mode-chill .orb-b,
body.mode-chill .orb-c {
  animation-duration: 22s;
}

body.mode-chill .scanline {
  opacity: 0.16;
  animation-duration: 12s;
}

body.mode-chill .grid-overlay {
  opacity: 0.2;
  background-image:
    linear-gradient(to right, rgba(0, 132, 255, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(107, 125, 255, 0.12) 1px, transparent 1px);
}

body.mode-chill .brand {
  text-shadow:
    0 0 8px rgba(0, 132, 255, 0.28),
    0 0 12px rgba(0, 168, 197, 0.2);
}

body.mode-chill nav a {
  color: #3d3d3d;
}

body.mode-chill nav a:hover {
  color: #007eff;
}

body.mode-chill .card {
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow:
    inset 0 0 0 rgba(0, 0, 0, 0),
    0 10px 26px rgba(0, 0, 0, 0.06);
}

body.mode-chill .project {
  border: 1px solid rgba(0, 132, 255, 0.24);
  background: linear-gradient(
    180deg,
    rgba(0, 168, 197, 0.1) 0%,
    rgba(107, 125, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.95) 100%
  );
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.06),
    0 0 14px rgba(0, 132, 255, 0.1);
}

body.mode-chill .project h3 {
  color: #007ba4;
  text-shadow: none;
}

body.mode-chill .read-content {
  color: #222222;
}

body.mode-chill .mode-btn.active {
  background: linear-gradient(120deg, rgba(153, 216, 255, 0.2), rgba(137, 255, 214, 0.24));
  box-shadow:
    0 0 10px rgba(153, 216, 255, 0.3),
    0 0 16px rgba(137, 255, 214, 0.2);
}

@media (max-width: 900px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-controls {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
