/* ==========================================================================
   JUGNU PIXEL ART PORTFOLIO
   Live HTML content standing on a pixel-art scene that is drawn around it.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Pixelify+Sans:wght@500;600&family=Rubik:wght@400;500;600;700&display=swap');

:root {
  --gold: #ffbe3b;
  --gold-light: #ffe394;
  --amber: #f7945d;
  --neon: #ff5f8f;
  --green: #38ef7d;
  --ink: #0b1028;
  --text: #f1f0ff;
  --text-dim: #c3c6ea;
  --panel-bg: rgba(10, 14, 36, 0.84);
  --panel-edge: #2c3a7c;
  --panel-edge-light: #5a6cc4;
  --font-arcade: 'Press Start 2P', monospace;
  --font-pixel: 'Pixelify Sans', 'Rubik', sans-serif;
  /* Small text uses a clean sans so it stays readable */
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: #3a4fae;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

/* Pixel icons are generated into <i data-pix> as crisp SVG */
[data-pix] { display: inline-block; line-height: 0; }
[data-pix] svg { width: 100%; height: 100%; shape-rendering: crispEdges; display: block; }

/* --------------------------------------------------------------------------
   Background art (fills the screen, no borders) + live canvas on top of it.
   Both use the same cover fit so the canvas lines up with the art exactly.
   -------------------------------------------------------------------------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.scene img,
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--scene-x, 50%) var(--scene-y, 60%);
}
/* Upscaled pixel art stays crisp; downscaled art is smoothed so it doesn't shimmer */
.scene.crisp img,
.scene.crisp canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

.world {
  --gx: clamp(16px, 3.5vw, 56px);
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.layout {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "hero   hud"
    ".      about"
    "work   contact";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 7vw, 140px);
  row-gap: clamp(30px, 4.4vh, 46px);
  padding: clamp(20px, 4vh, 52px) clamp(16px, 3.5vw, 56px) clamp(40px, 7vh, 90px);
  max-width: 1600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  grid-area: hero;
  padding: calc(clamp(28px, 7vh, 90px) * var(--hero-k, 4) * 0.65) 0 clamp(6px, 1.4vh, 16px) clamp(0px, 0.6vw, 8px);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 22px);
  font-family: var(--font-arcade);
  font-weight: 400;
  line-height: 1;
}

.hero-hey {
  font-size: clamp(14px, min(1.9vw, 2.9vh), 25px);
  color: #fff;
  text-shadow: 3px 3px 0 #141a46, -2px -2px 0 #141a46, 2px -2px 0 #141a46, -2px 2px 0 #141a46;
  letter-spacing: 3px;
}

