﻿@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ============ ROOT VARIABLES ============ */
:root {
  --bg: #f4f3f1;
  --ink: #1a1a1a;
  --sub: #999;
  --art-1: #111111;
  --art-2: #8c8c8c;
  --art-3: #f5f5f5;
  --art-4: #4c4c4c;
  --pixel: 'Press Start 2P', monospace;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 10px;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='6' height='6' fill='%23f4f3f1'/%3E%3Crect width='1' height='1' x='3' y='0' fill='%23eeedeb' fill-opacity='.4'/%3E%3Crect width='1' height='1' x='0' y='3' fill='%23eeedeb' fill-opacity='.3'/%3E%3C/svg%3E");
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(18px);
  opacity: .28;
  mix-blend-mode: multiply;
  animation: ambientFloat 14s ease-in-out infinite;
}

body::before {
  width: 22vw;
  height: 22vw;
  left: -4vw;
  top: 10vh;
  background: radial-gradient(circle, rgba(26, 26, 26, 0.16), rgba(26, 26, 26, 0));
}

body::after {
  width: 18vw;
  height: 18vw;
  right: -2vw;
  bottom: 8vh;
  background: radial-gradient(circle, rgba(166, 124, 82, 0.22), rgba(166, 124, 82, 0));
  animation-delay: -7s;
}

body.art-mode {
  --bg: #171512;
  --ink: #f2eee6;
  --sub: rgba(242, 238, 230, 0.58);
  --lamp: #e4b86a;
  --lamp-soft: rgba(228, 184, 106, 0.22);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 55% at 88% 78%, rgba(228, 184, 106, 0.18), transparent 62%),
    radial-gradient(ellipse 50% 40% at 12% 18%, rgba(242, 238, 230, 0.06), transparent 55%),
    url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='6' height='6' fill='%23171512'/%3E%3Crect width='1' height='1' x='3' y='0' fill='%231c1915' fill-opacity='.9'/%3E%3Crect width='1' height='1' x='0' y='3' fill='%231a1713' fill-opacity='.8'/%3E%3C/svg%3E");
  color: var(--ink);
}

body.art-mode::before,
body.art-mode::after {
  opacity: .5;
  filter: blur(28px);
  mix-blend-mode: screen;
  animation-duration: 16s;
}

body.art-mode::before {
  width: 28vw;
  height: 28vw;
  left: auto;
  right: 4vw;
  top: auto;
  bottom: 6vh;
  background: radial-gradient(circle, rgba(228, 184, 106, 0.45), rgba(228, 184, 106, 0));
}

body.art-mode::after {
  width: 20vw;
  height: 20vw;
  right: auto;
  left: -2vw;
  bottom: auto;
  top: 12vh;
  background: radial-gradient(circle, rgba(242, 238, 230, 0.1), rgba(242, 238, 230, 0));
  animation-delay: -5s;
}

