/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --primary: #E62429;
  --blue: #0A59BA;
  --surface: #C63C01;
  --deep: #050A1C;
  --white: #FFFFFF;
  --body-bg: #F5F7FF;
  --muted: #EAF6FA;
  --hairline: #FF7B00;
  --ink: var(--deep);

  --font-display: 'Bungee', cursive;
  --font-body: 'Satoshi', 'Space Grotesk', sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;
  --font-micro: 'Press Start 2P', cursive;
  --font-mono: 'JetBrains Mono', monospace;
  --font-special: 'Anton', sans-serif;

  --b-hair: 1px;
  --b-input: 2px;
  --b-card: 3px;

  --r-none: 0px;
  --r-card: 4px;
  --r-pill: 9999px;

  --sh-1: 2px 2px 0;
  --sh-2: 4px 4px 0;
  --sh-3: 6px 6px 0;
  --sh-4: 8px 8px 0;
  --sh-5: 10px 10px 0;

  --max-w: 1200px;
  --pad: clamp(20px, 5vw, 48px);

  --transition-fast: 120ms cubic-bezier(.2,.8,.2,1);
}

/* ============================================================
   RESET / BASE
============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--body-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; }
.label--tag { color: var(--primary); }
.label--mono { font-family: var(--font-mono); }

.section-eyebrow {
  font-family: var(--font-micro);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 14px;
  display: inline-block;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 32px;
  color: var(--deep);
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  border-radius: var(--r-none);
  border: var(--b-card) solid var(--deep);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--sh-2) var(--deep);
}

.btn--ghost {
  background: var(--white);
  color: var(--deep);
  box-shadow: var(--sh-2) var(--deep);
}

.btn--full { width: 100%; text-align: center; }

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--sh-3) var(--deep);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--sh-1) var(--deep);
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 247, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: var(--b-hair) solid var(--deep);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.navbar__brand {
  font-family: var(--font-special);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.navbar__links {
  display: flex;
  gap: 28px;
}

.navbar__links a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  position: relative;
  padding-bottom: 4px;
}

.navbar__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-fast);
}

.navbar__links a:hover::after,
.navbar__links a.active::after {
  width: 100%;
}

.navbar__links a.active { color: var(--primary); }

.navbar__socials {
  display: flex;
  gap: 16px;
}

.navbar__socials a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-bottom: var(--b-hair) solid transparent;
}
.navbar__socials a:hover { border-color: var(--primary); color: var(--primary); }

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.navbar__toggle span {
  width: 24px;
  height: 2px;
  background: var(--deep);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.navbar__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__toggle.open span:nth-child(2) { opacity: 0; }
.navbar__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   SPIDEY — swings near the 3-line menu, retracts above it
============================================================ */
.spidey-hang {
  position: absolute;
  top: 100%;
  right: clamp(56px, 9vw, 96px);
  width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.spidey-hang__thread {
  display: block;
  width: 2px;
  background: var(--deep);
  height: 6px;
  animation: spideyThread 8s ease-in-out infinite;
}

.spidey-hang__figure {
  display: block;
  width: 46px;
  height: auto;
  transform-origin: top center;
  animation: spideySwing 8s ease-in-out infinite;
  filter: drop-shadow(2px 2px 0 rgba(5,10,28,0.25));
}

@keyframes spideyThread {
  0%, 10%   { height: 6px; }
  25%, 48%  { height: 88px; }
  63%, 100% { height: 6px; }
}

@keyframes spideySwing {
  0%, 10%   { transform: rotate(0deg); opacity: .9; }
  20%       { transform: rotate(-14deg); }
  28%       { transform: rotate(12deg); }
  36%       { transform: rotate(-8deg); }
  44%       { transform: rotate(5deg); }
  48%       { transform: rotate(0deg); }
  63%, 100% { transform: rotate(0deg); opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
  .spidey-hang__thread, .spidey-hang__figure { animation: none; }
}

@media (max-width: 480px) {
  .spidey-hang { right: 50px; width: 42px; }
}

.mobile-menu {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--deep);
  color: var(--white);
  z-index: 99;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px var(--pad);
  transform: translateY(-100%);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}
.mobile-menu.open { transform: translateY(0); }

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.mobile-menu__links a {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.mobile-menu__socials {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

/* ============================================================
   CORNER WEBS (decorative spider webs)
============================================================ */
.corner-web {
  position: absolute;
  z-index: 0;
  width: clamp(90px, 12vw, 160px);
  height: clamp(90px, 12vw, 160px);
  pointer-events: none;
}

.corner-web svg {
  width: 100%;
  height: 100%;
  display: block;
}

.corner-web--tl { top: 0; left: 0; }
.corner-web--tr { top: 0; right: 0; transform: scaleX(-1); }
.corner-web--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.corner-web--br { bottom: 0; right: 0; transform: scale(-1, -1); }

.corner-web--light { color: rgba(255, 255, 255, 0.16); }
.corner-web--dark  { color: rgba(5, 10, 28, 0.14); }
.corner-web--primary { color: rgba(230, 36, 41, 0.22); }

@media (max-width: 640px) {
  .corner-web { width: 70px; height: 70px; }
}

/* ============================================================
   HERO
============================================================ */
.hero {
  padding: 90px 0 80px;
  position: relative;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1;
  margin: 14px 0 8px;
  color: var(--deep);
}

.hero__role {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--blue);
  margin-bottom: 18px;
}

.hero__tagline {
  max-width: 46ch;
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 32px;
}

.hero__cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero__stats {
  display: flex;
  gap: 32px;
}
.hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--primary);
}
.hero__stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: #555;
}

