/* =============================================
   WINDOWS 11 DARK — PORTFOLIO THEME  (ORANGE)
   ============================================= */
:root {
  --bg: #0d1117;
  --bg-surface: #161b22;
  --bg-card: #1c2128;
  --bg-elevated: #21262d;
  --accent: #ff8c42;
  --accent-glow: rgba(255, 140, 66, 0.25);
  --accent-hover: #ffaa66;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --border: #30363d;
  --border-light: #3d444d;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --taskbar-h: 52px;
  --buddy-size: 70px;
}

:root[data-theme="light"] {
  --bg: #f2ede5;
  --bg-surface: #f7f3ec;
  --bg-card: #f5f0e9;
  --bg-elevated: #ece5d9;
  --accent: #c96a20;
  --accent-glow: rgba(201, 106, 32, 0.18);
  --accent-hover: #d88038;
  --green: #2d8a56;
  --yellow: #a87420;
  --red: #b84838;
  --purple: #6650b8;
  --text: #3b3228;
  --text-secondary: #5e5042;
  --text-muted: #8a7e70;
  --border: #d4c8b4;
  --border-light: #c2b39c;
  --shadow: 0 8px 24px rgba(72, 55, 30, 0.08);
  --shadow-lg: 0 16px 40px rgba(72, 55, 30, 0.12);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  padding-bottom: var(--taskbar-h);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 28px;
}
h2 .accent {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 400;
  margin-right: 8px;
}

/* =============================================
   BOOT SCREEN
   ============================================= */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}
#boot-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-center {
  text-align: center;
}

.boot-logo-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 48px;
  margin: 0 auto 40px;
}
.boot-square {
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
  animation: bootPulse 1.8s ease-in-out infinite;
}
.boot-square:nth-child(2) {
  animation-delay: 0.15s;
}
.boot-square:nth-child(3) {
  animation-delay: 0.3s;
}
.boot-square:nth-child(4) {
  animation-delay: 0.45s;
}
@keyframes bootPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.boot-spinner {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.spinner-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: spinDot 1.4s ease-in-out infinite;
}
.spinner-dot:nth-child(1) {
  animation-delay: 0s;
}
.spinner-dot:nth-child(2) {
  animation-delay: 0.1s;
}
.spinner-dot:nth-child(3) {
  animation-delay: 0.2s;
}
.spinner-dot:nth-child(4) {
  animation-delay: 0.3s;
}
.spinner-dot:nth-child(5) {
  animation-delay: 0.4s;
}
@keyframes spinDot {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* =============================================
   BUDDY CHARACTER
   ============================================= */
#buddy {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  width: var(--buddy-size);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: none;
  will-change: left, top;
}

.speech-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 0.72rem;
  font-family: var(--mono);
  white-space: normal;
  max-width: 260px;
  line-height: 1.5;
  box-shadow: var(--shadow);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
  z-index: 10;
}
.speech-bubble.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}
.speech-tail {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.buddy-char {
  position: relative;
  width: var(--buddy-size);
  height: calc(var(--buddy-size) * 1.3);
  transform-origin: center bottom;
}

.b-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 34px;
  z-index: 5;
}
.b-hood {
  width: 42px;
  height: 28px;
  background: linear-gradient(135deg, #2a2f3a, #1e222a);
  border: 2px solid var(--accent);
  border-radius: 16px 16px 8px 8px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow:
    0 0 12px var(--accent-glow),
    inset 0 0 8px rgba(255, 140, 66, 0.08);
}
.b-face {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 22px;
  background: #f0c8a0;
  border-radius: 10px 10px 12px 12px;
  overflow: hidden;
}

.b-eye {
  position: absolute;
  top: 5px;
  width: 9px;
  height: 9px;
  background: #fff;
  border-radius: 50%;
  overflow: hidden;
}
.b-eye-l {
  left: 4px;
}
.b-eye-r {
  right: 4px;
}
.b-pupil {
  width: 5px;
  height: 5px;
  background: #1a1a2e;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.15s ease;
}
#buddy .b-pupil {
  transform: translate(var(--pupil-x, 0px), var(--pupil-y, 0px));
}

#buddy.face-happy .b-eye {
  height: 5px;
  top: 7px;
  border-radius: 5px 5px 0 0;
}
#buddy.face-surprised .b-eye {
  width: 11px;
  height: 11px;
  top: 3px;
}
#buddy.face-surprised .b-eye-l {
  left: 2px;
}
#buddy.face-surprised .b-eye-r {
  right: 2px;
}
#buddy.face-dead .b-pupil {
  width: 3px;
  height: 1px;
  border-radius: 0;
  top: 4px;
  left: 3px;
}
#buddy.face-dizzy .b-pupil {
  animation: dizzyPupil 0.3s linear infinite;
}
@keyframes dizzyPupil {
  0% {
    transform: translate(-1px, -1px);
  }
  25% {
    transform: translate(1px, -1px);
  }
  50% {
    transform: translate(1px, 1px);
  }
  75% {
    transform: translate(-1px, 1px);
  }
}
#buddy.face-excited .b-eye {
  animation: excitedBlink 0.15s ease infinite alternate;
}
@keyframes excitedBlink {
  0% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(0.7);
  }
}

.b-mouth {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 3px;
  border-bottom: 2px solid #b87a5a;
  border-radius: 0 0 4px 4px;
  transition: var(--transition);
}
#buddy.face-happy .b-mouth {
  width: 10px;
  height: 5px;
  border-bottom-width: 2px;
}
#buddy.face-surprised .b-mouth {
  width: 8px;
  height: 7px;
  border: 2px solid #b87a5a;
  border-radius: 50%;
  border-bottom: 2px solid #b87a5a;
  bottom: 1px;
}
#buddy.face-talking .b-mouth {
  animation: mouthTalk 0.3s ease-in-out infinite alternate;
}
@keyframes mouthTalk {
  0% {
    height: 2px;
  }
  100% {
    height: 6px;
    border-radius: 0 0 50% 50%;
  }
}

.b-blush {
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 3px;
  background: rgba(255, 100, 100, 0.35);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}
.b-blush-l {
  left: 1px;
}
.b-blush-r {
  right: 1px;
}
#buddy.face-happy .b-blush {
  opacity: 1;
}
#buddy.face-excited .b-blush {
  opacity: 1;
}

.b-body {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 24px;
  background: linear-gradient(135deg, #2a2f3a, #1e222a);
  border: 2px solid var(--border-light);
  border-top: none;
  border-radius: 4px 4px 10px 10px;
  z-index: 4;
}
.b-chest-light {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: chestPulse 2.5s ease-in-out infinite;
}
@keyframes chestPulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-glow);
  }
  50% {
    opacity: 0.5;
    box-shadow:
      0 0 16px var(--accent-glow),
      0 0 32px var(--accent-glow);
  }
}

.b-arm {
  position: absolute;
  top: 32px;
  width: 10px;
  height: 20px;
  background: linear-gradient(135deg, #2a2f3a, #1e222a);
  border: 2px solid var(--border-light);
  border-radius: 5px;
  z-index: 3;
  transform-origin: top center;
}
.b-arm-l {
  left: 8px;
}
.b-arm-r {
  right: 8px;
}
.b-hand {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 7px;
  background: #f0c8a0;
  border-radius: 50%;
}

.b-leg {
  position: absolute;
  top: 52px;
  width: 11px;
  height: 20px;
  background: linear-gradient(135deg, #2a2f3a, #1e222a);
  border: 2px solid var(--border-light);
  border-radius: 4px 4px 6px 6px;
  z-index: 3;
  transform-origin: top center;
}
.b-leg-l {
  left: 18px;
}
.b-leg-r {
  right: 18px;
}
.b-foot {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 6px;
  background: #333;
  border-radius: 3px 3px 5px 5px;
}

.b-shadow {
  width: 36px;
  height: 8px;
  background: rgba(255, 140, 66, 0.1);
  border-radius: 50%;
  margin: -2px auto 0;
  filter: blur(3px);
  transition: var(--transition);
}

#buddy.facing-left .buddy-char {
  transform: scaleX(-1);
}
#buddy.facing-left .speech-bubble {
  transform: translateX(-50%) scale(1) scaleX(1);
}

/* -- ANIMATION STATES -- */
#buddy.state-idle .b-arm-l {
  animation: idleArmL 3s ease-in-out infinite;
}
#buddy.state-idle .b-arm-r {
  animation: idleArmR 3s ease-in-out infinite;
}
#buddy.state-idle .b-eye {
  animation: blink 4s ease-in-out infinite;
}
#buddy.state-idle .buddy-char {
  animation: idleBob 3s ease-in-out infinite;
}

@keyframes idleBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}
@keyframes idleArmL {
  0%,
  100% {
    transform: rotate(3deg);
  }
  50% {
    transform: rotate(-3deg);
  }
}
@keyframes idleArmR {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
}
@keyframes blink {
  0%,
  42%,
  44%,
  100% {
    transform: scaleY(1);
  }
  43% {
    transform: scaleY(0.1);
  }
}