.hero-name {
  font-size: clamp(36px, min(5.8vw, 9vh), 82px);
  color: var(--gold);
  background: linear-gradient(180deg, #fff2a8 0%, #ffd05a 45%, #ff9b2f 55%, #f26b1d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(4px 0 0 #1d1640) drop-shadow(-4px 0 0 #1d1640) drop-shadow(0 4px 0 #1d1640) drop-shadow(0 -4px 0 #1d1640) drop-shadow(5px 6px 0 #7a2c3b);
  letter-spacing: 4px;
}

.hero-tagline {
  margin-top: clamp(20px, 3.6vh, 40px);
  font-family: var(--font-pixel);
  font-weight: 500;
  font-size: clamp(16px, min(1.4vw, 2.4vh), 21px);
  line-height: 1.45;
  color: #fff;
  text-shadow: 0 2px 0 rgba(20, 26, 70, 0.9), 0 0 16px rgba(20, 26, 70, 0.7);
  max-width: none;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   HUD (top right)
   -------------------------------------------------------------------------- */
.hud {
  grid-area: hud;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hud-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hud-btn {
  background: rgba(10, 14, 36, 0.85);
  border: 2px solid #3e4c94;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.8px;
  padding: 7px 10px;
  border-radius: 2px;
  box-shadow: inset -2px -2px 0 #161d48, inset 2px 2px 0 #6676c8;
  transition: transform 0.1s ease, background 0.1s ease;
  white-space: nowrap;
}

.hud-btn:hover { background: var(--gold); color: var(--ink); border-color: var(--gold-light); transform: translateY(-1px); }
.hud-btn.active { background: var(--amber); color: var(--ink); border-color: var(--gold); }

.stats-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: var(--panel-bg);
  border: 2px solid var(--panel-edge-light);
  box-shadow: 0 0 0 2px #0b0f2a, inset 0 0 0 2px #1a2152;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text);
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.stats-box:hover { transform: translateY(-2px); border-color: var(--gold); }

.hearts { display: flex; gap: 4px; }
.hearts [data-pix] { width: 18px; height: 16px; filter: drop-shadow(0 0 3px rgba(255, 60, 100, 0.6)); transition: transform 0.15s ease; }
.hearts [data-pix]:hover { transform: scale(1.25); }

.stat-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.stat-inf { color: var(--gold); font-size: 16px; line-height: 1; }

.bar { display: inline-flex; gap: 2px; }
.bar i { width: 9px; height: 9px; background: #1d2556; box-shadow: inset 0 0 0 1px #3a4790; }
.bar[style*="--fill:3"] i:nth-child(-n + 3),
.bar[style*="--fill:4"] i:nth-child(-n + 4),
.bar[style*="--fill:5"] i:nth-child(-n + 5) { background: var(--green); box-shadow: inset 0 0 0 1px #1d9c4f; }

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */
.panel {
  position: relative;
  background: var(--panel-bg);
  border: 3px solid var(--panel-edge);
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #070a1e,
    inset 0 0 0 2px rgba(90, 108, 196, 0.3),
    0 10px 28px rgba(6, 8, 26, 0.35);
  -webkit-backdrop-filter: blur(3px) saturate(1.15);
  backdrop-filter: blur(3px) saturate(1.15);
  padding: clamp(28px, 3.6vh, 38px) clamp(14px, 1.6vw, 24px) clamp(12px, 1.9vh, 20px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel.is-lit {
  border-color: #6a7ad0;
  box-shadow:
    0 0 0 2px #070a1e,
    inset 0 0 0 2px rgba(255, 190, 59, 0.25),
    0 0 34px rgba(255, 160, 80, 0.3);
}

.panel-tag {
  position: absolute;
  top: -19px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 9px;
  background: #0d1230;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 2px #070a1e, 3px 3px 0 2px #070a1e;
  font-family: var(--font-arcade);
  font-size: clamp(11px, 0.95vw, 13px);
  line-height: 1;
  color: #fff;
  letter-spacing: 1px;
  white-space: nowrap;
}
button.panel-tag:hover { background: var(--gold); color: var(--ink); }
.panel-tag .tri { color: var(--gold); font-size: 0.85em; }
button.panel-tag:hover .tri { color: var(--ink); }
.tag-icon { width: 20px; height: 20px; flex: 0 0 auto; }

.panel-text {
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.6;
  color: var(--text);
}

/* Skills live inside the About panel: icon tiles, names appear on hover */
.skills {
  margin-top: clamp(10px, 1.6vh, 16px);
  padding-top: clamp(10px, 1.6vh, 14px);
  border-top: 2px dashed rgba(90, 108, 196, 0.45);
}
.skills-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--gold);
}
.skills-label .tag-icon { width: 16px; height: 16px; }

.skills-grid {
  display: flex;
  gap: 8px;
}

.skill {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(44px, min(3.6vw, 6.4vh), 54px);
  aspect-ratio: 1;
  background: rgba(24, 31, 74, 0.9);
  border: 2px solid #34428a;
  box-shadow: inset -2px -2px 0 #121844, inset 2px 2px 0 #4a5bb0;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.skill [data-pix] { width: 60%; height: 60%; }
.skill:hover, .skill:focus-visible { transform: translateY(-3px); border-color: var(--gold); background: rgba(40, 50, 110, 0.95); }

.skill-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid #070a1e;
  box-shadow: 3px 3px 0 #070a1e;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}
.skill-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #070a1e;
}
.skill:hover .skill-tip, .skill:focus-visible .skill-tip { opacity: 1; transform: translate(-50%, 0); }

/* About */
.about { grid-area: about; justify-self: end; align-self: start; width: min(100%, 400px); }

/* Featured work */
.work { grid-area: work; align-self: end; max-width: 420px; }

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

.work-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--text);
  transition: transform 0.15s ease;
}
.work-card:hover, .work-card:focus-visible { transform: translateY(-4px); }

.thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: clamp(26px, 2.6vw, 36px);
  border: 3px solid #34428a;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
  transition: border-color 0.15s ease;
}
.work-card:hover .thumb { border-color: var(--gold); }

.thumb-social   { background: linear-gradient(135deg, #ff7eb6, #c45cff); }
.thumb-anim  { background: linear-gradient(135deg, #ffb35c, #ff6a3d); }
.thumb-web   { background: linear-gradient(135deg, #e9eefc, #8fa6ff); }
.thumb-brand { background: linear-gradient(135deg, #3a7bff, #1b2a6b); }

.work-title { font-weight: 700; font-size: 12px; letter-spacing: 1px; color: #fff; }
.work-sub { font-size: 12.5px; line-height: 1.3; color: var(--text-dim); }

/* The cat from the art, laid exactly over its spot on the ledge */
.perch-cat {
  position: fixed;
  left: var(--cat-x, -200px);
  top: var(--cat-y, 0);
  width: calc(var(--art-s, 0.8) * 90px);
  aspect-ratio: 90 / 79;
  transform-origin: 50% 100%;
}
.perch-cat img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; pointer-events: none; }
.perch-cat:hover .cat-tail { animation: cat-tail 1s steps(1, end) infinite; }

.cat-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid #070a1e;
  box-shadow: 3px 3px 0 #070a1e;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.cat-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: calc(50% - 4px);
  border: 4px solid transparent;
  border-top-color: #070a1e;
}
.cat-bubble.show { opacity: 1; transform: translate(-50%, 0); }

/* Idle: slow breathing, and the tail flicks every few seconds */
.cat-body { transform-origin: 60% 100%; animation: cat-breathe 3.2s steps(1, end) infinite; }
.cat-tail { transform-origin: 33% 96%; animation: cat-tail 5s steps(1, end) infinite; }
@keyframes cat-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.03); }
}
@keyframes cat-tail {
  0%, 60%, 100% { transform: rotate(0deg); }
  66% { transform: rotate(-10deg); }
  72% { transform: rotate(-18deg); }
  78% { transform: rotate(-8deg); }
  84% { transform: rotate(4deg); }
}

/* --------------------------------------------------------------------------
   Contact: "Say hi" card, Jugnu waves from inside with his head out of the box
   -------------------------------------------------------------------------- */
.contact {
  grid-area: contact;
  align-self: end;
  justify-self: end;
  width: min(100%, 420px);
  --hi-pad: clamp(24px, 3vh, 32px);
  padding-top: var(--hi-pad);
}

.hi-top {
  /* Sized so a quarter of him (half his head) sits above the card's top edge */
  --waver-w: clamp(122px, 15vh, 136px);
  position: relative;
  display: flex;
  align-items: flex-end;
  height: calc(var(--waver-w) * 0.897 - var(--hi-pad) - 3px);
  border-bottom: 3px solid var(--panel-edge);
  margin-bottom: 12px;
}

.hi-copy { flex: 1 1 auto; min-width: 0; padding: 0 calc(var(--waver-w) + 4px) 6px 0; align-self: flex-end; }
.hi-links { display: flex; gap: 8px; }
.hi-links .icon-btn { width: 32px; height: 32px; }
.hi-links .icon-btn [data-pix] { width: 18px; height: 18px; }

.waver {
  /* Anchored to the divider; taller than the card's top section, so his head pokes out above the card */
  position: absolute;
  right: -4px;
  bottom: 0;
  width: var(--waver-w);
  aspect-ratio: 102 / 122;
  cursor: pointer;
  filter: drop-shadow(0 0 14px rgba(255, 150, 90, 0.35));
}

.waver img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
  -webkit-user-drag: none;
}

/* Hand pivots at the wrist (84% / 56% of the image) */
.waver-hand {
  transform-origin: 84.1% 56.1%;
  animation: wave-hand 7s steps(1, end) infinite;
}
.waver.waving-now .waver-hand { animation: wave-hand-fast 2.2s steps(1, end) 1; }

/* Stepped rotation so the wave reads like sprite frames */
@keyframes wave-hand {
  0%, 50%, 100% { transform: rotate(0deg); }
  55% { transform: rotate(7deg); }
  60% { transform: rotate(14deg); }
  65% { transform: rotate(3deg); }
  70% { transform: rotate(-8deg); }
  75% { transform: rotate(3deg); }
  80% { transform: rotate(14deg); }
  85% { transform: rotate(3deg); }
  90% { transform: rotate(-8deg); }
  95% { transform: rotate(0deg); }
}
@keyframes wave-hand-fast {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-9deg); }
  45% { transform: rotate(15deg); }
  60% { transform: rotate(-9deg); }
  75% { transform: rotate(15deg); }
  90%, 100% { transform: rotate(0deg); }
}

.waver-bubble {
  position: absolute;
  top: 2px;
  right: calc(100% - 6px);
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  border: 2px solid #070a1e;
  box-shadow: 3px 3px 0 #070a1e;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.waver-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 10px;
  border: 4px solid transparent;
  border-top-color: #070a1e;
  border-right-color: #070a1e;
}
.waver-bubble.show { opacity: 1; transform: translateY(0); }

.neon-sign {
  font-family: var(--font-arcade);
  font-weight: 400;
  font-size: clamp(12px, min(1vw, 1.4vh), 14px);
  line-height: 1.55;
  color: #ffd9e6;
  text-shadow: 0 0 4px #ff8fb4, 0 0 10px var(--neon), 0 0 22px #ff3d7a;
  animation: neon-flicker 6s infinite;
  margin-bottom: 8px;
}
@keyframes neon-flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.6; }
}

.hi-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; }