.hero__visual { position: relative; }

.hero__frame {
  position: relative;
  border: var(--b-card) solid var(--deep);
  box-shadow: var(--sh-5) var(--primary);
  border-radius: var(--r-card);
  aspect-ratio: 4 / 5;
  background: var(--muted);
  transform: rotate(-1.5deg);
}

.hero__frame-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--blue), var(--deep));
  border-radius: var(--r-card);
  overflow: hidden;
}

.hero__frame-placeholder {
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}

.hero__badge {
  position: absolute;
  bottom: -16px;
  left: -16px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-micro);
  font-size: 0.55rem;
  padding: 10px 14px;
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-pill);
}

/* ============================================================
   ABOUT
============================================================ */
.about { padding: 90px 0; background: var(--white); border-top: var(--b-hair) solid var(--deep); position: relative; overflow: hidden; }

.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.about__frame {
  border: var(--b-card) solid var(--deep);
  box-shadow: var(--sh-4) var(--blue);
  border-radius: var(--r-card);
  aspect-ratio: 1 / 1.1;
  background: linear-gradient(200deg, var(--surface), var(--deep));
  display: flex;
  align-items: center;
  justify-content: center;
}

.about__bio {
  font-size: 1.05rem;
  max-width: 56ch;
  margin-bottom: 32px;
  color: #333;
}

.about__info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.about__info-item {
  border-left: var(--b-input) solid var(--primary);
  padding-left: 14px;
}
.about__info-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--blue);
  display: block;
  margin-bottom: 4px;
}
.about__info-value {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
}

.about__actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   SKILLS
============================================================ */
.skills { padding: 90px 0; }

.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill-card {
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-card);
  background: var(--white);
  padding: 18px 20px;
  box-shadow: var(--sh-1) var(--deep);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.skill-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--sh-3) var(--deep);
}

.skill-card__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.skill-card__top span:last-child { font-family: var(--font-mono); color: var(--primary); }

.skill-bar {
  height: 8px;
  background: var(--muted);
  border: var(--b-hair) solid var(--deep);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.skill-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--primary));
  border-radius: var(--r-pill);
  width: 0%;
  transition: width 900ms cubic-bezier(.2,.8,.2,1);
}

/* ============================================================
   GITHUB
============================================================ */
.github { padding: 40px 0 90px; }

.github__panel {
  background: var(--deep);
  color: var(--white);
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-card);
  padding: 28px;
  box-shadow: var(--sh-3) var(--primary);
}

.github__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.github__dot { color: #6EE7A0; }

.github__grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}
.gh-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
}
.gh-cell[data-level="1"] { background: rgba(10,89,186,0.5); }
.gh-cell[data-level="2"] { background: rgba(10,89,186,0.8); }
.gh-cell[data-level="3"] { background: var(--primary); }