#buddy.state-walking .b-arm-l {
  animation: walkArmL 0.4s ease-in-out infinite;
}
#buddy.state-walking .b-arm-r {
  animation: walkArmR 0.4s ease-in-out infinite;
}
#buddy.state-walking .b-leg-l {
  animation: walkLegL 0.4s ease-in-out infinite;
}
#buddy.state-walking .b-leg-r {
  animation: walkLegR 0.4s ease-in-out infinite;
}
#buddy.state-walking .buddy-char {
  animation: walkBounce 0.2s ease-in-out infinite;
}

@keyframes walkArmL {
  0%,
  100% {
    transform: rotate(25deg);
  }
  50% {
    transform: rotate(-25deg);
  }
}
@keyframes walkArmR {
  0%,
  100% {
    transform: rotate(-25deg);
  }
  50% {
    transform: rotate(25deg);
  }
}
@keyframes walkLegL {
  0%,
  100% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(-20deg);
  }
}
@keyframes walkLegR {
  0%,
  100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(20deg);
  }
}
@keyframes walkBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

#buddy.state-running .b-arm-l {
  animation: walkArmL 0.22s ease-in-out infinite;
}
#buddy.state-running .b-arm-r {
  animation: walkArmR 0.22s ease-in-out infinite;
}
#buddy.state-running .b-leg-l {
  animation: walkLegL 0.22s ease-in-out infinite;
}
#buddy.state-running .b-leg-r {
  animation: walkLegR 0.22s ease-in-out infinite;
}
#buddy.state-running .buddy-char {
  animation: walkBounce 0.11s ease-in-out infinite;
}
#buddy.state-running .b-hood {
  animation: hoodFlap 0.22s ease-in-out infinite;
}
@keyframes hoodFlap {
  0%,
  100% {
    transform: translateX(-50%) rotate(0);
  }
  50% {
    transform: translateX(-50%) rotate(-3deg);
  }
}

#buddy.state-jumping .buddy-char {
  animation: jumpUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
#buddy.state-jumping .b-arm-l {
  animation: jumpArmL 0.45s ease forwards;
}
#buddy.state-jumping .b-arm-r {
  animation: jumpArmR 0.45s ease forwards;
}
#buddy.state-jumping .b-leg-l,
#buddy.state-jumping .b-leg-r {
  animation: jumpLegs 0.45s ease forwards;
}
@keyframes jumpUp {
  0% {
    transform: scaleY(0.8) scaleX(1.1);
  }
  30% {
    transform: scaleY(1.15) scaleX(0.92) translateY(-14px);
  }
  100% {
    transform: translateY(-5px);
  }
}
@keyframes jumpArmL {
  0% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(-80deg);
  }
  100% {
    transform: rotate(-30deg);
  }
}
@keyframes jumpArmR {
  0% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(80deg);
  }
  100% {
    transform: rotate(30deg);
  }
}
@keyframes jumpLegs {
  0% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(15deg);
  }
  100% {
    transform: rotate(0);
  }
}

#buddy.state-landing .buddy-char {
  animation: landSquash 0.35s ease-out forwards;
}
#buddy.state-landing .b-shadow {
  animation: landShadow 0.35s ease-out;
}
@keyframes landSquash {
  0% {
    transform: scaleY(0.7) scaleX(1.25);
  }
  50% {
    transform: scaleY(1.1) scaleX(0.95);
  }
  100% {
    transform: scaleY(1) scaleX(1);
  }
}
@keyframes landShadow {
  0% {
    transform: scaleX(1.6);
    opacity: 0.25;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.1;
  }
}

#buddy.state-falling .buddy-char {
  animation: fallSpin 0.6s ease-in;
}
#buddy.state-falling .b-arm-l {
  animation: panicArmL 0.2s ease-in-out infinite !important;
}
#buddy.state-falling .b-arm-r {
  animation: panicArmR 0.2s ease-in-out infinite !important;
}
#buddy.state-falling .b-leg-l {
  animation: panicLegL 0.15s ease-in-out infinite !important;
}
#buddy.state-falling .b-leg-r {
  animation: panicLegR 0.15s ease-in-out infinite !important;
}
@keyframes fallSpin {
  0% {
    transform: rotate(0) translateY(0);
  }
  100% {
    transform: rotate(15deg) translateY(30px);
  }
}
@keyframes panicArmL {
  0%,
  100% {
    transform: rotate(-70deg);
  }
  50% {
    transform: rotate(-130deg);
  }
}
@keyframes panicArmR {
  0%,
  100% {
    transform: rotate(70deg);
  }
  50% {
    transform: rotate(130deg);
  }
}
@keyframes panicLegL {
  0%,
  100% {
    transform: rotate(-35deg);
  }
  50% {
    transform: rotate(35deg);
  }
}
@keyframes panicLegR {
  0%,
  100% {
    transform: rotate(35deg);
  }
  50% {
    transform: rotate(-35deg);
  }
}

#buddy.state-climbing .b-arm-l {
  animation: climbArmL 0.45s ease-in-out infinite;
}
#buddy.state-climbing .b-arm-r {
  animation: climbArmR 0.45s ease-in-out infinite;
}
#buddy.state-climbing .b-leg-l {
  animation: climbLegL 0.45s ease-in-out infinite;
}
#buddy.state-climbing .b-leg-r {
  animation: climbLegR 0.45s ease-in-out infinite;
}
#buddy.state-climbing .buddy-char {
  animation: climbBob 0.45s ease-in-out infinite;
}
@keyframes climbArmL {
  0%,
  100% {
    transform: rotate(-50deg) translateY(-2px);
  }
  50% {
    transform: rotate(-120deg) translateY(2px);
  }
}
@keyframes climbArmR {
  0%,
  100% {
    transform: rotate(-120deg) translateY(2px);
  }
  50% {
    transform: rotate(-50deg) translateY(-2px);
  }
}
@keyframes climbLegL {
  0%,
  100% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(-20deg);
  }
}
@keyframes climbLegR {
  0%,
  100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(20deg);
  }
}
@keyframes climbBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

#buddy.state-waving .b-arm-r {
  animation: wave 0.5s ease-in-out 4;
}
@keyframes wave {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(-100deg);
  }
}

#buddy.state-sitting .b-leg-l {
  transform: rotate(80deg) translateX(-4px);
}
#buddy.state-sitting .b-leg-r {
  transform: rotate(-80deg) translateX(4px);
}
#buddy.state-sitting .buddy-char {
  transform: translateY(8px);
}

#buddy.state-dancing .buddy-char {
  animation: danceBody 0.4s ease-in-out infinite alternate;
}
#buddy.state-dancing .b-arm-l {
  animation: danceArmL 0.4s ease-in-out infinite alternate;
}
#buddy.state-dancing .b-arm-r {
  animation: danceArmR 0.4s ease-in-out infinite alternate;
}
#buddy.state-dancing .b-leg-l {
  animation: danceLegL 0.4s ease-in-out infinite alternate;
}
#buddy.state-dancing .b-leg-r {
  animation: danceLegR 0.4s ease-in-out infinite alternate;
}
@keyframes danceBody {
  0% {
    transform: rotate(-5deg) translateY(0);
  }
  100% {
    transform: rotate(5deg) translateY(-4px);
  }
}
@keyframes danceArmL {
  0% {
    transform: rotate(-60deg);
  }
  100% {
    transform: rotate(40deg);
  }
}
@keyframes danceArmR {
  0% {
    transform: rotate(60deg);
  }
  100% {
    transform: rotate(-40deg);
  }
}
@keyframes danceLegL {
  0% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(10deg);
  }
}
@keyframes danceLegR {
  0% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(-10deg);
  }
}

#buddy.state-sliding .buddy-char {
  animation: slideLean 0.3s ease-in-out infinite alternate;
}
#buddy.state-sliding .b-arm-l {
  transform: rotate(-30deg);
}
#buddy.state-sliding .b-arm-r {
  transform: rotate(30deg);
}
@keyframes slideLean {
  0% {
    transform: rotate(-3deg);
  }
  100% {
    transform: rotate(3deg);
  }
}

/* =============================================
   TASKBAR
   ============================================= */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-h);
  background: rgba(22, 27, 34, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255, 140, 66, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 9000;
  gap: 6px;
}

.taskbar-start {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.taskbar-start:hover {
  background: rgba(255, 255, 255, 0.08);
}

.start-icon {
  width: 20px;
  height: 20px;
}
.start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 16px;
  height: 16px;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    gap 0.3s ease;
}
.start-grid span {
  background: var(--accent);
  border-radius: 1.5px;
  transition: var(--transition);
}
.taskbar-start:hover .start-grid {
  transform: rotate(45deg) scale(1.1);
  gap: 3px;
}
.taskbar-start:hover .start-grid span {
  background: var(--accent-hover);
  border-radius: 50%;
}
.taskbar-start:active .start-grid {
  transform: rotate(45deg) scale(0.9);
}