body.art-mode .mode-btn {
  background: #211e1a;
  color: var(--ink);
  border-color: rgba(242, 238, 230, 0.55);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

body.art-mode .mode-btn:hover,
body.art-mode .mode-btn.active {
  background: var(--lamp);
  color: #171512;
  border-color: var(--lamp);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

body.art-mode .terminal-corner-btn {
  background: #211e1a;
  color: var(--ink);
  border-color: rgba(242, 238, 230, 0.55);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

body.art-mode .terminal-corner-btn:hover {
  background: var(--lamp);
  color: #171512;
  border-color: var(--lamp);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

body.art-mode .topbar a {
  color: var(--sub);
}

body.art-mode .topbar a::after {
  background: var(--lamp);
  box-shadow: none;
}

body.art-mode .topbar a:hover {
  color: var(--ink);
}

body.art-mode .sfx-btn {
  opacity: 0.78;
}

body.art-mode .sfx-btn:hover {
  opacity: 1;
}

body.art-mode .hub {
  text-shadow: none;
}

body.art-mode .sticky.s1,
body.art-mode .sticky.s3 {
  background: #f2eee6;
  color: #1a1a1a;
  border-color: rgba(228, 184, 106, 0.35);
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.35);
}

body.art-mode .sticky.s2 {
  background: var(--lamp);
  color: #171512;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
}

body.art-mode .sticky::before {
  background: rgba(0, 0, 0, 0.12);
}

body.art-mode .shelf-line {
  background: linear-gradient(90deg, transparent 0%, var(--ink) 8%, var(--lamp) 50%, var(--ink) 92%, transparent 100%);
  box-shadow: 0 0 12px rgba(228, 184, 106, 0.25);
}

body.art-mode .shelf-shadow {
  background: linear-gradient(to bottom, rgba(228, 184, 106, 0.12), transparent);
}

body.art-mode .shelf-hint {
  color: rgba(242, 238, 230, 0.45);
}

body.art-mode .hero-desc b {
  color: var(--lamp);
}

body.art-mode .panel-bg {
  background: rgba(10, 8, 6, 0.55);
}

body.art-mode .panel-overlay.open .panel-bg {
  background: rgba(10, 8, 6, 0.7);
}

body.art-mode .panel {
  border-top-color: var(--lamp);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

body.art-mode .tool-window {
  background: #211e1a;
  border-color: rgba(242, 238, 230, 0.4);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.7);
}

body.art-mode .tool-bar {
  background: #1a1713;
  border-bottom-color: rgba(228, 184, 106, 0.25);
}

body.art-mode .tool-close {
  background: #211e1a;
  color: var(--ink);
  border-color: rgba(242, 238, 230, 0.35);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

body.art-mode .tool-close:hover {
  background: var(--lamp);
  color: #171512;
  border-color: var(--lamp);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.65);
}

body.art-mode .panel-close,
body.art-mode .toast,
body.art-mode .pet-dock.speaking,
body.art-mode .pet-bubble {
  background: #211e1a;
  color: var(--ink);
  border-color: rgba(242, 238, 230, 0.35);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

body.art-mode .toast {
  border-color: rgba(228, 184, 106, 0.45);
}

body.art-mode .pet-dock.speaking {
  background: rgba(33, 30, 26, 0.94);
}

body.art-mode .quest-item {
  background: #211e1a;
  border-color: rgba(242, 238, 230, 0.25);
  color: var(--ink);
}

body.art-mode .quest-item.done {
  border-color: rgba(228, 184, 106, 0.55);
  color: var(--lamp);
}

body.art-mode .quest-fill {
  background: var(--lamp);
}

body.art-mode .shortcut-item kbd,
body.art-mode .shortcuts-footer kbd {
  background: #171512;
  color: var(--lamp);
  border-color: rgba(228, 184, 106, 0.45);
}

body.art-mode .social-popout .shelf-badge .social-icon {
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.55));
}

body.chess-mode {
  --bg: #ececec;
  --ink: #111111;
  --sub: #666;
  background-image:
    linear-gradient(45deg, rgba(17, 17, 17, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 17, 17, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17, 17, 17, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17, 17, 17, 0.06) 75%),
    linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 48%, #f3f3f3 100%);
  background-size: 48px 48px, 48px 48px, 48px 48px, 48px 48px, cover;
  color: var(--ink);
}

body.chess-mode::before,
body.chess-mode::after {
  opacity: 0.16;
  filter: blur(12px);
  mix-blend-mode: multiply;
  animation-duration: 18s;
}

body.chess-mode .page {
  background:
    radial-gradient(circle at 14% 20%, rgba(17, 17, 17, 0.06), transparent 22%),
    radial-gradient(circle at 82% 82%, rgba(255, 255, 255, 0.72), transparent 26%);
}

body.chess-mode .hub {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.chess-mode .shelf-line {
  background: repeating-linear-gradient(90deg, #111 0 14px, #e7e7e7 14px 28px);
  box-shadow: none;
}

body.chess-mode .shelf-shadow {
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0.12), transparent);
}

body.chess-mode .panel,
body.chess-mode .panel-bar,
body.chess-mode .card,
body.chess-mode .tool-window,
body.chess-mode .tool-bar {
  background: #f8f8f8;
  color: #111;
}

body.chess-mode .quest-track,
body.chess-mode .quest-item,
body.chess-mode .resume-btn,
body.chess-mode .tool-close,
body.chess-mode .tool-window,
body.chess-mode .tool-bar {
  border-color: #111;
  box-shadow: 4px 4px 0 #111;
}

body.chess-mode .terminal-window {
  background: #111;
  color: #f5f5f5;
  border-color: #f5f5f5;
  box-shadow: 8px 8px 0 #111;
}

body.chess-mode .terminal-window .tool-bar {
  background: #f5f5f5;
  color: #111;
}

body.chess-mode .pet-dock.speaking {
  background: rgba(248, 248, 248, 0.96);
  border-color: #111;
  box-shadow: 4px 4px 0 #111;
}

body.chess-mode .pet-bubble {
  background: #111;
  color: #f5f5f5;
  border-color: #f5f5f5;
}

body.chess-mode .pet-bubble::after {
  border-top-color: #111;
}

body.chess-mode .topbar a::after {
  background: #111;
  box-shadow: none;
}

body.chess-mode .mode-btn.active {
  background: #111;
  color: #fff;
}

body.chess-mode .terminal-corner-btn {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: 2px 2px 0 #111;
}

body.chess-mode .terminal-corner-btn:hover {
  background: #f8f8f8;
  color: #111;
  box-shadow: 3px 3px 0 #111;
}

body.chess-mode .mode-btn {
  background: #f8f8f8;
  border-color: #111;
  box-shadow: 2px 2px 0 #111;
}

body.chess-mode .mode-btn:hover,
body.chess-mode .mode-btn.active {
  background: #111;
  color: #fff;
  box-shadow: 3px 3px 0 #111;
}

body.recruiter-mode .shelf-deco {
  opacity: 0.25;
}

body.recruiter-mode .shelf-deco canvas,
body.recruiter-mode .shelf-deco .lamp-glow,
body.recruiter-mode .shelf-deco .s-lbl {
  animation: none !important;
  transition: none !important;
}

body.recruiter-mode .sticky {
  animation-duration: 7s;
}

body.recruiter-mode .page.show .shelf-items>* {
  animation-duration: 0.45s;
}

body.recruiter-mode .hero-desc,
body.recruiter-mode .about-text p,
body.recruiter-mode .cart-desc,
body.recruiter-mode .lb-desc,
body.recruiter-mode .go-sub {
  color: #333;
}

::selection {
  background: var(--ink);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

canvas {
  image-rendering: pixelated;
  display: block;
}

/* ============ LOADING SPINNER ============ */
.loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--sub);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ BOOT ============ */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  color: #fff;
  padding: 40px;
  font-size: 9px;
  line-height: 2.6;
  display: flex;
  flex-direction: column;
}

.boot.done {
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}

.boot.gone {
  display: none;
}

.boot-line {
  opacity: 0;
  transform: translateY(4px);
  transition: all .15s ease;
}

.boot-line.show {
  opacity: 1;
  transform: translateY(0);
}

.boot-line .dim {
  color: #555;
}

.boot-bar {
  margin-top: 12px;
  height: 3px;
  width: 200px;
  background: #222;
}

.boot-bar-fill {
  height: 100%;
  width: 0;
  background: #fff;
  transition: width .7s ease;
}

/* ============ PAGE WRAPPER ============ */
.page {
  opacity: 0;
  transition: opacity .5s ease;
  position: relative;
  z-index: 1;
}

.page.show {
  opacity: 1;
}

/* ============ HUB SCREEN ============ */
.hub {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 6vw;
}

/* ============ TOP BAR ============ */

.topbar {
  height: 76px;
  flex-shrink: 0;
  pointer-events: none;
}

.topbar-left {
  position: fixed;
  top: 20px;
  left: 64px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.sfx-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  opacity: 0.82;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sfx-btn:hover {
  opacity: 1;
  transform: translateY(-3px) scale(1.08);
}

.sfx-btn:active {
  transform: translateY(1px) scale(0.94);
}

.sfx-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

/* Terminal Corner Button */
.terminal-corner-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 40;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background 0.2s ease,
              color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-family: var(--pixel);
  flex-shrink: 0;
}

.terminal-corner-btn:hover {
  transform: translate(-2px, -3px) scale(1.06);
  box-shadow: 4px 5px 0 var(--ink);
}

.terminal-corner-btn:active {
  transform: translate(1px, 2px) scale(0.96);
  box-shadow: 1px 1px 0 var(--ink);
}

.terminal-corner-icon {
  font-weight: bold;
  font-size: 12px;
  line-height: 1;
  display: inline-block;
  letter-spacing: -1px;
  font-family: var(--pixel);
}

/* Mode buttons - clustered with terminal */
.mode-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background-color 0.18s ease,
              color 0.18s ease;
  font-family: var(--pixel);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.mode-btn canvas {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  display: block;
  transform-origin: center center;
}

.mode-btn:hover {
  transform: translate(-2px, -3px) scale(1.06);
  box-shadow: 4px 5px 0 var(--ink);
}

.mode-btn:active {
  transform: translate(1px, 2px) scale(0.96);
  box-shadow: 1px 1px 0 var(--ink);
}

.mode-btn.active {
  background: var(--ink);
  color: #fff;
  animation: modeActivePulse 1.8s ease-in-out infinite;
}

.mode-btn.active canvas {
  filter: invert(1);
}

body.art-mode .mode-btn.active canvas {
  filter: none;
}

/* ============ HERO ============ */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding-bottom: 40px;
}

.hero-greeting {
  font-size: 9px;
  color: var(--sub);
  margin-bottom: 10px;
}

.hero-name {
  font-size: clamp(18px, 4.2vw, 38px);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 9px;
  color: var(--sub);
  line-height: 2.2;
  max-width: 420px;
  margin-top: 18px;
}