.github__legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
}
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch--0 { background: rgba(255,255,255,0.08); }
.swatch--1 { background: rgba(10,89,186,0.5); }
.swatch--2 { background: rgba(10,89,186,0.8); }
.swatch--3 { background: var(--primary); }

/* ============================================================
   MARQUEE (diagonal ribbon)
============================================================ */
.marquee {
  position: relative;
  padding: 34px 0;
  overflow: hidden;
  background: var(--body-bg);
  isolation: isolate;
  perspective: 1000px;
}

.marquee__row {
  position: relative;
  width: 130%;
  margin-left: -15%;
  overflow: hidden;
  border-top: var(--b-card) solid var(--deep);
  border-bottom: var(--b-card) solid var(--deep);
  padding: 14px 0;
  transform-origin: center;
}

.marquee__row--top {
  background: var(--primary);
  transform: rotate(-2.5deg);
  margin-bottom: -10px;
  z-index: 1;
}

.marquee__row--bottom {
  background: var(--deep);
  transform: rotate(2.5deg);
  border-color: var(--primary);
  z-index: 0;
}

.marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  animation: marquee-scroll 24s linear infinite;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
}

.marquee__track--reverse {
  animation-name: marquee-scroll-reverse;
  animation-duration: 28s;
}

.marquee__item {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  color: var(--white);
  white-space: nowrap;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0.001);
}

.marquee__icon {
  font-size: 0.8rem;
  color: var(--white);
  opacity: 0.7;
  -webkit-font-smoothing: antialiased;
}
.marquee__icon--dark { color: var(--deep); }
.marquee__icon--primary { color: var(--primary); }

.marquee__badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--white);
  border: var(--b-card) solid var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-2) var(--deep);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-33.333%); }
}

@keyframes marquee-scroll-reverse {
  from { transform: translateX(-33.333%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

@media (max-width: 640px) {
  .marquee__row { width: 140%; margin-left: -20%; }
  .marquee__badge { width: 44px; height: 44px; }
}

/* ============================================================
   PROJECTS
============================================================ */
.projects { padding: 90px 0; }

.projects__filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border: var(--b-input) solid var(--deep);
  background: var(--white);
  border-radius: var(--r-pill);
  transition: all var(--transition-fast);
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--deep);
  color: var(--white);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-card);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--sh-2) var(--deep);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.project-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--sh-4) var(--deep);
}
.project-card:hover .project-card__image { filter: grayscale(0); }

.project-card__image {
  aspect-ratio: 16/9;
  background: linear-gradient(150deg, var(--blue), var(--deep));
  filter: grayscale(1);
  transition: filter var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__body { padding: 22px; }

.project-card__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  margin-bottom: 10px;
}
.project-card__status {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: var(--b-hair) solid currentColor;
}

.project-card__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.project-card__desc {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 16px;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 4px 8px;
  background: var(--muted);
  border: var(--b-hair) solid var(--deep);
  border-radius: var(--r-pill);
}

/* ============================================================
   SERVICES
============================================================ */
.services { padding: 90px 0; background: var(--white); border-top: var(--b-hair) solid var(--deep); }

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.service-card {
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--sh-1) var(--deep);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.service-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--sh-3) var(--deep);
}
.service-card__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--blue);
}
.service-card__desc { font-size: 0.9rem; color: #444; }

/* ============================================================
   CONTACT
============================================================ */
.contact { padding: 90px 0; }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.contact__heading { margin-bottom: 24px; }

.contact__email {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  border-bottom: var(--b-input) solid var(--primary);
  margin-bottom: 18px;
}

.contact__availability {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  margin-bottom: 26px;
}

.contact__socials {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.contact__socials a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-bottom: var(--b-hair) solid transparent;
}
.contact__socials a:hover { border-color: var(--primary); color: var(--primary); }

.contact__form {
  background: var(--deep);
  padding: 32px;
  border-radius: var(--r-card);
  border: var(--b-card) solid var(--deep);
  box-shadow: var(--sh-3) var(--primary);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
}
.field input, .field textarea {
  background: rgba(255,255,255,0.04);
  border: var(--b-input) solid rgba(255,255,255,0.25);
  border-radius: var(--r-none);
  color: var(--white);
  padding: 12px 14px;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
}
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.contact__form-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #6EE7A0;
  min-height: 1em;
}