.taskbar-pins {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 3px 6px;
}

.taskbar-pin {
  width: 44px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 1.05rem;
  transition: var(--transition);
  position: relative;
}
.taskbar-pin:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.taskbar-pin.active {
  color: var(--accent);
}
.taskbar-pin.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 16px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.taskbar-tray:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tray-clock {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--mono);
  text-align: right;
  line-height: 1.4;
}

.lang-toggle,
.theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
  line-height: 1;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  font-size: 0.78rem;
  padding: 4px 8px;
}
.lang-toggle:hover,
.theme-toggle:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.admin-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.admin-toggle:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.admin-toggle.logged-in {
  color: var(--green);
  border-color: var(--green);
}
.admin-toggle.logged-in:hover {
  background: var(--green);
  color: var(--bg);
}

/* =============================================
   HERO / DESKTOP HOME
   ============================================= */
.desktop-home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 80px 24px;
}

.home-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(255, 140, 66, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 30%,
      rgba(188, 140, 255, 0.06) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(63, 185, 80, 0.04) 0%,
      transparent 60%
    ),
    linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  animation: wallpaperShift 20s ease-in-out infinite alternate;
}
@keyframes wallpaperShift {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05) translate(-1%, -1%);
  }
}

.home-wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 140, 66, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 140, 66, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

.home-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
}

.home-hello {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s ease forwards 0.5s;
}

.home-name {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 16px 0 20px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}
.name-first {
  display: block;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.name-last {
  display: block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.65em;
}

/* Fix gradient text when contenteditable */
body.edit-mode .name-first,
body.edit-mode .name-last {
  -webkit-text-fill-color: var(--text);
  background: none;
}

.home-role {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 1.4s;
}
.role-caret {
  color: var(--green);
}
.blink-cursor {
  color: var(--accent);
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.home-cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 1.8s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border-light);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.05);
  transform: translateY(-2px);
}

.home-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 2.2s;
}
.home-scroll-hint span {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.3;
    transform: scaleY(0.6);
  }
}

/* =============================================
   WINDOW CHROME
   ============================================= */
.win-section {
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.window {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.window:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.win-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.win-titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.win-icon {
  color: var(--accent);
  font-size: 0.8rem;
}
.win-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.win-buttons {
  display: flex;
  gap: 8px;
}
.win-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: var(--transition);
  cursor: default;
}
.win-minimize {
  background: var(--yellow);
}
.win-maximize {
  background: var(--green);
}
.win-close {
  background: var(--red);
}
.win-btn:hover {
  filter: brightness(1.3);
  transform: scale(1.15);
}

.win-toolbar {
  padding: 6px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.toolbar-path i {
  color: var(--accent);
  margin-right: 6px;
}

.win-body {
  padding: 32px;
}

.win-statusbar {
  display: none;
}

/* =============================================
   ABOUT SECTION
   ============================================= */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.about-text strong {
  color: var(--accent);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 140, 66, 0.06);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: default;
  position: relative;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 66, 0.1);
  transform: translateY(-2px);
}
.tag i {
  color: var(--accent);
  font-size: 0.7rem;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}
.stat-tile:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(255, 140, 66, 0.08);
}
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--text);
}
.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.stat-icon-bg {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.6rem;
  color: rgba(255, 140, 66, 0.07);
}

/* =============================================
   PROJECTS
   ============================================= */
.proj-featured {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.proj-featured:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.proj-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50px;
  letter-spacing: 1px;
  z-index: 3;
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

.proj-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.proj-featured .proj-card-image {
  min-height: 280px;
}

.proj-big-icon {
  font-size: 3rem;
  opacity: 0.6;
  z-index: 2;
}
.proj-big-number {
  font-family: var(--mono);
  font-size: 3.5rem;
  font-weight: 800;
  opacity: 0.6;
  z-index: 2;
}

/* Project bg themes */
.proj-pokemon-bg {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: var(--yellow);
}
.proj-mine-bg {
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
  color: var(--purple);
}
.proj-tetris-bg {
  background: linear-gradient(135deg, #0a1a0e 0%, #0a2e1a 100%);
  color: var(--green);
}
.proj-rubiks-bg {
  background: linear-gradient(135deg, #2e1a0a 0%, #0a1a2e 100%);
  color: var(--accent);
}
.proj-ai-bg {
  background: linear-gradient(135deg, #0a0a2e 0%, #2e0a4e 100%);
  color: var(--purple);
}
.proj-space-bg {
  background: linear-gradient(135deg, #000020 0%, #0a0a3e 100%);
  color: #ff8844;
}
.proj-2048-bg {
  background: linear-gradient(135deg, #2e2a0a 0%, #3e2a0a 100%);
  color: var(--yellow);
}
.proj-default-bg {
  background: linear-gradient(135deg, #1a1a2e 0%, #2e1a3e 100%);
  color: var(--accent);
}

.proj-float-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.proj-float-icons span {
  position: absolute;
  font-size: 1.3rem;
  animation: floatIcon 5s ease-in-out infinite;
}
.proj-float-icons span:nth-child(1) {
  top: 15%;
  left: 12%;
  animation-delay: 0s;
}
.proj-float-icons span:nth-child(2) {
  top: 55%;
  right: 15%;
  animation-delay: 1.2s;
}
.proj-float-icons span:nth-child(3) {
  bottom: 20%;
  left: 30%;
  animation-delay: 2.4s;
}
.proj-float-icons span:nth-child(4) {
  top: 25%;
  right: 25%;
  animation-delay: 3.6s;
}
@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0) rotate(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-12px) rotate(10deg);
    opacity: 1;
  }
}

.proj-card-body {
  padding: 24px;
}
.proj-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  transition: var(--transition);
}
.proj-card:hover h3,
.proj-featured:hover h3 {
  color: var(--accent);
}
.proj-card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

.proj-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.proj-tech span {
  padding: 3px 10px;
  background: rgba(188, 140, 255, 0.08);
  border: 1px solid rgba(188, 140, 255, 0.15);
  border-radius: 50px;
  font-size: 0.67rem;
  color: var(--purple);
  font-family: var(--mono);
}

.proj-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.proj-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.proj-meta i {
  color: var(--accent);
  font-size: 0.65rem;
}

.proj-click-hint {
  margin-top: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(4px);
  transition: var(--transition);
}
.proj-click-hint i {
  color: var(--accent);
  margin-right: 4px;
}
.proj-clickable:hover .proj-click-hint {
  opacity: 1;
  transform: translateY(0);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.proj-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Uploaded image in card */
.proj-card-image img.proj-uploaded-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* When an image is set, hide the icon and floating icons */
.proj-card-image.has-image .proj-big-icon,
.proj-card-image.has-image .proj-float-icons {
  display: none;
}

/* =============================================
   PROJECT MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal-window {
  transform: scale(1) translateY(0);
}

.modal-window .win-titlebar .win-close {
  cursor: pointer;
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

.modal-sm {
  max-width: 420px;
}

.modal-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.modal-hero-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: 1.8rem;
  flex-shrink: 0;
}
.modal-hero-info h2 {
  margin-bottom: 4px;
  font-size: 1.5rem;
}
.modal-hero-info .modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--mono);
}

.modal-section {
  margin-bottom: 24px;
}
.modal-section h3 {
  font-size: 0.9rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-section h3 i {
  font-size: 0.8rem;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.modal-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-features li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-features li i {
  color: var(--accent);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.modal-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-tech-tag {
  padding: 6px 14px;
  background: rgba(188, 140, 255, 0.08);
  border: 1px solid rgba(188, 140, 255, 0.15);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--purple);
  font-family: var(--mono);
}

.modal-stats-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.modal-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.modal-stat i {
  color: var(--accent);
}
.modal-stat strong {
  color: var(--text);
}

/* =============================================
   LOGIN MODAL
   ============================================= */
.login-body {
  text-align: center;
}
.login-body h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.login-body h3 i {
  color: var(--accent);
  margin-right: 8px;
}
.login-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-group {
  text-align: left;
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: var(--mono);
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  transition: var(--transition);
  outline: none;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder {
  color: var(--text-muted);
}

.login-error {
  font-size: 0.78rem;
  color: var(--red);
  min-height: 20px;
  margin-bottom: 4px;
}

/* =============================================
   EDIT BAR
   ============================================= */
.edit-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 11000;
  background: rgba(255, 140, 66, 0.12);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--accent);
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}
.edit-bar.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.edit-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.edit-bar-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  flex: 1;
}
.edit-bar-label i {
  margin-right: 6px;
}

.btn-edit-save,
.btn-edit-discard,
.btn-edit-logout {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
}
.btn-edit-save {
  background: var(--green);
  color: #fff;
}
.btn-edit-save:hover {
  filter: brightness(1.15);
}
.btn-edit-discard {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-edit-discard:hover {
  border-color: var(--red);
  color: var(--red);
}
.btn-edit-logout {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-edit-logout:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================================
   CMS CONTROLS (visible only in edit mode)
   ============================================= */
.cms-handle,
.cms-delete,
.cms-add-btn,
.cms-img-overlay {
  display: none !important;
}
body.edit-mode .cms-handle,
body.edit-mode .cms-delete,
body.edit-mode .cms-add-btn,
body.edit-mode .cms-img-overlay {
  display: flex !important;
}

/* Drag Handle */
.cms-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: grab;
  z-index: 10;
  transition: var(--transition);
}
.cms-handle:active {
  cursor: grabbing;
}
.cms-handle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card);
}

/* Delete Button */
.cms-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: 50%;
  font-size: 0.6rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s;
}
.cms-delete:hover {
  background: var(--red);
  color: #fff;
  opacity: 1 !important;
}