.hero-desc b {
  color: var(--ink);
}

.notes-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-right: 2vw;
}

.sticky {
  padding: 14px 18px;
  font-size: 8px;
  line-height: 2;
  max-width: 180px;
  position: relative;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
}

.sticky::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 10px;
  background: rgba(0, 0, 0, 0.06);
}

.sticky.s1 {
  background: #fff;
  border: 1.5px solid #ddd;
  animation: floatS1 3.4s ease-in-out infinite;
}

.sticky.s2 {
  background: var(--ink);
  color: #fff;
  animation: floatS2 3.8s ease-in-out infinite 0.5s;
}

.sticky.s3 {
  background: #fff;
  border: 1.5px solid #ddd;
  font-size: 6px;
  animation: floatS3 3.2s ease-in-out infinite 1s;
}

.sticky:hover {
  animation-play-state: paused;
  transform: scale(1.1) rotate(0deg) translateY(-10px) !important;
  box-shadow: 6px 12px 26px rgba(0, 0, 0, 0.14) !important;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.28s ease;
}

/* ============ SHELF ============ */
.shelf-section {
  padding: 0 0 30px;
}

.shelf-hint {
  text-align: center;
  font-size: 7px;
  color: var(--sub);
  margin-bottom: 16px;
}

.shelf-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.shelf-line {
  height: 2px;
  background: var(--ink);
  width: 100%;
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.shelf-shadow {
  height: 6px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), transparent);
  position: relative;
  z-index: 1;
}

.shelf-items {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 0 20px;
  position: relative;
  top: -2px;
  z-index: 2;
}

.shelf-obj {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.shelf-obj-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform .28s cubic-bezier(.175, .885, .32, 1.275);
  cursor: pointer;
  padding: 6px;
  margin: -6px;
  -webkit-tap-highlight-color: transparent;
}

.shelf-obj-btn:hover {
  transform: translateY(-10px) scale(1.08);
}

.shelf-obj-btn:hover .s-lbl {
  color: var(--ink);
  transform: translateY(-2px);
}

.shelf-obj-btn canvas {
  width: 28px;
  height: 28px;
  transform-origin: center center;
  will-change: transform;
}

.shelf-obj-btn .s-lbl {
  font-size: 5.5px;
  color: var(--sub);
  letter-spacing: 0.02em;
  transition: color .2s ease, transform .28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
}

/* Icon sizes */
#ic-robot,
#ic-knight {
  width: 24px !important;
  height: 24px !important;
}

#ic-frame,
#ic-terminal,
#ic-gear,
#ic-trophy,
#ic-mail {
  width: 30px !important;
  height: 30px !important;
}

#ic-cup {
  width: 24px !important;
  height: 24px !important;
}

#ic-lamp {
  width: 26px !important;
  height: 32px !important;
}

#ic-pet {
  width: 32px !important;
  height: 32px !important;
}

.cabinet-icon {
  font-size: 28px;
  line-height: 30px;
  height: 30px;
  display: inline-block;
  transform-origin: center bottom;
  will-change: transform;
}

/* ---- Unique per-icon hover / press motions ---- */
#btn-robot:hover #ic-robot,
#btn-robot:active #ic-robot {
  animation: robotExcited 0.55s ease-in-out infinite;
}

#btn-knight:hover #ic-knight,
#btn-knight:active #ic-knight {
  animation: knightCharge 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

#btn-frame:hover #ic-frame,
#btn-frame:active #ic-frame {
  animation: frameFocus 0.7s ease-in-out infinite;
}

#btn-terminal:hover #ic-terminal,
#btn-terminal:active #ic-terminal {
  animation: terminalBoot 0.45s steps(3, end) infinite;
}

#btn-cup:hover #ic-cup,
#btn-cup:active #ic-cup {
  animation: cupSip 0.65s ease-in-out infinite;
}

#btn-cabinet:hover .cabinet-icon,
#btn-cabinet:active .cabinet-icon {
  animation: cabinetOpen 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

#btn-gear:hover #ic-gear,
#btn-gear:active #ic-gear {
  animation: gearSpinFast 1.1s linear infinite;
}

#btn-trophy:hover #ic-trophy,
#btn-trophy:active #ic-trophy {
  animation: trophyFloat 0.9s ease-in-out infinite;
}

#btn-mail:hover #ic-mail,
#btn-mail:active #ic-mail {
  animation: mailFlap 0.55s ease-in-out infinite;
}

#btn-lamp:hover #ic-lamp,
#btn-lamp:active #ic-lamp {
  animation: lampFlicker 0.4s ease-in-out infinite;
}

/* Topbar icon hover / press motions */
.terminal-corner-btn:hover .terminal-corner-icon,
.terminal-corner-btn:active .terminal-corner-icon {
  animation: promptRush 0.35s steps(2, start) infinite;
}

#ic-recruiter {
  transform-origin: center bottom;
}
#recruiterToggle:hover #ic-recruiter,
#recruiterToggle:active #ic-recruiter {
  animation: recruiterWave 0.55s ease-in-out infinite;
}

#questToggle:hover #ic-quest,
#questToggle:active #ic-quest {
  animation: questUnroll 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

#helpToggle:hover #ic-help,
#helpToggle:active #ic-help {
  animation: helpBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

.sfx-btn:hover .sfx-icon,
.sfx-btn:active .sfx-icon {
  animation: sfxRing 0.55s ease-in-out infinite;
}

.shelf-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: #fff;
  font-size: 6px;
  padding: 4px 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all .15s ease;
}

.shelf-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}

.shelf-obj-btn:hover .shelf-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.shelf-deco {
  opacity: .45;
}

.shelf-deco canvas {
  animation: bob 3.5s ease-in-out infinite;
}

.shelf-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.contact-obj {
  position: relative;
}

.social-popout {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.social-popout::after {
  display: none;
}

.social-popout .shelf-badge {
  margin: 0;
  padding: 4px;
  opacity: 0;
  transform: translateY(18px) scale(0.6);
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .22s ease;
}

.social-popout .shelf-badge .social-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.25));
  border-radius: 3px;
  transform-origin: center center;
}