.hi-form input {
  width: 100%;
  background: rgba(18, 24, 60, 0.95);
  border: 2px solid #3e4c94;
  padding: 8px 10px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.15s ease;
}
.hi-form input::placeholder { color: #9198c8; }
.hi-form input:focus { border-color: var(--gold); }


.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: rgba(24, 31, 74, 0.95);
  border: 2px solid #3e4c94;
  box-shadow: inset -2px -2px 0 #121844, inset 2px 2px 0 #4a5bb0;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.icon-btn:hover, .icon-btn:focus-visible { transform: translateY(-2px); border-color: var(--gold); background: #2a3780; }
.icon-btn [data-pix] { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Buttons used in the card and modals
   -------------------------------------------------------------------------- */
.action-arcade-btn {
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-arcade);
  font-size: 11px;
  padding: 11px 16px;
  border: none;
  border-radius: 2px;
  box-shadow: 0 4px 0 #a86b12;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.action-arcade-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #a86b12; background: #ffd066; }
.action-arcade-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a86b12; }

:focus-visible { outline: 2px dashed var(--gold); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   CRT overlay (off by default)
   -------------------------------------------------------------------------- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: linear-gradient(rgba(18, 16, 26, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
  background-size: 100% 3px;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease;
}
.crt-overlay.disabled { opacity: 0; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.arcade-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 24, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.arcade-modal-backdrop.open { opacity: 1; pointer-events: auto; }

.arcade-modal-box {
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #0e1334;
  border: 3px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 0 35px rgba(255, 190, 59, 0.35), inset 0 0 20px rgba(30, 40, 100, 0.8);
  padding: 20px 24px;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.arcade-modal-backdrop.open .arcade-modal-box { transform: none; }

.modal-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #2c3a7c;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-arcade);
  font-size: 13px;
  line-height: 1.5;
  color: var(--gold);
  text-shadow: 2px 2px 0 #8b4a1f;
}

.modal-close-btn {
  flex: 0 0 auto;
  background: #2c3a7c;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 2px;
}
.modal-close-btn:hover { background: #ff5722; color: #fff; border-color: #ff7043; }

.modal-content-body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: #e2e3f7;
}

.modal-label { font-family: var(--font-body); font-weight: 700; letter-spacing: 1px; font-size: 12px; color: var(--gold); margin-bottom: 6px; text-transform: uppercase; }
.modal-split { display: flex; gap: 18px; }
.modal-split > :first-child { flex: 0 0 38%; }
.modal-card {
  background: #080b22;
  border: 2px solid #3e4c94;
  padding: 14px;
  border-radius: 3px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #182050; border: 1px solid #3e4c94; padding: 4px 8px; font-size: 13px; color: var(--gold-light); border-radius: 2px; }

/* Work galleries */
.arcade-modal-box.wide { max-width: 980px; }
.thumb-pix { display: block; width: 38%; max-width: 64px; filter: drop-shadow(3px 3px 0 rgba(11, 16, 40, 0.45)); transition: transform 0.15s steps(2); }
.thumb-pix svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.work-card:hover .thumb-pix { transform: translateY(-3px) scale(1.08); }
.video-tile { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #ffb35c, #ff6a3d); }
.video-tile svg { width: 22%; shape-rendering: crispEdges; }
.gallery-item .video-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-tile:has(img)::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 2h1v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-1z' fill='%23fff'/%3E%3C/svg%3E") center / 18% no-repeat, rgba(11, 16, 40, 0.18); image-rendering: pixelated; }
.viewer-video { aspect-ratio: 16 / 9; }
.viewer-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.gallery-intro { margin-bottom: 14px; color: var(--text-dim); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 42vw), 1fr)); gap: 12px; }
.gallery-item {
  display: flex; flex-direction: column; text-align: left;
  background: #080b22; border: 2px solid #3e4c94; padding: 0; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gallery-item:hover, .gallery-item:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-cap { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 13px; line-height: 1.3; color: var(--text-dim); }
.gallery-cap b { color: #fff; font-weight: 600; }
.viewer-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.viewer-cap { flex: 1 1 auto; font-size: 14px; color: var(--text-dim); }
.viewer-cap b { color: #fff; }
.viewer-nav { display: flex; gap: 6px; }
.viewer { background: #080b22; border: 2px solid #3e4c94; }
.viewer img { width: 100%; display: block; }

.project-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.stat-pill { background: #141b48; border: 1px solid #3e4c94; padding: 6px 10px; border-radius: 2px; }
.stat-pill .label { font-weight: 600; letter-spacing: 1px; font-size: 11px; color: #a3a9d8; }
.stat-pill .val { font-size: 16px; font-weight: 700; color: var(--gold); }

.modal-action-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Toast */
.retro-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%) translateY(40px);
  background: #0e1334;
  border: 2px solid var(--green);
  color: var(--green);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 3px;
  box-shadow: 0 0 20px rgba(56, 239, 125, 0.35);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.retro-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Short laptop screens: keep everything on one screen */
@media (max-height: 800px) and (min-width: 861px) {
  .neon-sign { margin-bottom: 4px; }
}

/* Anchored mode (set by script.js when everything fits on one screen):
   panels stand on the roads in the art. --walk / --wall / --bridge are the
   screen y of the upper road, the lower-left promenade and the bridge. */
.world.anchored .layout {
  display: block;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-width: none;
  padding: 0;
}
/* Let clicks through the empty layout to the cat behind it */
.layout { pointer-events: none; }
.layout > * { pointer-events: auto; }
.world.anchored .hero    { position: absolute; left: var(--gx); top: 0; }
.world.anchored .hud     { position: absolute; right: var(--gx); top: clamp(12px, 2vh, 24px); }
.world.anchored .about   { position: absolute; left: var(--about-x, 50%); bottom: calc(100% - var(--walk)); width: var(--about-own-w, var(--about-w, 400px)); }
.world.anchored .work    { position: absolute; left: var(--work-x, var(--gx)); bottom: calc(100% - var(--wall)); width: min(400px, 26vw); }
.world.anchored .contact { position: absolute; right: var(--hi-right, var(--gx)); bottom: calc(100% - var(--bridge)); width: var(--about-w, 400px); }
/* Shorter screens: a slimmer Featured Work so it fits on one screen */
.world.anchored.tight .work-sub { display: none; }
.world.anchored.tight .thumb { aspect-ratio: 16 / 8; }

@media (max-width: 1100px) {
  .layout { column-gap: 32px; }
}

@media (max-width: 860px) {
  .hero-tagline { white-space: normal; max-width: 30ch; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hud" "hero" "about" "work" "contact";
    grid-template-rows: none;
    row-gap: 46px;
    padding-bottom: 120px;
  }
  .hud { justify-self: end; }
  .hud .stats-box { display: none; }
  .hero { padding-top: 31px; }
  .about, .work, .contact { max-width: none; width: 100%; justify-self: stretch; }
  .contact { margin-top: 40px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .thumb { aspect-ratio: 16 / 9; }
}

@media (max-width: 520px) {
  .skills-grid { justify-content: space-between; gap: 6px; }
  .skill { width: auto; flex: 1 1 0; max-width: 58px; }
  .hi-form { grid-template-columns: minmax(0, 1fr); }
  .hi-form .action-arcade-btn { justify-self: start; }
  .hi-top { --waver-w: 124px; }
  .neon-sign { font-size: 12px; }
  .modal-split { flex-direction: column; }
  .hud-btn { font-size: 11px; padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