body.edit-mode .proj-card:hover .cms-delete,
body.edit-mode .proj-featured:hover .cms-delete,
body.edit-mode .skill-tile:hover .cms-delete,
body.edit-mode .stat-tile:hover .cms-delete {
  opacity: 1;
}
body.edit-mode .tag:hover .cms-delete {
  opacity: 1;
}
/* Tags are small so always show delete in edit mode */
body.edit-mode .tag .cms-delete {
  position: relative;
  top: auto;
  right: auto;
  width: 16px;
  height: 16px;
  font-size: 0.5rem;
  opacity: 0.5;
  margin-left: 4px;
}
body.edit-mode .tag:hover .cms-delete {
  opacity: 1;
}

/* Add Button */
.cms-add-btn {
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-direction: column;
  padding: 20px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  min-height: 100px;
}
.cms-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 66, 0.04);
}
.cms-add-btn i {
  font-size: 1.3rem;
}

.cms-add-btn-inline {
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
  gap: 6px;
}
body.edit-mode .cms-add-btn-inline {
  display: inline-flex !important;
}
.cms-add-btn-inline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Image Upload Overlay */
.cms-img-overlay {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
body.edit-mode .cms-img-overlay {
  pointer-events: auto;
}
body.edit-mode .proj-card-image:hover .cms-img-overlay {
  opacity: 1;
}
.cms-img-overlay i {
  font-size: 1.5rem;
  color: var(--accent);
}

/* Dragging States */
.dragging {
  opacity: 0.35 !important;
  transform: scale(0.97) !important;
}
.drag-over {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

/* Editable Indicators */
body.edit-mode [data-editable] {
  outline: 2px dashed rgba(255, 140, 66, 0.25);
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color 0.2s ease;
  min-height: 1em;
}
body.edit-mode [data-editable]:hover {
  outline-color: rgba(255, 140, 66, 0.6);
}
body.edit-mode [data-editable]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Inline editable fields (modal, cards) */
.cms-editable-field {
  outline: 1px dashed rgba(255, 140, 66, 0.25);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
  transition: outline-color 0.2s ease;
  min-height: 1em;
}
.cms-editable-field:hover {
  outline-color: rgba(255, 140, 66, 0.5);
}
.cms-editable-field:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.edit-mode .proj-title-edit,
body.edit-mode .proj-desc-edit {
  outline: 1px dashed rgba(255, 140, 66, 0.2);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
}
body.edit-mode .proj-title-edit:focus,
body.edit-mode .proj-desc-edit:focus {
  outline: 2px solid var(--accent);
}

body.edit-mode .tag-label[contenteditable="true"],
body.edit-mode .stat-num[contenteditable="true"],
body.edit-mode .stat-label[contenteditable="true"],
body.edit-mode .skill-name-edit[contenteditable="true"] {
  outline: 1px dashed rgba(255, 140, 66, 0.2);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
}
body.edit-mode .tag-label[contenteditable="true"]:focus,
body.edit-mode .stat-num[contenteditable="true"]:focus,
body.edit-mode .stat-label[contenteditable="true"]:focus,
body.edit-mode .skill-name-edit[contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
}

/* CMS Edit Icon Button (palette icon on skills/stats) */
.cms-edit-icon-btn {
  position: absolute;
  top: 8px;
  right: 38px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.6rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s,
    transform 0.15s;
}
.cms-edit-icon-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}
body.edit-mode .stat-tile:hover .cms-edit-icon-btn,
body.edit-mode .skill-tile:hover .cms-edit-icon-btn {
  opacity: 1;
}

/* CMS Small Delete (inside modal lists) */
.cms-delete-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: 50%;
  font-size: 0.5rem;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition:
    background 0.2s,
    color 0.2s;
  flex-shrink: 0;
}
.cms-delete-sm:hover {
  background: var(--red);
  color: #fff;
}

/* CMS Small Add Inline (inside modal) */
.cms-add-inline-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.cms-add-inline-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* CMS Edit Inline (pen button on project tech / card) */
.cms-edit-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.55rem;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition:
    background 0.2s,
    color 0.2s;
  flex-shrink: 0;
  opacity: 0;
}
.cms-edit-inline:hover {
  background: var(--accent);
  color: #fff;
}
body.edit-mode .proj-tech:hover .cms-edit-inline {
  opacity: 1;
}

/* Skill Level Slider */
.skill-level-slider {
  position: absolute;
  top: -6px;
  left: 0;
  width: 100%;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.skill-level-slider:hover {
  opacity: 1;
}
.skill-level-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
}
.skill-level-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
}
.skill-level-slider::-webkit-slider-runnable-track {
  height: 0;
  background: transparent;
}
.skill-level-slider::-moz-range-track {
  height: 0;
  background: transparent;
}

/* Modal tech tag (editable version) */
.modal-tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Tag icon clickable in edit mode */
body.edit-mode .tag-icon-edit {
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.15s;
}
body.edit-mode .tag-icon-edit:hover {
  color: var(--accent);
  transform: scale(1.3);
}

/* Modal feature list editable items */
.modal-features li {
  display: flex;
  align-items: center;
}

/* CMS toast */
.cms-toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.82rem;
  color: var(--text);
  z-index: 60000;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.cms-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cms-toast.success {
  border-color: var(--green);
  color: var(--green);
}
.cms-toast.error {
  border-color: var(--red);
  color: var(--red);
}

/* =============================================
   SKILLS
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.skill-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: default;
  position: relative;
}
.skill-tile:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.skill-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--sk);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.skill-info {
  flex: 1;
}
.skill-info h4 {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.skill-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  position: relative;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sk, var(--accent)), var(--accent));
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   CONTACT
   ============================================= */
.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: start;
}

.contact-terminal {
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.term-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot.red {
  background: var(--red);
}
.term-dot.yellow {
  background: var(--yellow);
}
.term-dot.green {
  background: var(--green);
}
.term-title {
  color: var(--text-muted);
  margin-left: 8px;
  font-size: 0.7rem;
}

.term-body {
  padding: 18px;
  line-height: 1.8;
  color: #ccc;
}
.term-prompt {
  color: var(--green);
}
.term-output {
  color: var(--text-muted);
}
.term-success {
  color: var(--green);
}
.term-key {
  color: var(--yellow);
}
.term-link {
  color: var(--accent);
  text-decoration: underline;
  pointer-events: auto;
}
.term-link:hover {
  color: var(--accent-hover);
}
.term-online {
  color: var(--green);
}
.term-cursor {
  animation: cursorBlink 1s step-end infinite;
  color: #ccc;
}

.contact-message p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  padding: 30px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   START MENU
   ============================================= */
.start-menu {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 12px);
  left: 12px;
  width: 340px;
  background: rgba(22, 27, 34, 0.96);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 16px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 140, 66, 0.06);
  z-index: 9500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.3s,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.start-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.start-menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.start-menu-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.start-menu-user strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
}
.start-menu-user span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.start-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 16px;
}
.start-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.68rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}
.start-tile i {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s;
}
.start-tile:hover {
  background: rgba(255, 140, 66, 0.08);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}
.start-tile:hover i {
  transform: scale(1.15);
}

.start-tile-lang {
  background: rgba(188, 140, 255, 0.06);
  border-color: rgba(188, 140, 255, 0.15);
}
.start-tile-lang i {
  color: var(--purple);
}
.start-tile-lang:hover {
  background: rgba(188, 140, 255, 0.12);
  border-color: var(--purple);
}