.social-popout .shelf-badge:nth-child(1):hover .social-icon {
  animation: githubSpin 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

.social-popout .shelf-badge:nth-child(2):hover .social-icon {
  animation: linkedinBounce 0.55s ease-in-out infinite;
}

.social-popout .shelf-badge:nth-child(1) {
  transition-delay: 0s;
}

.social-popout .shelf-badge:nth-child(2) {
  transition-delay: 0.05s;
}

.contact-obj:hover .social-popout,
.contact-obj:focus-within .social-popout,
.social-popout:hover,
.social-popout.show {
  opacity: 1;
  pointer-events: auto;
}

.contact-obj:hover .social-popout .shelf-badge,
.contact-obj:focus-within .social-popout .shelf-badge,
.social-popout:hover .shelf-badge,
.social-popout.show .shelf-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contact-obj:hover .social-popout .shelf-badge:nth-child(1),
.contact-obj:focus-within .social-popout .shelf-badge:nth-child(1),
.social-popout:hover .shelf-badge:nth-child(1),
.social-popout.show .shelf-badge:nth-child(1) {
  transform: translate(-10px, -4px) rotate(-8deg) scale(1);
}

.contact-obj:hover .social-popout .shelf-badge:nth-child(2),
.contact-obj:focus-within .social-popout .shelf-badge:nth-child(2),
.social-popout:hover .shelf-badge:nth-child(2),
.social-popout.show .shelf-badge:nth-child(2) {
  transform: translate(10px, -4px) rotate(8deg) scale(1);
}

.social-popout .shelf-badge:hover {
  transform: translateY(-8px) scale(1.12) rotate(0deg) !important;
}

.badge-sq {
  display: none;
}

.shelf-badge .s-lbl {
  font-size: 5px;
  color: var(--sub);
  transition: color .15s ease;
}

.shelf-badge:hover .s-lbl {
  color: var(--ink);
}

/* ============ FOOTER ============ */
.hub-footer {
  text-align: center;
  padding: 16px 0 20px; /* Reduced from 20px to 16px */
  font-size: 7px;
  color: var(--sub);
}

/* ============ PANEL ============ */
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.panel-overlay.open {
  pointer-events: auto;
  opacity: 1;
}

.panel-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.panel-overlay.open .panel-bg {
  backdrop-filter: blur(5px);
  background: rgba(0, 0, 0, 0.25);
}

.panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 2px solid var(--ink);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.175, .885, .32, 1.1);
}

.panel-overlay.open .panel {
  transform: translateY(0);
}

.panel-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 6vw;
  background: var(--bg);
  border-bottom: 1px solid #ddd;
}

.panel-close {
  font-size: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.panel-close:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.panel-title {
  font-size: 8px;
  color: var(--sub);
}

.panel-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 50px 6vw 80px;
}

/* ============ TOOL OVERLAYS ============ */
.tool-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(5px);
  transition: opacity 0.25s ease;
}

.tool-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.tool-window {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(980px, 94vw);
  max-height: 84vh;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--bg);
  box-shadow: 8px 8px 0 var(--ink);
  transform: translate(-50%, -46%) scale(0.96);
  transition: transform 0.25s cubic-bezier(.16, 1, .3, 1);
}

.tool-overlay.open .tool-window {
  transform: translate(-50%, -50%) scale(1);
}

.tool-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.tool-title {
  font-size: 8px;
  color: var(--sub);
}

.tool-close {
  font-size: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.18s cubic-bezier(.16, 1, .3, 1), box-shadow 0.18s cubic-bezier(.16, 1, .3, 1);
}

.tool-close:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

/* ============ TERMINAL ============ */
.terminal-window {
  background: #0b0b0b;
  color: #f5f5f5;
  border-color: #f5f5f5;
  box-shadow: 8px 8px 0 #f5f5f5;
}

.terminal-window .tool-bar {
  background: #111;
  border-bottom-color: #2d2d2d;
  color: #f5f5f5;
}

.terminal-window .tool-close {
  background: #111;
  color: #f5f5f5;
  border-color: #f5f5f5;
  box-shadow: 3px 3px 0 #f5f5f5;
}

.terminal-window .tool-close:hover {
  box-shadow: 4px 4px 0 #f5f5f5;
}

.terminal-body {
  padding: 16px;
  display: grid;
  gap: 12px;
  font-size: 8px;
  line-height: 1.9;
}

.terminal-output {
  max-height: 50vh;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 6px;
}

.terminal-line {
  white-space: pre-wrap;
}

.terminal-line.dim {
  color: #b0b0b0;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #2d2d2d;
  padding-top: 12px;
}

.terminal-input-row span {
  color: #b0b0b0;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f5f5f5;
  font: inherit;
}

.terminal-input::placeholder {
  color: #666;
}

.terminal-hint {
  font-size: 6px;
  color: #555;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #1a1a1a;
}

/* ============ SHORTCUTS ============ */
.shortcuts-window {
  max-width: 600px;
}

.shortcuts-body {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--sub);
  font-size: 8px;
}

.shortcut-item kbd {
  background: var(--ink);
  color: #fff;
  padding: 2px 8px;
  font-family: var(--pixel);
  font-size: 7px;
  min-width: 40px;
  text-align: center;
}

.shortcut-item span {
  color: var(--sub);
}

.shortcuts-footer {
  text-align: center;
  font-size: 7px;
  color: var(--sub);
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

.shortcuts-footer kbd {
  background: var(--ink);
  color: #fff;
  padding: 2px 6px;
  font-family: var(--pixel);
  font-size: 6px;
}

/* ============ QUEST LOG ============ */
.quest-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.quest-overview {
  display: grid;
  gap: 10px;
}

.quest-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quest-track {
  width: min(100%, 520px);
  height: 12px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px #ececec;
  overflow: hidden;
}

.quest-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ink), #777);
  transition: width 0.3s ease;
}

.quest-status,
.quest-reward {
  font-size: 8px;
  line-height: 1.8;
  color: var(--sub);
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quest-item {
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 8px;
  line-height: 1.8;
}

.quest-item.done {
  background: var(--ink);
  color: #fff;
}

.quest-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.resume-btn {
  font-size: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.18s cubic-bezier(.16, 1, .3, 1), box-shadow 0.18s cubic-bezier(.16, 1, .3, 1), background-color 0.15s ease, color 0.15s ease;
}

.resume-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.resume-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============ TOASTS ============ */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1400;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 8px 10px;
  max-width: 280px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 7px;
  line-height: 1.8;
}

/* ============ PET ============ */
.pet-dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1350;
  width: auto;
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.16, 1, .3, 1), opacity 0.2s ease;
}

.pet-dock.speaking {
  width: min(260px, 88vw);
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.pet-dock:hover {
  transform: translate(-1px, -1px);
}

.pet-canvas-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

#ic-pet {
  width: 32px !important;
  height: 32px !important;
  transform-origin: center bottom;
}

.pet-dock:hover #ic-pet {
  animation: petHappy 0.45s ease-in-out infinite;
}

.pet-dock:hover .pet-canvas-wrap {
  animation: petFloat 0.55s ease-in-out infinite;
}

.pet-bubble {
  display: none;
  position: relative;
  flex: 1;
  min-height: 36px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 8px 10px;
  font-size: 7px;
  line-height: 1.8;
}

.pet-dock.speaking .pet-bubble {
  display: block;
}

.pet-bubble::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 12px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: #fff;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.pet-dock.wave .pet-canvas-wrap {
  animation: petWave .3s steps(2) 3;
}

.pet-dock.jump {
  animation: petJump .5s cubic-bezier(.2, .8, .3, 1);
}

.pet-dock.sleeping {
  opacity: .72;
  transform: translateY(5px);
}