/* ============================================================
   LOCATION
============================================================ */
.location { padding: 0 0 90px; }

.location__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: stretch;
}

.location__map {
  position: relative;
  min-height: 320px;
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-card);
  background: var(--deep);
  overflow: hidden;
  isolation: isolate;
}

.location__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.35) contrast(1.1) saturate(1.1) brightness(0.9);
}

/* --- analog TV static: js-drawn noise, blended over the map --- */
.location__static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.35;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
}

/* --- rolling scanlines + tracking wave, CRT-style --- */
.location__scanlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.location__scanlines::before {
  /* the wandering "bad reception" band */
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 22%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(10, 89, 186, 0.12) 55%,
    transparent
  );
  animation: tv-wave-roll 7s linear infinite;
  filter: blur(1px);
}

.location__scanlines::after {
  /* subtle horizontal jitter / tracking distortion */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(230, 36, 41, 0.03) 0px,
    transparent 4px
  );
  animation: tv-jitter 220ms steps(2) infinite;
}

@keyframes tv-wave-roll {
  0%   { transform: translateY(-30%); }
  100% { transform: translateY(130%); }
}

@keyframes tv-jitter {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(0.6px, -0.6px); }
  100% { transform: translate(-0.6px, 0.6px); }
}

.location__overlay {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-family: var(--font-micro);
  font-size: 0.55rem;
  color: var(--primary);
  text-shadow: 0 0 6px rgba(230, 36, 41, 0.6);
}

.location__overlay span {
  animation: signal-blink 1.4s ease-in-out infinite;
}

.location__overlay span:last-child {
  animation-delay: 0.35s;
}

@keyframes signal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  .location__overlay span {
    animation: none;
  }
}

.location__crosshair {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 4;
  width: 14px; height: 14px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.location__crosshair::before {
  content: "";
  position: absolute;
  inset: -22px;
  border: 1px solid rgba(230,36,41,0.4);
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .location__scanlines::before,
  .location__scanlines::after {
    animation: none;
  }
}

.location__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.location__city {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: var(--deep);
  color: var(--white);
  border-top: var(--b-card) solid var(--primary);
  padding: 56px 0 28px;
  position: relative;
  overflow: hidden;
}

.footer__inner { position: relative; z-index: 1; }

.footer__top { margin-bottom: 28px; }
.footer__brand {
  font-family: var(--font-special);
  font-size: 1.6rem;
  display: block;
  margin-bottom: 10px;
}
.footer__statement {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  max-width: 40ch;
}

.footer__socials {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.footer__socials a { border-bottom: var(--b-hair) solid transparent; }
.footer__socials a:hover { border-color: var(--primary); color: var(--primary); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: var(--b-hair) solid rgba(255,255,255,0.2);
  padding-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__bottom .label { color: rgba(255,255,255,0.6); }

.footer__totop {
  background: none;
  border: var(--b-input) solid rgba(255,255,255,0.3);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 8px 14px;
  transition: all var(--transition-fast);
}
.footer__totop:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translate(-2px, -2px);
}

.footer__micro {
  text-align: center;
  margin-top: 24px;
  font-family: var(--font-micro);
  font-size: 0.5rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
}

/* ============================================================
   SCROLL REVEAL
============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__image { max-width: 360px; }
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .projects__grid { grid-template-columns: 1fr; }
  .location__grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .navbar__links, .navbar__socials { display: none; }
  .navbar__toggle { display: flex; }

  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 320px; margin: 0 auto; }
  .hero__text { text-align: left; }

  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .skills__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .about__info { grid-template-columns: 1fr; }
  .hero__stats { gap: 22px; }
  .github__grid { grid-template-columns: repeat(16, 1fr); }
}

@media (max-width: 480px) {
  :root { --pad: 18px; }
  .hero { padding: 60px 0 50px; }
  .about, .skills, .projects, .services, .contact { padding: 60px 0; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   MUSIC PLAYER — Spotify-style pill, top-right, Spidey themed
============================================================ */
.music-player {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 300;
}

.music-player__btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--deep);
  border: var(--b-card) solid var(--deep);
  border-radius: var(--r-pill);
  padding: 6px 16px 6px 6px;
  box-shadow: var(--sh-2) var(--primary);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.music-player__btn:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-3) var(--primary); }