.start-menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.start-menu-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.start-menu-power {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.start-menu-power:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Start button animation when menu is open */
.taskbar-start.active .start-grid span {
  background: var(--accent-hover);
  box-shadow: 0 0 8px var(--accent-glow);
}
.taskbar-start.active {
  background: rgba(255, 140, 66, 0.12);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .proj-featured {
    grid-template-columns: 1fr;
  }
  .proj-featured .proj-card-image {
    min-height: 180px;
  }
  .modal-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --buddy-size: 48px;
    --taskbar-h: 48px;
  }

  /* ---- BUDDY: smaller & less intrusive ---- */
  #buddy {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(0.75);
  }
  .speech-bubble {
    max-width: 150px;
    font-size: 0.58rem;
    padding: 5px 8px;
  }

  /* ---- SECTIONS: tighter padding ---- */
  .win-section {
    padding: 16px 8px;
  }
  .win-body {
    padding: 16px 12px;
  }

  /* ---- PROJECTS: single column ---- */
  .proj-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .about-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* ---- HERO: responsive name ---- */
  .home-name {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }
  .desktop-home {
    padding-top: 60px;
    min-height: calc(100vh - var(--taskbar-h));
  }
  .home-content {
    padding: 20px 16px;
    border-radius: 14px;
  }

  /* ---- CTA BUTTONS: stack vertically ---- */
  .home-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.9rem;
  }

  /* ---- TASKBAR: hide clock, shrink pins ---- */
  .taskbar-tray {
    display: flex;
    gap: 2px;
  }
  .tray-clock {
    display: none;
  }
  .taskbar-pin {
    width: 36px;
    height: 34px;
    font-size: 0.9rem;
  }
  .taskbar-pins {
    gap: 2px;
  }
  #taskbar {
    padding: 0 8px;
    gap: 4px;
  }

  /* ---- PROJECT FILTER CHIPS: horizontal scroll ---- */
  .project-filter-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 6px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .project-filter-chips::-webkit-scrollbar {
    display: none;
  }
  .project-chip {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  /* ---- SEARCH BAR ---- */
  .project-search-wrap {
    font-size: 0.85rem;
  }
  .project-search-wrap input {
    font-size: 0.85rem;
  }

  /* ---- PROJECT CARDS: better spacing ---- */
  .proj-card-body {
    padding: 14px 12px;
  }
  .proj-card-body h3 {
    font-size: 1rem;
  }
  .proj-card-body p {
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .proj-card-image {
    min-height: 140px;
  }
  .proj-tech span {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  .proj-meta span {
    font-size: 0.65rem;
  }

  /* ---- ABOUT TAGS ---- */
  .about-tags {
    gap: 6px;
  }
  .tag {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  /* ---- STAT TILES: tighter ---- */
  .stat-tile {
    padding: 12px;
  }
  .stat-num {
    font-size: 1.4rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }

  /* ---- CONTACT: smaller terminal ---- */
  .contact-terminal {
    font-size: 0.68rem;
  }
  .term-body {
    padding: 10px;
  }
  .contact-message h2 {
    font-size: 1.2rem;
  }

  /* ---- MODAL: nearly full-screen ---- */
  .modal-window {
    max-height: 92vh;
    max-width: 96vw;
    margin: 4vh 2vw;
  }
  .modal-body {
    padding: 16px 12px;
  }
  .modal-hero {
    flex-direction: column;
    text-align: center;
  }
  .modal-hero-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
  }

  /* ---- START MENU: full width ---- */
  .start-menu {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(var(--taskbar-h) + 8px);
  }
  .start-menu-grid {
    gap: 6px;
    padding: 12px;
  }
  .start-tile {
    padding: 14px 6px;
    font-size: 0.62rem;
  }
  .start-tile i {
    font-size: 1rem;
  }

  /* ---- SKILL TILES ---- */
  .skill-tile {
    padding: 14px 12px;
  }
  .skill-icon {
    width: 40px;
    height: 40px;
  }
  .skill-icon i {
    font-size: 1rem;
  }
  .skill-info h4 {
    font-size: 0.85rem;
  }

  /* ---- WINDOW TITLEBARS ---- */
  .win-titlebar {
    padding: 8px 10px;
  }
  .win-title {
    font-size: 0.75rem;
  }
  .win-statusbar {
    font-size: 0.65rem;
    padding: 6px 10px;
  }

  /* ---- h2 HEADINGS ---- */
  h2 {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    margin-bottom: 18px;
  }

  /* ---- FOOTER ---- */
  footer {
    font-size: 0.7rem;
    padding: 16px 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --buddy-size: 42px;
  }

  /* Even smaller buddy */
  #buddy {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.6);
  }

  .about-stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .edit-bar-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Even smaller taskbar */
  .taskbar-pin {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  /* Hide admin & config buttons on very small screens */
  .admin-toggle {
    display: none;
  }

  /* Start menu 2 cols on very small */
  .start-menu-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Modal stats wrap vertically */
  .modal-stats-row {
    flex-direction: column;
    gap: 10px;
  }

  /* Hero padding */
  .desktop-home {
    padding: 50px 12px;
  }
  .home-content {
    padding: 16px 12px;
  }
  .home-hello {
    font-size: 0.8rem;
  }
  .home-role {
    font-size: 0.78rem;
  }
  .home-name {
    font-size: clamp(1.6rem, 12vw, 2.8rem);
    line-height: 1.15;
  }

  /* Contact layout: single column */
  .contact-layout {
    gap: 16px;
  }
  .contact-message {
    text-align: center;
  }
  .contact-message .btn-primary {
    margin: 0 auto;
  }

  /* Featured project card image */
  .proj-card-image {
    min-height: 120px;
  }
  .proj-badge {
    font-size: 0.6rem;
    padding: 3px 8px;
  }
  .proj-float-icons span {
    font-size: 1rem;
  }
}

@media (hover: none) {
  .proj-card:hover,
  .proj-featured:hover,
  .stat-tile:hover,
  .skill-tile:hover,
  .tag:hover,
  .window:hover {
    transform: none;
  }
  /* Show click hint always on touch devices */
  .proj-click-hint {
    opacity: 0.6;
    transform: none;
  }
}

/* =============================================
   CONFETTI (Konami Easter Egg)
   ============================================= */
.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 99998;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(var(--drift, 0px))
      rotate(var(--spin, 360deg));
    opacity: 0;
  }
}

.easter-egg-active {
  animation: easterRainbow 0.4s ease infinite alternate;
}
@keyframes easterRainbow {
  0% {
    box-shadow: inset 0 0 80px rgba(255, 140, 66, 0.15);
  }
  33% {
    box-shadow: inset 0 0 80px rgba(188, 140, 255, 0.15);
  }
  66% {
    box-shadow: inset 0 0 80px rgba(63, 185, 80, 0.15);
  }
  100% {
    box-shadow: inset 0 0 80px rgba(248, 81, 73, 0.15);
  }
}

/* =============================================
   FLOATING HEARTS (Buddy Pet)
   ============================================= */
.floating-heart {
  position: fixed;
  z-index: 10001;
  font-size: 1.2rem;
  pointer-events: none;
  animation: heartFloat 1.4s ease-out forwards;
}
@keyframes heartFloat {
  0% {
    transform: translateY(0) translateX(0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translateY(-80px) translateX(var(--h-drift, 0px)) scale(1.2);
    opacity: 0;
  }
}

/* =============================================
   HERO PARTICLES CANVAS
   ============================================= */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--purple),
    var(--green)
  );
  z-index: 99999;
  transition: width 0.15s ease-out;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--accent-glow);
  pointer-events: none;
}

/* =============================================
   WINDOW BUTTON INTERACTIONS
   ============================================= */
.win-wobble {
  transform-origin: center bottom;
}
.win-shake {
  animation: winShake 0.5s ease;
}
@keyframes winShake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-6px) rotate(-0.5deg);
  }
  30% {
    transform: translateX(5px) rotate(0.5deg);
  }
  45% {
    transform: translateX(-4px) rotate(-0.3deg);
  }
  60% {
    transform: translateX(3px) rotate(0.3deg);
  }
  75% {
    transform: translateX(-2px);
  }
  90% {
    transform: translateX(1px);
  }
}
.win-maximized {
  border-color: var(--accent) !important;
}

/* =============================================
   DESIGN POLISH LAYER (V2)
   ============================================= */
body {
  background:
    radial-gradient(
      1200px 700px at 10% -10%,
      rgba(255, 140, 66, 0.08),
      transparent 55%
    ),
    radial-gradient(
      900px 600px at 90% 10%,
      rgba(188, 140, 255, 0.06),
      transparent 55%
    ),
    linear-gradient(180deg, #0b1016 0%, #0d1117 100%);
}

#desktop {
  position: relative;
}

#desktop::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 25%, transparent 85%);
}

.desktop-home,
.win-section,
footer {
  position: relative;
  z-index: 1;
}

.home-content {
  max-width: 760px;
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(13, 17, 23, 0.72),
    rgba(13, 17, 23, 0.52)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.home-hello {
  letter-spacing: 0.08em;
}

.home-name {
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px rgba(255, 140, 66, 0.12);
}

.home-role {
  font-size: 1rem;
}

.btn-primary,
.btn-ghost {
  border-radius: 12px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9f5c 100%);
  box-shadow: 0 10px 26px rgba(255, 140, 66, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 16px 34px rgba(255, 140, 66, 0.32);
  transform: translateY(-3px);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  background: rgba(255, 140, 66, 0.1);
}

.win-section {
  padding-top: 52px;
  padding-bottom: 20px;
}

.window {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(22, 27, 34, 0.96),
    rgba(19, 24, 31, 0.96)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
}

.window:hover {
  border-color: rgba(255, 140, 66, 0.38);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 140, 66, 0.15) inset;
}