.pet-dock.sleeping .pet-canvas-wrap {
  animation: petSleep 1.4s ease-in-out infinite;
}

@keyframes petWave {
  50% {
    transform: rotate(-13deg) translateY(-4px);
  }
}

@keyframes petJump {
  45% {
    transform: translateY(-38px);
  }
  70% {
    transform: translateY(-8px);
  }
}

@keyframes petSleep {
  50% {
    transform: translateY(3px);
  }
}

/* ============ SECTION STYLES ============ */
.sec-head {
  margin-bottom: 36px;
}

.sec-eyebrow {
  font-size: 8px;
  color: var(--sub);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sec-eyebrow::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--ink);
}

.sec-head h2 {
  font-size: clamp(12px, 2.2vw, 18px);
  letter-spacing: 0.01em;
}

.card {
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
}

.about-text p {
  font-size: 9px;
  line-height: 2.2;
  color: #444;
  margin-bottom: 14px;
}

.about-text b {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.stat-block {
  padding: 6px 18px;
}

.stat-block .row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #ccc;
  padding: 12px 0;
  font-size: 8px;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-block .row:last-child {
  border-bottom: none;
}

.stat-block .row span:first-child {
  color: var(--sub);
}

.github-status {
  padding: 12px 18px;
  display: grid;
  gap: 8px;
  font-size: 8px;
}

.github-status .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 7px;
}

.gh-latest,
.gh-popular {
  display: grid;
  gap: 4px;
  line-height: 1.7;
}

.gh-latest b,
.gh-popular b {
  font-size: 7px;
  color: var(--sub);
}

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

.gh-cell {
  aspect-ratio: 1;
  background: #e4e4e4;
  border: 1px solid #d0d0d0;
}

.gh-cell.active {
  background: var(--ink);
  border-color: var(--ink);
}

/* ============ PROJECTS ============ */
.project-search {
  margin-bottom: 20px;
}

.project-search input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--pixel);
  font-size: 8px;
  border: 1.5px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
}

.project-search input::placeholder {
  color: var(--sub);
}

.project-search input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.menu {
  display: flex;
  gap: 20px;
}

.menu-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-item {
  font-size: 9px;
  padding: 12px 14px;
  border: 1.5px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-item .idx {
  font-size: 8px;
  color: var(--sub);
}

.menu-item.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 #999;
  transform: translateX(6px);
}

.menu-item.active .idx {
  color: #fff;
}

.menu-item:hover:not(.active) {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateX(4px);
}

.menu-item.hidden {
  display: none;
}

.menu-hint {
  font-size: 7px;
  color: var(--sub);
  margin-top: 10px;
  padding-left: 14px;
}

.cart-preview {
  flex: 1.3;
  padding: 0;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.cart-preview-inner {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-desc {
  font-size: 9px;
  line-height: 2.2;
  color: #444;
  flex: 1;
}

.cart-code-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--ink);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 5;
  font-family: var(--pixel);
}

.copy-code-btn:hover {
  transform: scale(1.1);
}

.copy-code-btn.copied {
  opacity: 0.5;
}

.cart-code {
  font-size: 9px;
  color: #fff;
  background: var(--ink);
  padding: 14px 16px;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.8;
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 #999;
  position: relative;
}

.cart-code.typing::after {
  content: ' â–ˆ';
  display: inline-block;
  animation: blinkCaret 0.6s steps(2, start) infinite;
  color: #00ff66;
}

@keyframes blinkCaret {
  to {
    opacity: 0;
  }
}

.cart-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.cart-tags span {
  font-size: 7px;
  border: 1.5px solid var(--ink);
  padding: 4px 8px;
  background: #fff;
  box-shadow: 1.5px 1.5px 0 var(--ink);
  transition: transform 0.15s ease;
}

.cart-tags span:hover {
  transform: translateY(-2px);
}

.cart-link {
  font-size: 8px;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  padding: 8px 14px;
  display: inline-flex;
  align-self: flex-start;
  gap: 6px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.cart-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.code-file-tree {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 10px;
  background: #f2f2f2;
  border-left: 3px solid var(--ink);
}

.code-file-tree b {
  font-size: 7px;
  color: var(--sub);
  margin-bottom: 3px;
}

.code-file {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px;
  font: inherit;
  font-size: 7px;
  cursor: pointer;
  color: var(--sub);
}

.code-file.active,
.code-file:hover {
  background: var(--ink);
  color: #fff;
}

.algorithm-window {
  margin-top: 16px;
  border: 1.5px solid var(--ink);
  padding: 10px;
  background: #f6f6f6;
}

.algorithm-title {
  font-size: 7px;
  color: var(--sub);
  margin-bottom: 8px;
}

.algorithm-steps {
  display: grid;
  gap: 5px;
}

.algorithm-steps span {
  font-size: 8px;
  opacity: 0;
  animation: traceStep .4s ease forwards;
}

@keyframes traceStep {
  to {
    opacity: 1;
    transform: translateX(4px);
  }
}

/* ============ STACK ============ */
.inv-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-slot {
  border: 1.5px solid var(--ink);
  background: #fff;
  font-size: 8px;
  padding: 10px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease !important;
  -webkit-tap-highlight-color: transparent;
}

.inv-slot:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(-2px, -3px) !important;
  box-shadow: 5px 5px 0 var(--ink) !important;
}