.music-player__btn:active { transform: translate(1px, 1px); box-shadow: var(--sh-1) var(--primary); }

.music-player__disc {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--white);
  background: conic-gradient(var(--primary) 0deg 90deg, var(--blue) 90deg 180deg, var(--primary) 180deg 270deg, var(--blue) 270deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: discSpin 2.6s linear infinite;
  animation-play-state: paused;
}
.music-player__disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.35) 0deg 2deg, transparent 2deg 18deg);
}
.music-player__disc-web {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--deep);
  z-index: 1;
}

.music-player__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.music-player__bars span {
  width: 3px;
  height: 4px;
  background: var(--white);
  animation: barBounce 0.9s ease-in-out infinite;
  animation-play-state: paused;
}
.music-player__bars span:nth-child(2) { animation-delay: .15s; }
.music-player__bars span:nth-child(3) { animation-delay: .3s; }

.music-player__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--white);
}

.music-player.is-playing .music-player__disc,
.music-player.is-playing .music-player__bars span {
  animation-play-state: running;
}

@keyframes discSpin { to { transform: rotate(360deg); } }
@keyframes barBounce { 0%, 100% { height: 4px; } 50% { height: 13px; } }

@media (max-width: 480px) {
  .music-player__label { display: none; }
  .music-player__btn { padding: 6px 10px 6px 6px; }
}

/* ============================================================
   BACK-TO-TOP SPIDEY GIF POPUP
============================================================ */
.btt-gif {
  position: fixed;
  right: 24px;
  bottom: 90px;
  z-index: 250;
  opacity: 0;
  transform: translateY(24px) scale(0.85);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease;
}
.btt-gif.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.btt-gif__img {
  display: block;
  width: 130px;
  height: auto;
  border-radius: var(--r-card);
  border: var(--b-card) solid var(--deep);
  box-shadow: var(--sh-3) var(--primary);
  background: var(--white);
}
@media (max-width: 640px) {
  .btt-gif { right: 14px; bottom: 78px; }
  .btt-gif__img { width: 92px; }
}

/* ============================================================
   PRELOADER — "SPINNING THE WEB"
============================================================ */
body.is-loading { overflow: hidden; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader__bg {
  position: absolute;
  inset: 0;
  background: var(--deep);
  background-image:
    radial-gradient(circle at 50% 45%, rgba(230,36,41,0.18), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 26px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 26px);
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.preloader__gif-frame {
  width: 140px;
  height: 140px;
  border-radius: var(--r-card);
  border: var(--b-card) solid var(--primary);
  box-shadow: var(--sh-3) var(--primary);
  overflow: hidden;
  background: var(--white);
  animation: preloaderSwing 2.4s ease-in-out infinite;
  transform-origin: top center;
}

.preloader__gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes preloaderSwing {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-4px); }
}

.preloader__enter {
  margin-top: 8px;
  padding: 14px 26px;
  border: var(--b-card) solid var(--primary);
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--sh-2) var(--white);
  animation: preloaderEnterPulse 1.4s ease-in-out infinite;
}
.preloader__enter:active { transform: scale(0.96); }

@keyframes preloaderEnterPulse {
  0%, 100% { box-shadow: var(--sh-2) var(--white); }
  50% { box-shadow: var(--sh-4) var(--white); }
}

.preloader__title {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin-top: 6px;
}

.preloader__status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  min-height: 1em;
}

.preloader__bar-track {
  position: relative;
  width: 100%;
  height: 20px;
  margin-top: 8px;
  background: rgba(255,255,255,0.06);
  border: var(--b-input) solid var(--white);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.preloader__web-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.web-strand {
  stroke: rgba(255,255,255,0.25);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.web-strand--thin {
  stroke: rgba(255,255,255,0.12);
}

.preloader__bar-fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--primary));
  transition: width 0.25s ease-out;
  overflow: hidden;
}

.preloader__web-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.web-zigzag {
  fill: none;
  stroke: var(--white);
  stroke-width: 0.6;
}

.preloader__spider {
  position: absolute;
  top: 50%;
  left: 0%;
  font-size: 15px;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: left 0.25s ease-out;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}

.preloader__percent {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--white);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .preloader__gif-frame { width: 110px; height: 110px; }
  .preloader__inner { max-width: 280px; }
}