.win-titlebar {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0)
  );
}

.win-title {
  color: #c3cbd4;
}

.win-body {
  padding: 36px;
}

.win-statusbar {
  background: rgba(0, 0, 0, 0.18);
}

.about-text p,
.contact-message p,
.proj-card-body p {
  color: #b6c0cb;
}

.tag {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
}

.tag:hover {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 140, 66, 0.18) inset;
}

.stat-tile,
.skill-tile,
.proj-card,
.proj-featured {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
}

.stat-tile:hover,
.skill-tile:hover,
.proj-card:hover,
.proj-featured:hover {
  border-color: rgba(255, 140, 66, 0.35);
}

.proj-card-image::after,
.proj-featured .proj-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(0, 0, 0, 0.24) 100%
  );
}

.proj-title-edit {
  letter-spacing: -0.01em;
}

.proj-tech span {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.proj-click-hint {
  color: #aab6c3;
}

.contact-terminal {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 30px rgba(0, 0, 0, 0.28);
}

.term-body {
  background: linear-gradient(180deg, #0f141b 0%, #0b1118 100%);
}

footer {
  margin-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.12)
  );
}

#taskbar {
  border-top-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(24, 29, 37, 0.82),
    rgba(16, 20, 27, 0.88)
  );
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

.taskbar-pin {
  border: 1px solid transparent;
}

.taskbar-pin:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.taskbar-pin.active {
  background: rgba(255, 140, 66, 0.1);
  border-color: rgba(255, 140, 66, 0.2);
}

.modal-window {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
}

@media (max-width: 900px) {
  .home-content {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .win-body {
    padding: 24px 20px;
  }
}

@media (max-width: 700px) {
  .desktop-home {
    padding-top: 72px;
  }

  .home-content {
    padding: 18px 14px;
  }

  .win-section {
    padding-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-wallpaper,
  .home-scroll-hint,
  .home-hello,
  .home-name,
  .home-role,
  .home-cta-row {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* =============================================
   LIGHT THEME OVERRIDES
   ============================================= */
html[data-theme="light"] body {
  background:
    radial-gradient(
      1200px 720px at 10% -10%,
      rgba(217, 116, 31, 0.16),
      transparent 55%
    ),
    radial-gradient(
      900px 620px at 90% 12%,
      rgba(114, 71, 191, 0.08),
      transparent 55%
    ),
    linear-gradient(180deg, #f7f0e5 0%, #f2e9d9 100%);
}

html[data-theme="light"] #desktop::before {
  background-image:
    linear-gradient(rgba(128, 101, 68, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 101, 68, 0.08) 1px, transparent 1px);
}

html[data-theme="light"] .home-wallpaper {
  background:
    radial-gradient(
      ellipse at 18% 50%,
      rgba(217, 116, 31, 0.14) 0%,
      transparent 62%
    ),
    radial-gradient(
      ellipse at 78% 28%,
      rgba(114, 71, 191, 0.08) 0%,
      transparent 62%
    ),
    radial-gradient(
      ellipse at 50% 82%,
      rgba(47, 138, 88, 0.08) 0%,
      transparent 62%
    ),
    linear-gradient(145deg, #f8f1e6 0%, #efe3cf 100%);
}

html[data-theme="light"] .home-wallpaper::after {
  background-image:
    linear-gradient(rgba(128, 101, 68, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 101, 68, 0.08) 1px, transparent 1px);
}

html[data-theme="light"] .home-content {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 246, 0.9),
    rgba(247, 239, 227, 0.88)
  );
  border: 1px solid rgba(213, 197, 173, 0.9);
  box-shadow: 0 20px 44px rgba(102, 72, 37, 0.2);
}

html[data-theme="light"] .name-first {
  background: linear-gradient(135deg, #2f251a 0%, #d9741f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .name-last {
  background: linear-gradient(135deg, #d9741f 0%, #6f4a1f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #d9741f 0%, #e78c3d 100%);
  box-shadow: 0 10px 24px rgba(217, 116, 31, 0.28);
}

html[data-theme="light"] .btn-ghost {
  border-color: rgba(106, 81, 52, 0.3);
  color: #5e4a35;
  background: rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .btn-ghost:hover {
  background: rgba(217, 116, 31, 0.12);
  color: #4a3726;
}

html[data-theme="light"] .window {
  border-color: rgba(213, 197, 173, 0.95);
  background: linear-gradient(180deg, #fffbf3, #f8efdf);
  box-shadow: 0 18px 42px rgba(94, 66, 33, 0.16);
}

html[data-theme="light"] .window:hover {
  border-color: rgba(217, 116, 31, 0.6);
  box-shadow:
    0 22px 48px rgba(94, 66, 33, 0.2),
    0 0 0 1px rgba(217, 116, 31, 0.22) inset;
}

html[data-theme="light"] .win-titlebar {
  background: linear-gradient(180deg, #f4e9d8, #ede0cc);
  border-bottom-color: #d5c5ad;
}

html[data-theme="light"] .win-title {
  color: #5a4c3e;
}

html[data-theme="light"] .win-toolbar,
html[data-theme="light"] .win-statusbar {
  background: #efe3d1;
  color: #85755f;
}

html[data-theme="light"] .about-text p,
html[data-theme="light"] .contact-message p,
html[data-theme="light"] .proj-card-body p,
html[data-theme="light"] .modal-desc,
html[data-theme="light"] .modal-features li,
html[data-theme="light"] .modal-hero-info .modal-subtitle,
html[data-theme="light"] .login-sub {
  color: #5f5448;
}

html[data-theme="light"] .tag {
  border-color: rgba(185, 155, 118, 0.45);
  background: linear-gradient(180deg, #fffdf7, #f6ecdc);
  color: #665647;
}

html[data-theme="light"] .stat-tile,
html[data-theme="light"] .skill-tile,
html[data-theme="light"] .proj-card,
html[data-theme="light"] .proj-featured,
html[data-theme="light"] .modal-features li {
  border-color: rgba(185, 155, 118, 0.42);
  background: linear-gradient(180deg, #fffcf7, #f6ecdc);
}

html[data-theme="light"] .proj-click-hint {
  color: #7f6e58;
}

html[data-theme="light"] .proj-tech span,
html[data-theme="light"] .modal-tech-tag {
  border-color: rgba(114, 71, 191, 0.28);
  background: rgba(114, 71, 191, 0.08);
  color: #7247bf;
}

html[data-theme="light"] .proj-card-image::after,
html[data-theme="light"] .proj-featured .proj-card-image::after {
  background: linear-gradient(
    180deg,
    transparent 42%,
    rgba(68, 46, 24, 0.2) 100%
  );
}

html[data-theme="light"] .contact-terminal {
  background: #f8f0e3;
  border-color: rgba(185, 155, 118, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 26px rgba(96, 66, 32, 0.14);
}

html[data-theme="light"] .term-header {
  background: #ebddc8;
  border-bottom-color: rgba(185, 155, 118, 0.5);
}

html[data-theme="light"] .term-title {
  color: #816f57;
}

html[data-theme="light"] .term-body {
  background: linear-gradient(180deg, #fffaf0 0%, #f6ead8 100%);
  color: #3e3124;
}

html[data-theme="light"] .term-cursor {
  color: #3e3124;
}

html[data-theme="light"] .start-menu {
  background: rgba(248, 239, 226, 0.97);
  border-color: rgba(185, 155, 118, 0.5);
  box-shadow:
    0 16px 48px rgba(96, 66, 32, 0.2),
    0 0 0 1px rgba(217, 116, 31, 0.1);
}

html[data-theme="light"] .start-menu-header,
html[data-theme="light"] .start-menu-footer {
  border-color: rgba(185, 155, 118, 0.5);
}

html[data-theme="light"] .start-menu-footer {
  background: rgba(210, 190, 163, 0.26);
}

html[data-theme="light"] .start-menu-user strong {
  color: #2a2118;
}

html[data-theme="light"] .start-menu-user span,
html[data-theme="light"] .start-menu-time {
  color: #7f6f5b;
}

html[data-theme="light"] .start-tile {
  background: #fff8ed;
  border-color: rgba(185, 155, 118, 0.45);
  color: #5e4d3c;
}

html[data-theme="light"] .start-tile:hover {
  background: rgba(217, 116, 31, 0.12);
}

html[data-theme="light"] #taskbar {
  border-top-color: rgba(185, 155, 118, 0.55);
  background: linear-gradient(
    180deg,
    rgba(245, 237, 224, 0.9),
    rgba(236, 223, 204, 0.96)
  );
  box-shadow: 0 -8px 24px rgba(96, 66, 32, 0.18);
}

html[data-theme="light"] .taskbar-start:hover,
html[data-theme="light"] .taskbar-tray:hover,
html[data-theme="light"] .taskbar-pin:hover {
  background: rgba(217, 116, 31, 0.12);
}

html[data-theme="light"] .taskbar-pin {
  color: #6b5c4a;
}

html[data-theme="light"] .taskbar-pin.active {
  background: rgba(217, 116, 31, 0.14);
  border-color: rgba(217, 116, 31, 0.32);
}

html[data-theme="light"] .tray-clock {
  color: #6f604e;
}

html[data-theme="light"] .lang-toggle,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .admin-toggle {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(185, 155, 118, 0.55);
  color: #5d4f3e;
}

html[data-theme="light"] .lang-toggle:hover,
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .admin-toggle:hover {
  color: #fff;
}

html[data-theme="light"] .modal-overlay {
  background: rgba(38, 29, 19, 0.42);
}

html[data-theme="light"] .modal-window {
  border-color: rgba(185, 155, 118, 0.5);
  box-shadow: 0 26px 54px rgba(71, 48, 24, 0.32);
}

html[data-theme="light"] .form-group input {
  background: #fffaf2;
}

html[data-theme="light"] footer {
  border-top: 1px solid rgba(185, 155, 118, 0.45);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.36),
    rgba(234, 219, 197, 0.35)
  );
  color: #7f6f5d;
}

/* =============================================
   CREATIVE REFINEMENT LAYER (V3)
   ============================================= */
:root {
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Code", "Consolas", monospace;
  --display: "Sora", "Space Grotesk", sans-serif;
  --accent: #ff9d2e;
  --accent-hover: #ffb85f;
  --cyan: #31c6ff;
  --cyan-glow: rgba(49, 198, 255, 0.25);
}

body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(255, 157, 46, 0.13), transparent 60%),
    radial-gradient(900px 700px at 92% 4%, rgba(49, 198, 255, 0.13), transparent 62%),
    radial-gradient(800px 520px at 50% 110%, rgba(255, 255, 255, 0.05), transparent 68%),
    linear-gradient(180deg, #0a1118 0%, #0d1117 100%);
}

.home-name,
.home-role,
h2,
.win-title,
.assistant-title {
  font-family: var(--display);
  letter-spacing: 0.01em;
}

.home-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.home-role {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(9, 14, 20, 0.46);
  display: inline-flex;
  width: fit-content;
}

.window {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(23, 30, 40, 0.9), rgba(16, 22, 30, 0.84));
  box-shadow: 0 24px 60px rgba(1, 8, 16, 0.52);
}

.window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.06), transparent 38%);
  opacity: 0.8;
}

.win-titlebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
}

.win-icon {
  color: var(--cyan);
}

.project-controls {
  margin: -4px 0 22px;
  display: grid;
  gap: 12px;
}

.project-controls.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.project-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(6, 12, 18, 0.5);
}

.project-search-wrap i {
  color: var(--cyan);
}

#projectSearch {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
}

.project-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 24, 34, 0.55);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.project-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.project-chip.is-active {
  background: linear-gradient(135deg, rgba(49, 198, 255, 0.2), rgba(255, 157, 46, 0.24));
  color: #fff;
  border-color: rgba(49, 198, 255, 0.45);
  box-shadow: 0 6px 20px var(--cyan-glow);
}