/* ============ COMPETITIVE ============ */
.board-panel {
  padding: 24px;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.lb-row .name {
  font-size: 13px;
}

.lb-topics {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.lb-topics span {
  font-size: 7px;
  border: 1.5px solid var(--ink);
  padding: 4px 8px;
}

.lb-desc {
  margin-top: 14px;
  font-size: 9px;
  color: #444;
  line-height: 2.2;
  max-width: 500px;
}

.lb-btn {
  font-size: 8px;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  padding: 8px 14px;
  display: inline-flex;
  margin-top: 18px;
  box-shadow: 2px 2px 0 #999;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lb-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #999;
}

.leetcode-status {
  padding: 12px 18px;
  display: grid;
  gap: 8px;
  font-size: 8px;
}

.leetcode-status .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 7px;
}

.lc-note {
  color: var(--sub);
  line-height: 1.7;
}

.system-monitor {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.system-monitor .row {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 6px;
}

.system-monitor .row span:first-child {
  color: var(--sub);
}

/* ============ RECRUITER ============ */
.recruiter-brief {
  display: grid;
  gap: 16px;
}

.recruiter-summary {
  padding: 20px;
}

.recruiter-summary p {
  font-size: 9px;
  line-height: 2;
  color: #444;
}

.recruiter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============ CONTACT ============ */
.contact-inner {
  text-align: center;
}

.go-title {
  font-size: clamp(12px, 2.6vw, 20px);
  letter-spacing: 0.01em;
  line-height: 1.8;
}

.go-title .ul {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.go-sub {
  font-size: 9px;
  color: var(--sub);
  margin-top: 14px;
  line-height: 2;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.contact-link {
  font-size: 8px;
  border: 1.5px solid var(--ink);
  padding: 10px 18px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.contact-link:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #999;
}

.mini-footer {
  text-align: center;
  padding: 40px 0 10px;
  font-size: 7px;
  color: var(--sub);
}

/* ============ CHESS HUD ============ */
.chess-hud {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1340;
  width: 230px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 4px 4px 0 var(--ink);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.chess-hud.open {
  opacity: 1;
  transform: translateY(0);
}

.chess-hud-title,
.chess-pv {
  font-size: 7px;
  color: var(--sub);
  line-height: 1.8;
}

.chess-board-mini {
  height: 34px;
  margin: 8px 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  background: repeating-conic-gradient(#222 0 25%, #eee 0 50%) 0/18px 18px;
  color: #e9e9e9;
  font-size: 6px;
}

.chess-board-mini span {
  padding: 2px;
  text-shadow: 1px 1px #111;
}

.eval-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 7px;
}

.eval-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #111;
}

.eval-track i {
  display: block;
  width: 54%;
  height: 100%;
  background: #f8f8f8;
  animation: evalPulse 1.8s ease-in-out infinite;
}

@keyframes evalPulse {
  50% {
    width: 62%;
  }
}

/* ============ SKIP LINK ============ */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 8px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #4267ff;
  outline-offset: 3px;
}

/* ============ PARTICLES ============ */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ============ ANIMATIONS ============ */
@keyframes petFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes petWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

@keyframes petHappy {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  30% { transform: translateY(-5px) rotate(-12deg) scale(1.12); }
  60% { transform: translateY(-2px) rotate(10deg) scale(1.08); }
}

@keyframes floatS1 {
  0%,
  100% {
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    transform: rotate(-1deg) translateY(-10px);
  }
}

@keyframes floatS2 {
  0%,
  100% {
    transform: rotate(1.5deg) translateY(0);
  }
  50% {
    transform: rotate(2.5deg) translateY(-12px);
  }
}

@keyframes floatS3 {
  0%,
  100% {
    transform: rotate(1deg) translateY(0);
  }
  50% {
    transform: rotate(0.2deg) translateY(-9px);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes panelSlideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes ambientFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -22px, 0) scale(1.08);
  }
}

@keyframes badgePopIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(.65);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pixelPop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(0.78) rotate(-6deg);
  }
  55% {
    transform: scale(1.32) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.pixel-pop {
  animation: pixelPop 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.float-plus {
  position: absolute;
  pointer-events: none;
  font-size: 8px;
  font-family: var(--pixel);
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 2px 5px;
  box-shadow: 2px 2px 0 var(--ink);
  animation: floatUpPlus 1s ease-out forwards;
  z-index: 60;
}

@keyframes floatUpPlus {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.75);
  }
  35% {
    transform: translateY(-22px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-44px) scale(0.85);
  }
}

@keyframes robotMarch {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-4deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-3px) rotate(4deg); }
}
@keyframes robotExcited {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  25% { transform: translateY(-6px) scale(1.1) rotate(-10deg); }
  50% { transform: translateY(0) scale(1.05) rotate(0deg); }
  75% { transform: translateY(-6px) scale(1.1) rotate(10deg); }
}

@keyframes knightPace {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  30% { transform: translate(2px, -4px) rotate(-3deg); }
  60% { transform: translate(-2px, -2px) rotate(3deg); }
}
@keyframes knightCharge {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  40% { transform: translate(4px, -8px) scale(1.15) rotate(-12deg); }
  70% { transform: translate(-2px, -2px) scale(1.05) rotate(6deg); }
}

@keyframes frameSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes frameFocus {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.14) rotate(0deg); }
}

@keyframes terminalFlicker {
  0%, 90%, 100% { opacity: 1; transform: translateY(0); }
  92% { opacity: 0.55; transform: translateY(1px); }
  96% { opacity: 1; transform: translateY(0); }
}
@keyframes terminalBoot {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  33% { opacity: 0.4; transform: scaleY(0.92); }
  66% { opacity: 1; transform: scaleY(1.06); }
}

@keyframes cupSteam {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}
@keyframes cupSip {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40% { transform: rotate(-18deg) translateY(-4px); }
  70% { transform: rotate(8deg) translateY(-2px); }
}

@keyframes cabinetBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes cabinetOpen {
  0%, 100% { transform: perspective(80px) rotateY(0deg) scale(1); }
  50% { transform: perspective(80px) rotateY(-28deg) scale(1.08); }
}

@keyframes gearSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes gearSpinFast {
  from { transform: rotate(0deg) scale(1.08); }
  to { transform: rotate(360deg) scale(1.08); }
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes mailFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-4deg); }
}
@keyframes mailFlap {
  0%, 100% { transform: translateY(0) rotate(0deg) scaleY(1); }
  30% { transform: translateY(-7px) rotate(-8deg) scaleY(0.9); }
  60% { transform: translateY(-3px) rotate(8deg) scaleY(1.08); }
}

@keyframes lampSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes lampFlicker {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
  25% { transform: rotate(-6deg) scale(1.05); opacity: 0.7; }
  50% { transform: rotate(6deg) scale(1.1); opacity: 1; }
  75% { transform: rotate(-3deg) scale(1.02); opacity: 0.85; }
}

@keyframes promptBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}
@keyframes promptRush {
  0%, 49% { opacity: 1; transform: scale(1.1); }
  50%, 100% { opacity: 0.25; transform: scale(1.1); }
}

@keyframes recruiterNod {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(4deg); }
}
@keyframes recruiterWave {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  30% { transform: rotate(-14deg) translateY(-2px); }
  60% { transform: rotate(10deg) translateY(-1px); }
}

@keyframes questBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}
@keyframes questUnroll {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.2) translateY(-2px); }
}

@keyframes helpPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes helpBounce {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  40% { transform: translateY(-6px) rotate(-12deg) scale(1.15); }
  70% { transform: translateY(-2px) rotate(8deg) scale(1.08); }
}

@keyframes sfxPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes sfxRing {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.18) rotate(-10deg); }
  60% { transform: scale(1.1) rotate(8deg); }
}

@keyframes githubSpin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(20deg) scale(1.15); }
}

@keyframes linkedinBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-5px) scale(1.12); }
  70% { transform: translateY(-1px) scale(1.05); }
}

@keyframes modeActivePulse {
  0%, 100% {
    box-shadow: 2px 2px 0 var(--ink);
    transform: translateY(0);
  }
  50% {
    box-shadow: 3px 4px 0 var(--ink);
    transform: translateY(-2px);
  }
}

