/* =========================================================
   drjerry.dev — 8-bit neon sci-fi theme
   ========================================================= */

:root {
  --bg: #0a0618;
  --bg-2: #140c2e;
  --panel: rgba(20, 12, 46, 0.82);
  --ink: #e9e6ff;
  --muted: #9d93d6;

  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --lime: #b6ff3b;
  --yellow: #ffe14d;
  --purple: #8a5cff;

  --px: 4px;                         /* one "pixel" */
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "VT323", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(138, 92, 255, 0.25), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(255, 43, 214, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.35;
  overflow-x: hidden;
  image-rendering: pixelated;
}

::selection { background: var(--pink); color: var(--bg); }

a { color: var(--cyan); }

/* ---------- Background layers ---------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
}

/* ---------- Colour helpers ---------- */
.c-cyan { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.c-pink { color: var(--pink); text-shadow: 0 0 8px var(--pink); }
.c-lime { color: var(--lime); text-shadow: 0 0 8px var(--lime); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 24px;
  background: rgba(10, 6, 24, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: var(--px) solid var(--purple);
  box-shadow: 0 var(--px) 0 var(--pink);
}

.logo {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 2px;
}
.logo span { color: var(--pink); }

.nav nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav nav a {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav nav a:hover { color: var(--lime); text-shadow: 0 0 6px var(--lime); }

/* ---------- Layout ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
  padding: 60px 0;
}

.tag {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--lime);
  margin: 0 0 18px;
  letter-spacing: 1px;
}

h1 {
  font-family: var(--font-pixel);
  font-size: clamp(22px, 4.6vw, 46px);
  line-height: 1.3;
  margin: 0 0 22px;
}

.glitch {
  position: relative;
  color: #fff;
  text-shadow:
    var(--px) var(--px) 0 var(--purple),
    0 0 18px var(--cyan);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.glitch::before {
  color: var(--pink);
  transform: translate(-3px, 0);
  clip-path: inset(0 0 60% 0);
  animation: glitch-a 7s steps(1) infinite;
}
.glitch::after {
  color: var(--cyan);
  transform: translate(3px, 0);
  clip-path: inset(55% 0 0 0);
  animation: glitch-b 9s steps(1) infinite;
}
@keyframes glitch-a {
  0%, 97%, 100% { transform: translate(0, 0); opacity: 0; }
  98% { transform: translate(-2px, 0); opacity: 0.8; }
}
@keyframes glitch-b {
  0%, 96%, 100% { transform: translate(0, 0); opacity: 0; }
  97% { transform: translate(2px, 0); opacity: 0.8; }
}

.role-line {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 2;
  margin: 0 0 22px;
}
.role-line .sep { color: var(--muted); margin: 0 6px; }

.lede {
  font-size: 26px;
  color: var(--ink);
  max-width: 680px;
  margin: 0 0 34px;
}

/* ---------- Pixel buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }
.btn-row.center { justify-content: center; }

.pixel-btn {
  --c: var(--cyan);
  position: relative;
  display: inline-block;
  padding: 14px 20px;
  font-family: var(--font-pixel);
  font-size: 11px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--c);
  /* stepped "pixel" corners */
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--c),
    0 var(--px) 0 0 var(--c),
    calc(var(--px) * -1) 0 0 0 var(--c),
    var(--px) 0 0 0 var(--c),
    0 calc(var(--px) * 2) 0 0 rgba(0, 0, 0, 0.5),
    0 0 22px 0 var(--c);
  transition: transform 0.08s steps(2), filter 0.15s;
}
.pixel-btn:hover { transform: translateY(-3px); filter: brightness(1.15); }
.pixel-btn:active { transform: translateY(2px); }
.btn-cyan { --c: var(--cyan); }
.btn-pink { --c: var(--pink); }
.btn-lime { --c: var(--lime); }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  margin: 70px 0;
  padding: 36px 32px;
  background: var(--panel);
  border: var(--px) solid var(--purple);
  box-shadow:
    var(--px) var(--px) 0 0 var(--pink),
    calc(var(--px) * 2) calc(var(--px) * 2) 0 0 var(--cyan),
    0 0 30px rgba(138, 92, 255, 0.3);
}
.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 2.6vw, 22px);
  margin: 0 0 28px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--purple);
}
.section-title span {
  color: var(--bg);
  background: var(--lime);
  padding: 4px 8px;
  margin-right: 10px;
  text-shadow: none;
}
.section-title small {
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--muted);
  text-transform: none;
  text-shadow: none;
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 16px;
  border: 2px solid var(--cyan);
  background: rgba(0, 240, 255, 0.05);
}
.stat-card h3 {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
  margin: 0 0 10px;
  text-transform: uppercase;
}
.stat-card p { margin: 0; font-size: 24px; }