.proj-card,
.proj-featured {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(20, 28, 38, 0.85), rgba(14, 20, 28, 0.8));
}

.proj-card:hover,
.proj-featured:hover {
  border-color: rgba(49, 198, 255, 0.4);
  box-shadow: 0 18px 38px rgba(3, 12, 20, 0.55);
}

.assistant-panel {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.assistant-panel.open {
  opacity: 1;
  pointer-events: auto;
}

.assistant-panel.open .assistant-window {
  pointer-events: auto;
}

.assistant-window {
  position: absolute;
  top: 84px;
  right: 14px;
  width: min(460px, calc(100vw - 20px));
  height: min(620px, calc(100vh - 140px));
  min-width: 320px;
  min-height: 340px;
  max-width: 92vw;
  max-height: calc(100vh - 86px);
  border: 1px solid rgba(49, 198, 255, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(720px 280px at 100% -10%, rgba(255, 157, 46, 0.16), transparent 58%),
    radial-gradient(620px 260px at -10% 110%, rgba(49, 198, 255, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(18, 26, 38, 0.97), rgba(10, 16, 25, 0.98));
  box-shadow:
    0 0 0 1px rgba(49, 198, 255, 0.1),
    0 0 60px rgba(49, 198, 255, 0.06),
    0 30px 72px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  pointer-events: none;
  resize: both;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

.assistant-window.dragging {
  user-select: none;
  cursor: grabbing;
}

.assistant-panel.assistant-docked .assistant-window {
  top: 72px;
  right: 12px;
  left: auto !important;
  width: min(430px, 42vw);
  height: calc(100vh - 144px);
  max-height: calc(100vh - 144px);
  resize: horizontal;
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(49, 198, 255, 0.2);
  cursor: grab;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
}

.assistant-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assistant-title {
  color: #f7fbff;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assistant-close,
.assistant-config {
  border: 1px solid rgba(49, 198, 255, 0.32);
  background: linear-gradient(180deg, rgba(49, 198, 255, 0.16), rgba(49, 198, 255, 0.08));
  color: #dff4ff;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition);
}

.assistant-close:hover,
.assistant-config:hover {
  color: #fff;
  border-color: rgba(255, 157, 46, 0.52);
  background: linear-gradient(180deg, rgba(255, 157, 46, 0.24), rgba(255, 157, 46, 0.13));
}

.assistant-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(49, 198, 255, 0.16);
  background: rgba(5, 12, 20, 0.58);
}

#assistantStatus {
  color: #b9e7ff;
  font-family: var(--mono);
  font-size: 0.71rem;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(660px 260px at 100% -4%, rgba(49, 198, 255, 0.12), transparent 58%),
    radial-gradient(660px 260px at -4% 102%, rgba(255, 157, 46, 0.12), transparent 58%),
    rgba(7, 13, 20, 0.55);
}

.assistant-msg {
  max-width: min(82%, 560px);
  font-size: 0.88rem;
  line-height: 1.5;
  border-radius: 14px;
  padding: 12px 14px;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eef7ff;
  font-weight: 500;
  transition: all 0.25s ease;
}

.assistant-msg-user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 157, 46, 0.36), rgba(255, 157, 46, 0.2));
  border-color: rgba(255, 157, 46, 0.55);
  box-shadow: 0 8px 20px rgba(255, 157, 46, 0.16);
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.assistant-msg-assistant {
  align-self: flex-start;
  color: #ecf7ff;
  background: linear-gradient(135deg, rgba(49, 198, 255, 0.2), rgba(49, 198, 255, 0.1));
  border-color: rgba(49, 198, 255, 0.45);
  box-shadow: 0 8px 20px rgba(49, 198, 255, 0.14);
  border-bottom-left-radius: 4px;
}

/* Markdown specific styles inside assistant messages */
.assistant-msg-assistant p { margin: 0 0 10px 0; }
.assistant-msg-assistant p:last-child { margin-bottom: 0; }
.assistant-msg-assistant h1,
.assistant-msg-assistant h2,
.assistant-msg-assistant h3,
.assistant-msg-assistant h4 { 
  margin: 16px 0 8px 0; font-weight: 700; color: inherit; opacity: 0.9; 
}
.assistant-msg-assistant h1:first-child,
.assistant-msg-assistant h2:first-child,
.assistant-msg-assistant h3:first-child { margin-top: 0; }
.assistant-msg-assistant ul, 
.assistant-msg-assistant ol { margin: 0 0 10px 0; padding-left: 20px; }
.assistant-msg-assistant li { margin-bottom: 4px; }
.assistant-msg-assistant li:last-child { margin-bottom: 0; }
.assistant-msg-assistant code {
  font-family: var(--mono);
  background: rgba(120, 120, 120, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: inherit;
  font-weight: 600;
}
.assistant-msg-assistant pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid rgba(120, 120, 120, 0.2);
}
html[data-theme="light"] .assistant-msg-assistant pre {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}
.assistant-msg-assistant pre code {
  background: transparent;
  padding: 0;
  font-weight: normal;
}
.assistant-msg-assistant blockquote {
  border-left: 3px solid currentColor;
  opacity: 0.85;
  margin: 10px 0;
  padding-left: 12px;
  font-style: italic;
}
.assistant-msg-assistant a { color: inherit; text-decoration: underline; font-weight: 600; opacity: 0.9; }
.assistant-msg-assistant a:hover { opacity: 1; }

.assistant-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(49, 198, 255, 0.22);
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.72), rgba(8, 12, 18, 0.86));
}

#assistantInput {
  flex: 1;
  border: 1px solid rgba(49, 198, 255, 0.38);
  border-radius: 10px;
  background: rgba(4, 10, 18, 0.85);
  color: #f3f9ff;
  padding: 11px 12px;
  outline: none;
  font-family: var(--font);
}

#assistantInput:focus {
  border-color: rgba(255, 157, 46, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 157, 46, 0.2);
}

#assistantInput::placeholder {
  color: rgba(226, 243, 255, 0.72);
}

