/* ============================================================
   AIXXYCODE — Smooth motion + dark mode polish (shared)
   ============================================================ */

/* ---------- SMOOTH SCROLL & BASE TRANSITIONS ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  overflow-x: clip;
}

body {
  transition: background-color 0.35s ease, color 0.35s ease;
  min-width: 0;
  overflow-x: clip;
}

img, svg, canvas { max-width: 100%; }

nav,
.card,
.panel,
.code-window,
.mlink,
.skills__grid .card.panel,
.skills__grid .tech li,
button,
a {
  transition-property: background-color, border-color, color, box-shadow, transform, opacity;
  transition-duration: 0.25s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- SCROLL REVEAL ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  will-change: opacity, transform;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- ENTRY ANIMATIONS ---------- */
@keyframes axFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes axPopIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes axFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.ax-fade-up { animation: axFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.ax-pop-in  { animation: axPopIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.ax-float   { animation: axFloat 4s ease-in-out infinite; }
.ax-d1 { animation-delay: 0.08s; }
.ax-d2 { animation-delay: 0.16s; }
.ax-d3 { animation-delay: 0.24s; }
.ax-d4 { animation-delay: 0.32s; }
.ax-d5 { animation-delay: 0.4s; }

/* ---------- HOVER LIFT ---------- */
.ax-lift:hover {
  transform: translate(-3px, -3px);
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* The marquee tracks are excluded: they are continuous content tickers, not
     decorative motion, and killing their iteration count froze them forever. */
  *:not(.animate-marquee-left):not(.animate-marquee-right),
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   DARK MODE POLISH
   ============================================================ */
html.dark {
  --ax-bg: #0d1117;
  --ax-surface: #161b22;
  --ax-surface-2: #1c232c;
  --ax-line: #3d444d;
  --ax-text: #e6edf3;
  --ax-muted: #9aa7b4;
  color-scheme: dark;
}

/* nav + drawer surfaces */
html.dark nav {
  background-color: rgba(13, 17, 23, 0.85) !important;
  border-color: var(--ax-line) !important;
}
html.dark #mobile-menu-drawer {
  background-color: var(--ax-surface) !important;
  border-color: var(--ax-line) !important;
}
html.dark .mobile-nav-link {
  background-color: var(--ax-surface-2) !important;
  color: var(--ax-text) !important;
  border-color: var(--ax-line) !important;
}

/* softer brutalist shadows so they read as depth, not smudge */
html.dark [class*="shadow-["],
html.dark .code-window,
html.dark .skills__grid .card.panel,
html.dark .mlink:hover {
  box-shadow: 4px 4px 0 0 rgba(230, 237, 243, 0.22) !important;
}

/* keep accent chips readable */
html.dark .bg-\[\#FACC15\],
html.dark .bg-\[\#FF4D8D\],
html.dark .bg-\[\#0038FF\],
html.dark .bg-emerald-300,
html.dark .bg-orange-400 {
  color: #0d1117 !important;
}
html.dark .bg-\[\#FF4D8D\],
html.dark .bg-\[\#0038FF\] {
  color: #fff !important;
}

/* blueprint grid + noise are too loud on dark */
html.dark .grid-blueprint-bg {
  background-color: var(--ax-bg) !important;
  opacity: 1;
}
html.dark .noise-overlay::before { opacity: 0.03; }

/* form controls */
html.dark input,
html.dark textarea,
html.dark select {
  background-color: var(--ax-surface-2) !important;
  color: var(--ax-text) !important;
  border-color: var(--ax-line) !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #6e7b8a !important; }

/* scrollbar */
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: #0d1117; }
html.dark ::-webkit-scrollbar-thumb {
  background: #2f3742;
  border-radius: 999px;
  border: 2px solid #0d1117;
}
html.dark ::-webkit-scrollbar-thumb:hover { background: #3d444d; }

/* selection */
html.dark ::selection { background: #FF4D8D; color: #fff; }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.ax-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 112px 16px 72px;
}
.ax-eyebrow {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #0a0a0a;
  color: #fff;
  border: 2px solid #0a0a0a;
  padding: 5px 10px;
  border-radius: 6px;
}
html.dark .ax-eyebrow { background: #21262d; border-color: var(--ax-line); }

.ax-title {
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(40px, 9vw, 86px);
  line-height: 1.16;
  font-weight: 700;
  text-transform: uppercase;
  margin: 18px 0 10px;
  color: #0a0a0a;
}
html.dark .ax-title { color: var(--ax-text); }
.ax-title mark {
  display: inline-block;
  line-height: 1;
  padding-top: 4px;
  background: #FACC15;
  color: #0a0a0a;
  padding: 0 10px;
  border: 2px solid #0a0a0a;
  box-shadow: 5px 5px 0 0 #0a0a0a;
}
html.dark .ax-title mark { border-color: #0a0a0a; box-shadow: 5px 5px 0 0 rgba(230,237,243,.22); }

.ax-lead {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.9;
  max-width: 60ch;
  color: #4b5563;
}
html.dark .ax-lead { color: var(--ax-muted); }

.ax-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 40px;
}
@media (min-width: 900px) {
  .ax-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

.ax-card {
  background: #fff;
  border: 2px solid #0a0a0a;
  border-radius: 16px;
  padding: 26px;
  box-shadow: 6px 6px 0 0 #0a0a0a;
}
html.dark .ax-card {
  background: var(--ax-surface);
  border-color: var(--ax-line);
  box-shadow: 6px 6px 0 0 rgba(230, 237, 243, 0.22);
}
.ax-card h2 {
  font-family: Oswald, Impact, sans-serif;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: #0a0a0a;
}
html.dark .ax-card h2 { color: var(--ax-text); }
.ax-card p.hint {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: #6b7280;
  margin: 0 0 20px;
}
html.dark .ax-card p.hint { color: var(--ax-muted); }

.ax-field { margin-bottom: 16px; }
.ax-field label {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  color: #0a0a0a;
}
html.dark .ax-field label { color: var(--ax-text); }
.ax-field input,
.ax-field textarea {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  padding: 11px 13px;
  background: #F4F2EB;
  color: #0a0a0a;
  border: 2px solid #0a0a0a;
  border-radius: 10px;
  outline: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.ax-field textarea { min-height: 140px; resize: vertical; }
.ax-field input:focus,
.ax-field textarea:focus {
  background: #fff;
  box-shadow: 4px 4px 0 0 #FF4D8D;
  transform: translate(-2px, -2px);
}
html.dark .ax-field input:focus,
html.dark .ax-field textarea:focus {
  background: var(--ax-surface-2);
  box-shadow: 4px 4px 0 0 #FF4D8D;
}
.ax-error {
  display: none;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #e11d48;
  margin-top: 6px;
}
.ax-field.has-error .ax-error { display: block; }
.ax-field.has-error input,
.ax-field.has-error textarea { border-color: #e11d48; }

.ax-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #FACC15;
  color: #0a0a0a;
  border: 2px solid #0a0a0a;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 #0a0a0a;
  text-decoration: none;
}
.ax-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 0 #0a0a0a; }
.ax-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 #0a0a0a; }
html.dark .ax-btn { border-color: #0a0a0a; box-shadow: 4px 4px 0 0 rgba(230,237,243,.3); }
html.dark .ax-btn:hover { box-shadow: 6px 6px 0 0 rgba(230,237,243,.3); }

.ax-status {
  display: none;
  margin-top: 16px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 14px;
  border: 2px solid #0a0a0a;
  border-radius: 10px;
  background: #a8f0d0;
  color: #0a0a0a;
  animation: axPopIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ax-status.show { display: block; }
html.dark .ax-status { border-color: var(--ax-line); }

.ax-links { display: grid; gap: 12px; }
.ax-linkrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #F4F2EB;
  border: 2px solid #0a0a0a;
  border-radius: 12px;
  text-decoration: none;
  color: #0a0a0a;
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 700;
}
html.dark .ax-linkrow {
  background: var(--ax-surface-2);
  color: var(--ax-text);
  border-color: var(--ax-line);
}
.ax-linkrow:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 0 #0a0a0a; background: #FACC15; color: #0a0a0a; }
html.dark .ax-linkrow:hover { box-shadow: 4px 4px 0 0 rgba(230,237,243,.25); }
.ax-linkrow .k {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 2px solid #0a0a0a;
  border-radius: 8px;
  background: #fff;
}
html.dark .ax-linkrow .k { background: var(--ax-bg); border-color: var(--ax-line); }
.ax-linkrow .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ax-foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 2px solid #0a0a0a;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #6b7280;
}
html.dark .ax-foot { border-color: var(--ax-line); color: var(--ax-muted); }

/* keep transparent borders transparent in dark mode (nav links) */
html.dark .border-transparent { border-color: transparent !important; }
html.dark nav a, html.dark nav ul li a { color: #e6edf3; }
html.dark nav a:hover { color: #fff; }

/* accent chips: force dark ink on bright backgrounds (higher specificity
   than the base dark-mode text override) */
html.dark body .bg-\[\#FACC15\],
html.dark body .bg-\[\#a8f0d0\],
html.dark body .bg-emerald-200,
html.dark body .bg-emerald-300,
html.dark body .bg-emerald-400,
html.dark body .bg-yellow-300,
html.dark body .bg-yellow-400,
html.dark body .bg-orange-400,
html.dark body .bg-white.text-gray-950 {
  color: #0a0a0a !important;
}
html.dark body .bg-\[\#FF4D8D\],
html.dark body .bg-\[\#0038FF\] {
  color: #fff !important;
}
html.dark body .bg-white.text-gray-950 {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
}

/* Contact merged into single page */
.ax-section { padding-top: 72px; }
.ax-grid-single {
  grid-template-columns: 1fr !important;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.ax-contact-head { text-align: center; }
.ax-contact-head .ax-lead { margin-left: auto; margin-right: auto; }

/* visually hidden but readable by screen readers */
.ax-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* keyboard focus visibility */
.ax-field input:focus-visible,
.ax-field textarea:focus-visible,
.ax-btn:focus-visible {
  outline: 3px solid #0038FF;
  outline-offset: 2px;
}
html.dark .ax-field input:focus-visible,
html.dark .ax-field textarea:focus-visible,
html.dark .ax-btn:focus-visible { outline-color: #FACC15; }

.ax-status[data-tone="error"] { background: #ffd3dd; }

/* ===== Contact: centering hardening + send indicator ===== */
#contact .ax-grid-single { margin-left: auto !important; margin-right: auto !important; }
#contact .ax-contact-head { text-align: center; }
#contact .ax-card > h2, #contact .ax-card > .hint { text-align: center; }
#contact form { text-align: left; }
#contact .ax-btn { margin-left: auto; margin-right: auto; }
#contact .ax-status { text-align: center; }

.ax-spinner {
  display: none;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ax-spin .7s linear infinite;
}
@keyframes ax-spin { to { transform: rotate(360deg); } }
.ax-btn.is-sending .ax-spinner { display: inline-block; }
.ax-btn.is-sending .ax-btn-icon { display: none; }
.ax-btn[disabled] { opacity: .75; cursor: progress; transform: none !important; }
@media (prefers-reduced-motion: reduce) { .ax-spinner { animation: none; } }
#contact .ax-btn { display: flex; width: fit-content; }

/* marquee must keep moving even when reduced motion is on-ish */
.animate-marquee-left, .animate-marquee-right {
  animation-duration: 30s !important;
  animation-iteration-count: infinite !important;
  animation-timing-function: linear !important;
  animation-play-state: running;
  /* promote to its own layer so the browser does not drop the frames */
  will-change: transform;
  backface-visibility: hidden;
}
.marquee-row:hover .animate-marquee-left,
.marquee-row:hover .animate-marquee-right {
  animation-play-state: paused;
}

/* ===== HERO MEDIA CARD — RESPONSIVE HEIGHT & FACE FRAMING ===== */
.hero-media { height: 260px; }
@media (min-width: 480px) { .hero-media { height: 300px; } }
@media (min-width: 640px) { .hero-media { height: 360px; } }
@media (min-width: 768px) { .hero-media { height: 430px; } }
@media (min-width: 1024px) { .hero-media { height: 330px; } }
@media (min-width: 1280px) { .hero-media { height: 370px; } }
.hero-media img[src*="hero"] { object-position: 50% 14% !important; }

/* ============================================================
   PAGE PRELOADER — BIOS boot sequence (first paint)
   ============================================================ */
html.ax-loading, html.ax-loading body { overflow: hidden !important; }

#ax-preloader {
  /* Light theme (default) — follows the site's neo-brutalist palette */
  --pre-bg: #FAFAFA;
  --pre-fg: #0a0a0a;
  --pre-dim: #6b7280;
  --pre-faint: #9aa3af;
  --pre-accent: #d4a000;
  --pre-ok: #16a34a;
  --pre-hot: #d4a000;
  --pre-topline: rgba(10, 10, 10, .28);
  --pre-box-bg: #ffffff;
  --pre-box-border: #0a0a0a;
  --pre-scanline: rgba(10, 10, 10, .035);
  --pre-vignette: rgba(10, 10, 10, .12);
  --pre-glow-1: rgba(255, 77, 141, .35);
  --pre-glow-2: rgba(255, 77, 141, .18);
  --pre-glow-3: rgba(250, 204, 21, .25);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--pre-bg);
  opacity: 1;
  transition: opacity .5s ease, visibility .5s ease;
}
/* Dark theme — only when the visitor explicitly toggled dark mode */
html.dark #ax-preloader {
  --pre-bg: #05070d;
  --pre-fg: #FAFAFA;
  --pre-dim: #7d8896;
  --pre-faint: #5b6672;
  --pre-accent: #FACC15;
  --pre-ok: #4ade80;
  --pre-hot: #FACC15;
  --pre-topline: rgba(250, 204, 21, .22);
  --pre-box-bg: #0d1520;
  --pre-box-border: rgba(250, 250, 250, .35);
  --pre-scanline: rgba(255, 255, 255, .025);
  --pre-vignette: rgba(0, 0, 0, .55);
  --pre-glow-1: rgba(255, 77, 141, .8);
  --pre-glow-2: rgba(255, 77, 141, .45);
  --pre-glow-3: rgba(250, 204, 21, .3);
}
#ax-preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* CRT scanlines + vignette */
#ax-preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    var(--pre-scanline) 0 1px,
    transparent 1px 3px
  );
}
#ax-preloader::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, var(--pre-vignette) 100%);
}

.ax-pre__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  font-family: ui-monospace, "Space Mono", SFMono-Regular, Menlo, monospace;
}

/* ---- top BIOS status bar ---- */
.ax-pre__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pre-topline);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--pre-dim);
  white-space: nowrap;
}
.ax-pre__top > span { min-width: 0; }
.ax-pre__bios { overflow: hidden; text-overflow: ellipsis; }
.ax-pre__date-wrap { flex: 0 0 auto; text-align: right; }
.ax-pre__top b { color: var(--pre-accent); font-weight: 700; }
@media (max-width: 720px) {
  .ax-pre__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    font-size: 9px;
    gap: 8px;
  }
  .ax-pre__top-cpu { display: none; }
}
@media (max-width: 360px) {
  .ax-pre__key { display: none; }
  .ax-pre__top { font-size: 8.5px; }
}

/* ---- centre stage: ASCII logo + boot log ---- */
.ax-pre__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vh, 30px);
  min-height: 0;
  padding: 12px 0;
  overflow: hidden;
}

.ax-pre__ascii {
  margin: 0;
  max-width: 100%;
  font-size: clamp(3.5px, 1.05vw, 12.5px);
  line-height: 1.18;
  color: var(--pre-fg);
  text-shadow:
    0 0 6px var(--pre-glow-1),
    0 0 18px var(--pre-glow-2),
    0 0 34px var(--pre-glow-3);
  animation: axPreGlow 3.2s ease-in-out infinite;
  user-select: none;
  white-space: pre;
}
@keyframes axPreGlow {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: .82; }
  52% { opacity: 1; }
  78% { opacity: .94; }
  80% { opacity: 1; }
}

.ax-pre__log {
  width: min(640px, 92%);
  min-height: 11.2em;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--pre-fg);
}
@media (min-width: 640px) { .ax-pre__log { font-size: 13px; } }
.ax-pre__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  opacity: 0;
  transform: translateY(4px);
  animation: axPreLineIn .22s ease-out forwards;
}
.ax-pre__line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
@keyframes axPreLineIn { to { opacity: 1; transform: none; } }
.ax-pre__line .st { margin-left: auto; padding-left: 12px; font-weight: 700; }
.ax-pre__line .st--ok { color: var(--pre-ok); }
.ax-pre__line .st--success { color: #FF4D8D; }
.ax-pre__line--hot { color: var(--pre-hot); font-weight: 700; }

/* ---- bottom: status + progress + hint ---- */
.ax-pre__bottom {
  width: min(640px, 100%);
  margin: 0 auto;
}
.ax-pre__status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  margin-bottom: 8px;
}
.ax-pre__label { color: var(--pre-fg); }
.ax-pre__pct { color: var(--pre-accent); font-weight: 700; }

.ax-pre__box {
  position: relative;
  height: 18px;
  border: 2px solid var(--pre-box-border);
  background: var(--pre-box-bg);
  box-shadow: 0 0 0 2px var(--pre-bg), 0 0 18px rgba(255, 77, 141, .18);
}
.ax-pre__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0038FF 0%, #FF4D8D 55%, #FACC15 100%);
  transition: width .18s linear;
}

.ax-pre__hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--pre-faint);
}
.ax-pre__hint kbd {
  font: inherit;
  color: var(--pre-accent);
  border: 1px solid var(--pre-topline);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---- short screens (mobile landscape, small laptops) ---- */
@media (max-height: 560px) {
  .ax-pre__inner { padding-top: 12px; }
  .ax-pre__top { padding-bottom: 8px; }
  .ax-pre__stage { gap: 10px; padding: 6px 0; }
  .ax-pre__ascii { font-size: clamp(3px, 1.6vh, 7px); }
  .ax-pre__log { min-height: 0; font-size: 10px; line-height: 1.45; }
  .ax-pre__hint { display: none; }
}

@media (max-width: 480px) {
  .ax-pre__inner { padding-left: 14px; padding-right: 14px; }
  .ax-pre__stage { gap: 12px; }
  .ax-pre__log { width: 100%; font-size: 10px; line-height: 1.5; letter-spacing: 0; }
  .ax-pre__hint { font-size: 8px; line-height: 1.6; letter-spacing: .1em; }
}

/* GitHub matrix keeps its detail but is scaled into every available width. */
#matrix-wrapper {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
#github-matrix-grid {
  display: grid;
  transform-origin: top left;
  will-change: transform;
}