.bio p { margin: 0; font-size: 24px; color: var(--ink); }

/* ---------- Quests ---------- */
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.quest {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: rgba(10, 6, 24, 0.7);
  border: 2px solid var(--purple);
  transition: transform 0.1s steps(2), border-color 0.15s, box-shadow 0.15s;
}
.quest:hover {
  transform: translate(-3px, -3px);
  border-color: var(--lime);
  box-shadow: 6px 6px 0 var(--lime);
}
.quest-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.badge {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 5px 7px;
  color: var(--bg);
}
.b-lime { background: var(--lime); }
.b-cyan { background: var(--cyan); }
.b-pink { background: var(--pink); }
.year { font-family: var(--font-pixel); font-size: 9px; color: var(--muted); }

.quest h3 {
  font-family: var(--font-pixel);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
  color: #fff;
}
.quest p { margin: 0 0 14px; color: var(--muted); flex: 1; }

.chips { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 18px;
  padding: 0 8px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
}
.quest-links { display: flex; gap: 14px; }
.quest-links a { color: var(--pink); text-decoration: none; font-size: 20px; }
.quest-links a:hover { color: var(--lime); }

/* ---------- Skills ---------- */
.skill-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}
.col-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  margin: 0 0 18px;
  text-transform: uppercase;
}
.skill { margin-bottom: 14px; }
.skill span { display: block; margin-bottom: 4px; }

.bar {
  height: 16px;
  border: 2px solid var(--cyan);
  padding: 2px;
  background: rgba(0, 0, 0, 0.4);
}
.bar i {
  display: block;
  height: 100%;
  width: var(--lvl);
  /* chunky segmented fill */
  background: repeating-linear-gradient(90deg, var(--cyan) 0 10px, transparent 10px 12px);
  box-shadow: 0 0 10px var(--cyan);
  animation: fill 1.4s steps(12) both;
}
.skill.pink .bar { border-color: var(--pink); }
.skill.pink .bar i {
  background: repeating-linear-gradient(90deg, var(--pink) 0 10px, transparent 10px 12px);
  box-shadow: 0 0 10px var(--pink);
}
@keyframes fill { from { width: 0; } }

.perks { list-style: none; margin: 0; padding: 0; }
.perks li {
  padding: 8px 0;
  border-bottom: 2px dotted rgba(182, 255, 59, 0.35);
}
.perks li:hover { color: var(--lime); padding-left: 6px; transition: padding 0.1s steps(2); }

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 2px dashed rgba(138, 92, 255, 0.5);
}
.pub:last-child { border-bottom: 0; }
.pub-year {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--yellow);
  padding-top: 4px;
}
.pub h3 { font-size: 26px; margin: 0 0 4px; color: #fff; font-weight: normal; }
.pub-meta { margin: 0 0 6px; color: var(--muted); }
.pub-link { color: var(--pink); text-decoration: none; }
.pub-link:hover { color: var(--lime); }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact p { font-size: 26px; margin: 0 0 28px; }

footer {
  text-align: center;
  padding: 30px 16px 40px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--muted);
  border-top: var(--px) solid var(--purple);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { min-height: auto; padding: 50px 0 20px; }
  .lede { font-size: 22px; }
  .nav { flex-direction: column; gap: 10px; }
  .nav nav { justify-content: center; gap: 12px; }
  .panel { padding: 28px 18px; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}