@keyframes cornerPop {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(-16px);
  }
  65% {
    opacity: 1;
    transform: scale(1.12) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lamp-glow {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 54px solid rgba(228, 184, 106, 0.42);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease, filter 0.45s ease, border-bottom-color 0.45s ease;
  filter: drop-shadow(0 0 10px rgba(228, 184, 106, 0.35));
  z-index: 1;
}

.lamp-glow.on {
  opacity: 1;
}

body.art-mode .lamp-glow {
  border-bottom-color: rgba(228, 184, 106, 0.55);
  filter: drop-shadow(0 6px 16px rgba(228, 184, 106, 0.45));
}

body.art-mode .lamp-glow.on {
  opacity: 1;
  animation: lampPulse 2.6s ease-in-out infinite;
}

@keyframes lampPulse {
  0%, 100% {
    opacity: 0.8;
    filter: drop-shadow(0 6px 14px rgba(228, 184, 106, 0.4));
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 10px 28px rgba(228, 184, 106, 0.65));
    transform: translateX(-50%) scale(1.06);
  }
}

/* ============ LANDING SEQUENCE ============ */
.page.show .terminal-corner-btn {
  animation: cornerPop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.02s both;
}

.page.show .sfx-btn {
  animation: cornerPop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.08s both;
}