/* Mobile hardening for long labels and neo-brutalist shadows. */
@media (max-width: 639px) {
  nav > div { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; }
  nav > div > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav > div > div { flex: 0 0 auto; }
  .neo-parallax-card { min-width: 0; box-shadow: 6px 6px 0 0 rgba(0,0,0,.95) !important; }
  .code-window { min-width: 0; }
  .code-window__body { min-width: 0; min-height: 180px; overflow-wrap: anywhere; }
  #mobile-menu-overlay { padding: 64px 10px 10px; }
  #mobile-menu-drawer { max-height: calc(100dvh - 74px); overflow-y: auto; padding: 18px; border-radius: 16px; }
}

@media (max-width: 359px) {
  nav { padding-left: 8px !important; padding-right: 8px !important; }
  nav > div > a { font-size: 17px !important; }
  #theme-toggle { padding-left: 7px; padding-right: 7px; }
  #mobile-menu-btn { padding-left: 8px; padding-right: 8px; }
  .hero-media { height: 240px; }
  .skills__grid .card.panel, .ax-card { padding: 18px; }
  .tech.tech--icons { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ax-pre__ascii { animation: none !important; }
  .ax-pre__line { animation: none !important; opacity: 1; transform: none; }
}

/* ============================================================
   SKELETON LOADING (after the site is opened)
   ============================================================ */
.ax-skel {
  position: relative;
  background-color: rgba(148, 163, 184, .22);
  background-image: linear-gradient(
    100deg,
    rgba(148,163,184,0) 20%,
    rgba(250,204,21,.35) 45%,
    rgba(255,77,141,.28) 58%,
    rgba(148,163,184,0) 80%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: axSkelShimmer 1.25s linear infinite;
}
html.dark .ax-skel { background-color: rgba(230,237,243,.14); }
img.ax-skel { color: transparent; }
img.ax-skel::after { content: ""; }

@keyframes axSkelShimmer {
  0%   { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}

/* Small walking companion shown while media is still streaming in */
#ax-skel-hint {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 2px solid #0a0a0a;
  border-radius: 999px;
  background: #FAFAFA;
  box-shadow: 3px 3px 0 0 rgba(0,0,0,1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #0a0a0a;
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
}
#ax-skel-hint img { width: 26px; height: auto; }
#ax-skel-hint.is-done { opacity: 0; transform: translateY(8px); pointer-events: none; }
html.dark #ax-skel-hint { background: #21262d; color: #e6edf3; border-color: #e6edf3; box-shadow: 3px 3px 0 0 rgba(230,237,243,.35); }

@media (prefers-reduced-motion: reduce) {
  .ax-skel { animation-iteration-count: infinite !important; }
}

/* ================= STATS (inside SKILL MATRIX) ================= */
.skills__grid .card.panel.ax-stat{display:flex;flex-direction:column;gap:10px}
.ax-stat__top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ax-stat__label{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;font-weight:800;text-transform:uppercase;border:2px solid #0a0a0a;border-radius:999px;padding:4px 12px;box-shadow:2px 2px 0 0 rgba(0,0,0,1);background:#fff;color:#0a0a0a}
.ax-stat__label--pink{background:#FF4D8D;color:#fff}
.ax-stat__label--mint{background:#a8f0d0}
.ax-stat__value{display:flex;align-items:baseline;gap:6px;font-family:Oswald,Impact,sans-serif;color:#0a0a0a;line-height:1}
.ax-stat__num{font-size:64px;font-weight:700;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.ax-stat__plus,.ax-stat__unit{font-size:26px;font-weight:700;text-transform:uppercase}
.ax-stat__plus{color:#FF4D8D}
.ax-stat__title{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;font-weight:800;text-transform:uppercase;color:#0a0a0a;margin:0}
.ax-stat__desc{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;color:#3f3f46;margin:0}
.ax-stat__bar{height:18px;background:#fff;border:2px solid #0a0a0a;border-radius:999px;overflow:hidden;margin-top:4px}
.ax-stat__bar>i{display:block;height:100%;width:0;background:#FF4D8D;border-right:2px solid #0a0a0a;transition:width 1.2s cubic-bezier(.2,.8,.2,1)}
.ax-stat__bar.is-filled>i{width:var(--ax-bar,100%)}
html.dark .ax-stat__desc{color:#d4d4d8}
@media (max-width:520px){.ax-stat__num{font-size:48px}}
@media (prefers-reduced-motion:reduce){
  .ax-stat,.ax-stat *{animation:none!important;transition:none!important}
  .ax-stat:hover{transform:none!important}
  .ax-stat__bar>i{transition:none!important}
  .ax-stat[data-reveal]{opacity:1!important;transform:none!important}
}
html.ax-reduce .ax-stat,html.ax-reduce .ax-stat *{animation:none!important;transition:none!important}
html.ax-reduce .ax-stat:hover{transform:none!important}

/* ============================================================
   TECH STACK CHIPS — neo-brutalist, with brand icons
   ============================================================ */
.tech.tech--icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tech.tech--icons .tech__item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: #fff;
  border: 2px solid #0a0a0a;
  border-radius: 999px;
  padding: 6px 11px;
  box-shadow: 2px 2px 0 0 #000;
}
/* neutralise the generic .tech li rules from style.css */
.tech.tech--icons .tech__item:nth-child(3n),
.tech.tech--icons .tech__item:nth-child(4n) {
  background: #fff;
}
.tech.tech--icons .tech__item.tone-a { background: #facc15; }
.tech.tech--icons .tech__item.tone-b { background: #a8f0d0; }
.tech.tech--icons .tech__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tech.tech--icons .tech__icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: currentColor;
  display: block;
}
.tech.tech--icons .tech__item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 #000;
}
@media (max-width: 640px) {
  .tech.tech--icons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tech.tech--icons .tech__item { padding: 5px 9px; font-size: 9px; gap: 5px; }
  .tech.tech--icons .tech__icon { width: 12px; height: 12px; flex: 0 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tech.tech--icons .tech__item:hover { transform: none; box-shadow: 2px 2px 0 0 #000; }
}
.ax-reduce .tech.tech--icons .tech__item:hover { transform: none; box-shadow: 2px 2px 0 0 #000; }

/* ============================================================
   CUSTOM CURSOR + 3D TILT + MAGNETIC MICRO-INTERACTIONS
   ============================================================ */

/* Custom cursor only on pointer devices */
@media (pointer: fine) {
  .ax-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #FF4D8D;
    border: 2px solid #0a0a0a;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%) scale(1);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
    will-change: transform;
    mix-blend-mode: normal;
  }
  .ax-cursor.is-hover {
    width: 44px; height: 44px;
    background: rgba(250, 204, 21, 0.85);
    border-radius: 8px;
  }
  .ax-cursor.is-click {
    transform: translate(-50%, -50%) scale(0.85);
  }
  html.ax-reduce .ax-cursor,
  html.ax-loading .ax-cursor { display: none !important; }
}
@media (pointer: coarse) {
  .ax-cursor { display: none !important; }
}

/* 3D tilt wrapper */
.ax-tilt {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease-out;
}

/* Magnetic buttons/links */
.ax-magnetic {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* Staggered tech stack reveal */
.tech.tech--icons .tech__item[data-reveal] {
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.tech.tech--icons .tech__item[data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}
.tech.tech--icons .tech__item[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .ax-cursor { display: none !important; }
  .ax-tilt { transform: none !important; transition: none !important; }
  .ax-magnetic { transform: none !important; transition: none !important; }
}
html.ax-reduce .ax-cursor,
html.ax-reduce .ax-tilt,
html.ax-reduce .ax-magnetic { display: none !important; transform: none !important; transition: none !important; }