#assistantSend {
  border: 1px solid rgba(255, 157, 46, 0.52);
  background: linear-gradient(135deg, rgba(255, 157, 46, 0.44), rgba(255, 157, 46, 0.24));
  color: #eaf8ff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

#assistantSend:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .project-controls {
    margin-top: 8px;
  }

  /* ---- MOBILE: Slide-in panel from right ---- */
  .assistant-panel {
    pointer-events: none;
    background: transparent;
    transition: background 0.3s ease;
  }
  .assistant-panel.open {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .assistant-window {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: calc(100vw - 60px) !important;
    max-width: 400px !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 20px 0 0 20px !important;
    border-right: 0 !important;
    resize: none !important;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
    box-shadow:
      -12px 0 60px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(49, 198, 255, 0.12) !important;
  }
  .assistant-panel.open .assistant-window {
    transform: translateX(0) !important;
  }

  /* Hide dock/float button on mobile */
  .assistant-dock {
    display: none !important;
  }

  .assistant-panel.assistant-docked .assistant-window {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: calc(100vw - 60px) !important;
    height: 100% !important;
    resize: none !important;
  }

  .assistant-subhead {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .assistant-head {
    padding: 14px 16px;
    border-radius: 20px 0 0 0;
  }

  .assistant-title {
    font-size: 0.92rem;
  }

  .assistant-form {
    padding: 12px 14px;
    gap: 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #assistantInput {
    font-size: 0.95rem;
    padding: 12px 14px;
    border-radius: 14px;
  }

  #assistantSend {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .assistant-msg {
    max-width: 100%;
  }

  .assistant-messages {
    padding: 14px;
  }
}

html[data-theme="light"] .window {
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.95), rgba(244, 235, 222, 0.9));
  border-color: rgba(157, 131, 98, 0.42);
}

html[data-theme="light"] .project-search-wrap,
html[data-theme="light"] .project-chip,
html[data-theme="light"] .assistant-window,
html[data-theme="light"] .assistant-msg,
html[data-theme="light"] #assistantInput {
  border-color: rgba(157, 131, 98, 0.4);
}

html[data-theme="light"] .project-search-wrap {
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .project-chip {
  background: rgba(255, 255, 255, 0.74);
  color: #5d4f3f;
}

html[data-theme="light"] .project-chip.is-active {
  background: linear-gradient(135deg, rgba(49, 198, 255, 0.2), rgba(255, 157, 46, 0.24));
  color: #2e2416;
}

html[data-theme="light"] .assistant-panel {
  background: transparent;
}

html[data-theme="light"] .assistant-window {
  background:
    radial-gradient(700px 260px at 100% -4%, rgba(255, 157, 46, 0.2), transparent 58%),
    radial-gradient(700px 260px at -4% 104%, rgba(49, 198, 255, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.98), rgba(246, 236, 221, 0.98));
}

html[data-theme="light"] #assistantInput,
html[data-theme="light"] .assistant-msg-assistant,
html[data-theme="light"] #assistantStatus,
html[data-theme="light"] .assistant-config,
html[data-theme="light"] .assistant-close,
html[data-theme="light"] .assistant-title {
  color: #2c241b;
}

html[data-theme="light"] .assistant-msg-assistant {
  background: linear-gradient(135deg, rgba(49, 198, 255, 0.22), rgba(49, 198, 255, 0.14));
}

html[data-theme="light"] .assistant-msg-user {
  color: #2e2416;
  background: linear-gradient(135deg, rgba(255, 157, 46, 0.42), rgba(255, 157, 46, 0.24));
}

/* =============================================
   LIGHT MODE REWORK (SOFT WARM)
   ============================================= */
html[data-theme="light"] body {
  color: #3b3228;
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(204, 140, 80, 0.08), transparent 56%),
    radial-gradient(1000px 620px at 92% 10%, rgba(120, 160, 220, 0.06), transparent 58%),
    linear-gradient(180deg, #f5f0e8 0%, #ede6da 100%);
}

html[data-theme="light"] .home-content,
html[data-theme="light"] .window,
html[data-theme="light"] .proj-card,
html[data-theme="light"] .proj-featured,
html[data-theme="light"] .stat-tile,
html[data-theme="light"] .skill-tile,
html[data-theme="light"] .start-menu,
html[data-theme="light"] .modal-window {
  background: linear-gradient(180deg, #f8f4ed, #f0e9dd);
  border-color: rgba(175, 155, 125, 0.3);
  box-shadow: 0 12px 32px rgba(97, 75, 45, 0.08);
}

html[data-theme="light"] .win-title,
html[data-theme="light"] .win-toolbar,
html[data-theme="light"] .win-statusbar,
html[data-theme="light"] .about-text p,
html[data-theme="light"] .contact-message p,
html[data-theme="light"] .proj-card-body p,
html[data-theme="light"] .modal-desc,
html[data-theme="light"] .modal-features li,
html[data-theme="light"] .term-title,
html[data-theme="light"] .start-menu-user span,
html[data-theme="light"] .start-menu-time,
html[data-theme="light"] .tray-clock {
  color: #5e5042;
}

html[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #d47028 0%, #e89548 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(201, 100, 40, 0.18);
}

html[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(155, 121, 78, 0.36);
  color: #4d3d2b;
}

html[data-theme="light"] .btn-ghost:hover {
  background: rgba(233, 127, 50, 0.14);
}

html[data-theme="light"] #taskbar {
  background: linear-gradient(180deg, rgba(245, 240, 232, 0.96), rgba(237, 230, 218, 0.97));
  border-top-color: rgba(175, 155, 125, 0.3);
}

html[data-theme="light"] .taskbar-pin,
html[data-theme="light"] .lang-toggle,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .admin-toggle {
  color: #4f3f2f;
}

html[data-theme="light"] .taskbar-pin.active {
  background: rgba(201, 90, 20, 0.17);
  border-color: rgba(201, 90, 20, 0.35);
}

/* Chatbot light mode: high contrast and vibrant */
html[data-theme="light"] .assistant-window {
  border-color: rgba(64, 137, 255, 0.38);
  background:
    radial-gradient(660px 260px at 100% -4%, rgba(255, 148, 66, 0.24), transparent 58%),
    radial-gradient(620px 260px at -4% 104%, rgba(64, 137, 255, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.99), rgba(248, 238, 224, 0.99));
}

html[data-theme="light"] .assistant-head,
html[data-theme="light"] .assistant-subhead,
html[data-theme="light"] .assistant-form {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(64, 137, 255, 0.2);
}

html[data-theme="light"] .assistant-title,
html[data-theme="light"] #assistantStatus,
html[data-theme="light"] .assistant-config,
html[data-theme="light"] .assistant-close {
  color: #2f2419;
}

html[data-theme="light"] .assistant-config,
html[data-theme="light"] .assistant-close {
  background: linear-gradient(180deg, rgba(64, 137, 255, 0.16), rgba(64, 137, 255, 0.08));
  border-color: rgba(64, 137, 255, 0.34);
}

html[data-theme="light"] .assistant-config:hover,
html[data-theme="light"] .assistant-close:hover {
  background: linear-gradient(180deg, rgba(233, 127, 50, 0.25), rgba(233, 127, 50, 0.14));
  border-color: rgba(233, 127, 50, 0.45);
}

html[data-theme="light"] .assistant-messages {
  background:
    radial-gradient(700px 280px at 100% -4%, rgba(64, 137, 255, 0.11), transparent 60%),
    radial-gradient(700px 280px at 0 102%, rgba(255, 148, 66, 0.11), transparent 60%),
    rgba(255, 255, 255, 0.56);
}

html[data-theme="light"] .assistant-msg {
  color: #241b12;
  border-color: rgba(159, 127, 88, 0.4);
  font-weight: 600;
}

html[data-theme="light"] .assistant-msg-assistant {
  color: #1e3551;
  background: linear-gradient(135deg, rgba(64, 137, 255, 0.2), rgba(64, 137, 255, 0.11));
  border-color: rgba(64, 137, 255, 0.38);
}

html[data-theme="light"] .assistant-msg-user {
  color: #3f240e;
  background: linear-gradient(135deg, rgba(233, 127, 50, 0.34), rgba(233, 127, 50, 0.18));
  border-color: rgba(233, 127, 50, 0.5);
}

html[data-theme="light"] #assistantInput {
  color: #23180f;
  background: #fffdfa;
  border-color: rgba(64, 137, 255, 0.35);
}

html[data-theme="light"] #assistantInput::placeholder {
  color: #796652;
}

html[data-theme="light"] #assistantInput:focus {
  border-color: rgba(233, 127, 50, 0.55);
  box-shadow: 0 0 0 3px rgba(233, 127, 50, 0.2);
}

html[data-theme="light"] #assistantSend {
  color: #fff;
  background: linear-gradient(135deg, #c95a14 0%, #e97f32 100%);
  border-color: rgba(201, 90, 20, 0.55);
}