.page.show .topbar-left>* {
  animation: topbarPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.page.show .topbar-left>*:nth-child(1) {
  animation-delay: 0.12s;
}
.page.show .topbar-left>*:nth-child(2) {
  animation-delay: 0.2s;
}
.page.show .topbar-left>*:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes topbarPop {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(0.7) rotate(-8deg);
  }
  70% {
    opacity: 1;
    transform: translateY(3px) scale(1.1) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.page.show .hero-greeting {
  animation: greetingPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.32s both;
}

@keyframes greetingPop {
  0% {
    opacity: 0;
    transform: translateY(-18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page.show .hero-name {
  animation: namePop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.42s both;
}

@keyframes namePop {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.88);
  }
  70% {
    transform: translateY(-5px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page.show .hero-desc {
  animation: descPop 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

@keyframes descPop {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page.show .sticky.s1 {
  animation: stickyDrop1 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.65s both, floatS1 3.4s ease-in-out 1.5s infinite;
}
.page.show .sticky.s2 {
  animation: stickyDrop2 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.78s both, floatS2 3.8s ease-in-out 1.6s infinite;
}
.page.show .sticky.s3 {
  animation: stickyDrop3 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.9s both, floatS3 3.2s ease-in-out 1.7s infinite;
}

@keyframes stickyDrop1 {
  0% {
    opacity: 0;
    transform: rotate(-14deg) translateY(-30px) scale(0.5);
  }
  70% {
    transform: rotate(2deg) translateY(4px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: rotate(-2deg) translateY(0) scale(1);
  }
}

@keyframes stickyDrop2 {
  0% {
    opacity: 0;
    transform: rotate(14deg) translateY(-30px) scale(0.5);
  }
  70% {
    transform: rotate(-2deg) translateY(4px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: rotate(1.5deg) translateY(0) scale(1);
  }
}

@keyframes stickyDrop3 {
  0% {
    opacity: 0;
    transform: rotate(-10deg) translateY(-30px) scale(0.5);
  }
  70% {
    transform: rotate(4deg) translateY(4px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: rotate(1deg) translateY(0) scale(1);
  }
}

.page.show .shelf-hint {
  animation: fadeIn 0.6s ease 1.05s both;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.page.show .shelf-line {
  animation: lineDraw 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.15s both;
  transform-origin: center;
}

@keyframes lineDraw {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.page.show .shelf-items>* {
  animation: dominoPop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.page.show .shelf-items>*:nth-child(1) {
  animation-delay: 1.25s;
}
.page.show .shelf-items>*:nth-child(2) {
  animation-delay: 1.33s;
}
.page.show .shelf-items>*:nth-child(3) {
  animation-delay: 1.41s;
}
.page.show .shelf-items>*:nth-child(4) {
  animation-delay: 1.49s;
}
.page.show .shelf-items>*:nth-child(5) {
  animation-delay: 1.57s;
}
.page.show .shelf-items>*:nth-child(6) {
  animation-delay: 1.65s;
}
.page.show .shelf-items>*:nth-child(7) {
  animation-delay: 1.73s;
}
.page.show .shelf-items>*:nth-child(8) {
  animation-delay: 1.81s;
}
.page.show .shelf-items>*:nth-child(9) {
  animation-delay: 1.89s;
}
.page.show .shelf-items>*:nth-child(10) {
  animation-delay: 1.97s;
}
.page.show .shelf-items>*:nth-child(11) {
  animation-delay: 2.05s;
}

@keyframes dominoPop {
  0% {
    opacity: 0;
    transform: translateY(35px) scale(0.3) rotate(-12deg);
  }
  65% {
    opacity: 1;
    transform: translateY(-10px) scale(1.2) rotate(4deg);
  }
  85% {
    transform: translateY(3px) scale(0.95) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}


/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .hub {
    padding: 0 max(4vw, env(safe-area-inset-right)) 80px max(4vw, env(safe-area-inset-left));
  }

  .topbar {
    height: 68px;
  }

  .topbar-left {
    top: max(12px, env(safe-area-inset-top));
    left: max(52px, calc(env(safe-area-inset-left) + 48px));
    gap: 8px;
  }

  .terminal-corner-btn {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    width: 36px;
    height: 36px;
  }

  .terminal-corner-icon {
    font-size: 11px;
  }

  .mode-btn {
    width: 36px;
    height: 36px;
  }

  .mode-btn canvas {
    width: 15px;
    height: 15px;
  }

  .sfx-btn {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 36px;
    height: 36px;
  }

  .sfx-icon {
    width: 20px;
    height: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 22px;
    padding-bottom: 28px;
  }

  .hero-left {
    order: 1;
  }

  .notes-area {
    align-items: center;
    order: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
    gap: 10px;
  }

  .hero-name {
    font-size: clamp(18px, 6.5vw, 28px);
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
    font-size: 8px;
    line-height: 2;
    max-width: 34em;
  }

  .sticky {
    max-width: 140px;
    padding: 10px 12px;
    font-size: 6.5px;
  }

  .shelf-section {
    padding-bottom: 24px;
  }

  .shelf-hint {
    font-size: 6.5px;
    margin-bottom: 14px;
    padding: 0 8px;
  }

  .shelf-container {
    max-width: 100%;
  }

  .shelf-items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px 6px;
    row-gap: 18px;
    padding: 0 4px;
    justify-items: center;
    align-items: end;
  }

  .shelf-obj-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 8px 4px;
    margin: 0;
    gap: 6px;
  }

  .shelf-obj-btn:hover {
    transform: translateY(-6px) scale(1.05);
  }

  .shelf-obj-btn canvas {
    width: 24px !important;
    height: 24px !important;
  }

  #ic-robot,
  #ic-knight,
  #ic-cup {
    width: 22px !important;
    height: 22px !important;
  }

  #ic-frame,
  #ic-terminal,
  #ic-gear,
  #ic-trophy,
  #ic-mail {
    width: 26px !important;
    height: 26px !important;
  }

  #ic-lamp {
    width: 22px !important;
    height: 28px !important;
  }

  .cabinet-icon {
    font-size: 24px;
    line-height: 26px;
    height: 26px;
  }

  .shelf-obj-btn .s-lbl {
    font-size: 5px;
  }

  .shelf-tip {
    font-size: 5.5px;
    padding: 4px 7px;
  }

  .social-popout {
    display: none;
  }

  .panel {
    max-height: 90vh;
  }

  .panel-bar {
    padding: 14px 5vw;
  }

  .panel-body {
    padding: 36px 5vw 72px;
  }

  .about-grid {
    gap: 22px;
  }

  .menu {
    flex-direction: column;
  }

  .tool-window {
    width: min(980px, 96vw);
    max-height: min(88vh, calc(100dvh - 24px));
    top: 50%;
    transform: translate(-50%, -50%) scale(0.98);
  }

  .tool-overlay.open .tool-window {
    transform: translate(-50%, -50%) scale(1);
  }

  .terminal-body {
    padding: 12px;
    font-size: 7.5px;
  }

  .terminal-output {
    max-height: 42vh;
  }

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

  .pet-dock {
    left: max(8px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    right: auto;
  }

  .pet-dock.speaking {
    right: max(8px, env(safe-area-inset-right));
    width: auto;
    max-width: none;
    padding: 8px 10px;
    gap: 8px;
  }

  .pet-bubble {
    font-size: 6.5px;
    padding: 7px 9px;
    min-height: 32px;
    line-height: 1.7;
  }

  .chess-hud {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(200px, 70vw);
  }

  .hub-footer {
    padding: 12px 0 calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .shelf-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body {
    font-size: 9px;
  }

  .topbar {
    height: 92px;
  }

  .terminal-corner-btn {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    width: 34px;
    height: 34px;
  }

  .terminal-corner-icon {
    font-size: 10px;
  }

  .sfx-btn {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 34px;
    height: 34px;
  }

  .sfx-icon {
    width: 18px;
    height: 18px;
  }

  .topbar-left {
    top: max(50px, calc(env(safe-area-inset-top) + 42px));
    left: 0;
    right: 0;
    width: 100%;
    justify-content: center;
    gap: 10px;
    padding: 0 12px;
  }

  .mode-btn {
    width: 34px;
    height: 34px;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .mode-btn canvas {
    width: 14px;
    height: 14px;
  }

  .hero {
    padding-bottom: 22px;
    gap: 18px;
  }

  .hero-greeting {
    font-size: 8px;
  }

  .hero-name {
    font-size: clamp(16px, 7vw, 24px);
  }

  .hero-desc {
    font-size: 7.5px;
    max-width: 100%;
    margin-top: 12px;
    line-height: 1.95;
  }

  .notes-area {
    gap: 8px;
  }

  .sticky {
    max-width: min(150px, 42vw);
    font-size: 6.5px;
    padding: 10px 12px;
  }

  .sticky.s3 {
    font-size: 5.5px;
  }

  .shelf-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 4px;
    row-gap: 16px;
  }

  .shelf-obj-btn {
    min-width: 56px;
    min-height: 52px;
  }

  .shelf-obj-btn canvas {
    width: 22px !important;
    height: 22px !important;
  }

  #ic-robot,
  #ic-knight,
  #ic-cup {
    width: 20px !important;
    height: 20px !important;
  }

  #ic-frame,
  #ic-terminal,
  #ic-gear,
  #ic-trophy,
  #ic-mail {
    width: 24px !important;
    height: 24px !important;
  }

  #ic-lamp {
    width: 18px !important;
    height: 24px !important;
  }

  .cabinet-icon {
    font-size: 22px;
    line-height: 24px;
    height: 24px;
  }

  .shelf-obj-btn .s-lbl {
    font-size: 5px;
    letter-spacing: 0.01em;
  }

  .shelf-hint {
    font-size: 6px;
  }

  .panel-body {
    padding: 28px 5vw 60px;
  }

  .sec-head h2 {
    font-size: clamp(11px, 4vw, 15px);
  }

  .menu {
    gap: 14px;
  }

  .menu-item {
    padding: 10px 12px;
    font-size: 8.5px;
  }

  .cart-preview-inner {
    padding: 16px;
  }

  .cart-code {
    font-size: 8px;
    padding: 10px;
  }

  .board-panel {
    padding: 16px;
  }

  .lb-row .name {
    font-size: 11px;
  }

  .go-title {
    font-size: clamp(11px, 4.4vw, 16px);
  }

  .contact-links {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .contact-link {
    padding: 10px 14px;
    font-size: 7.5px;
  }

  .recruiter-actions .resume-btn {
    flex: 1 1 140px;
  }

  .tool-window {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    top: auto;
    bottom: 0;
    max-height: min(92vh, 100dvh);
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -6px 0 var(--ink);
    transform: translateY(12px) scale(1);
    border-radius: 0;
  }

  .tool-overlay.open .tool-window {
    transform: translateY(0);
  }

  body.chess-mode .tool-window,
  .terminal-window {
    box-shadow: 0 -6px 0 #f5f5f5;
  }

  .pet-dock {
    align-items: center;
  }

  .pet-bubble {
    font-size: 6px;
    max-height: 3.6em;
    overflow: hidden;
  }

  .hub-footer {
    padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
    font-size: 6px;
  }
}

@media (max-width: 360px) {
  .topbar {
    height: 88px;
  }

  .topbar-left {
    gap: 8px;
  }

  .mode-btn,
  .terminal-corner-btn,
  .sfx-btn {
    width: 32px;
    height: 32px;
  }

  .shelf-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 2px;
    row-gap: 14px;
  }

  .shelf-obj-btn {
    min-width: 48px;
    min-height: 48px;
  }

  .hero-name {
    font-size: clamp(15px, 7.5vw, 22px);
  }

  .sticky {
    max-width: min(130px, 44vw);
    padding: 8px 10px;
    font-size: 6px;
  }
}

/* Touch devices: quieter hover lifts, clearer press feedback */
@media (hover: none), (pointer: coarse) {
  .social-popout {
    display: none;
  }

  .shelf-obj-btn:hover {
    transform: none;
  }

  .shelf-obj-btn:active {
    transform: translateY(-4px) scale(1.04);
  }

  .sticky:hover {
    animation-play-state: running;
    transform: none !important;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.06) !important;
  }

  .sticky:active {
    animation-play-state: paused;
    transform: scale(1.05) rotate(0deg) translateY(-4px) !important;
  }

  .terminal-corner-btn:hover,
  .mode-btn:hover,
  .sfx-btn:hover {
    transform: none;
  }

  .terminal-corner-btn:active,
  .mode-btn:active {
    transform: translate(1px, 2px) scale(0.96);
  }

  .sfx-btn:active {
    transform: translateY(1px) scale(0.94);
  }

  .pet-dock:hover {
    transform: none;
  }

  .pet-dock:active {
    transform: translate(-1px, -1px);
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
