@font-face {
  font-family: VT323;
  src: url(../fonts/VT323-Regular.ttf);
  font-display: swap;
}
:root {
  --size: 20px;
  --bg-color: #2c1e3d;
  --player-bg: #4d3d60;
  --screen-bg: #3c6b49;
  --screen-text: #1b2601;
  --pixel-border: #000000;
  --btn-face: #bcbcc4;
  --btn-face-accent: #ff4757;
  --font-family:
    "VT323", "Press Start 2P", "Silkscreen", "Courier New", Courier, monospace;
  --text-main: #fff;
  --text-muted: #ccc;
  --page-bg:
    radial-gradient(
      circle at top left,
      rgba(152, 78, 208, 0.22),
      transparent 24%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 192, 90, 0.16),
      transparent 18%
    ),
    linear-gradient(180deg, #08040f 0%, #140b25 50%, #090410 100%);
  --overlay-bg: rgba(2, 2, 8, 0.78);
  --panel-bg: rgba(0, 0, 0, 0.7);
  --card-bg: #111;
  --input-bg: #111;
  --input-text: #fff;
  --nav-link-bg: #111;
  --nav-link-fg: #fff;
  --header-avatar-bg: rgba(0, 0, 0, 0.55);
  --title-color: #f5d25c;
  --subtitle-color: #d8c46c;
  --intro-color: #fff;
  --book-bg: #111;
  --highlight-color: #b8ffb8;
  --track-bg: #222;
  --thumb-bg: #fff;
  --sidebar-bg: linear-gradient(180deg, #20162a, #2c2136);
  --social-bg: #111;
  --social-fg: #fff;
  --resume-link-bg: #111;
  --resume-link-fg: #fff;
  --nav-link-hover: #2b2b2b;
  --preloader-bg: #000;
  --preloader-text: #fff;
  --btn-text: #000;
  --accent-btn-text: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #2b0b0b;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff4d4d, #d10000);
  border-radius: 10px;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.35);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
#layout-usage-exit-layout-animation .is-hidden {
  display: none;
}

body {
  justify-content: center;
  align-items: center;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  background: var(--page-bg);
  color: var(--text-main);
  overflow-x: hidden;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    background 0.45s ease,
    color 0.45s ease;
  scrollbar-width: thin;
  scrollbar-color: #ff4d4d #2b0b0b;
}

body,
.sidebar,
.main-box,
.pixel-player,
.pixel-box,
.album-container,
.nav-link,
.contact-box,
.resume-section,
.game-card,
.retro-btn,
.accent-btn,
.contact-form input,
.contact-form textarea,
.social-link,
.book,
.header-text h1,
.header-text h2,
.pixel-avatar {
  transition:
    background 0.45s ease,
    color 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease;
}

.el {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(90deg, rgba(218, 171, 59, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, rgba(218, 171, 59, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 63, 172, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(120, 63, 172, 0.12) 1px, transparent 1px),
    radial-gradient(
      circle at 20% 15%,
      rgba(255, 255, 255, 0.08),
      transparent 12%
    ),
    radial-gradient(
      circle at 75% 22%,
      rgba(189, 167, 224, 0.08),
      transparent 12%
    ),
    linear-gradient(180deg, rgba(15, 8, 23, 0.95), rgba(20, 10, 35, 0.92));
  background-size:
    36px 36px,
    36px 36px,
    18px 18px,
    18px 18px,
    100% 100%,
    100% 100%,
    100% 100%;
  background-position:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  animation: pixel-shift 16s linear infinite;
  image-rendering: pixelated;
}

@keyframes pixel-shift {
  0% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
  50% {
    background-position:
      18px 18px,
      -18px -18px,
      9px -9px,
      -9px 9px,
      0 0,
      0 0,
      0 0;
  }
  100% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
}
p {
  font-size: 22px;
  color: var(--text-main);
  text-align: justify;
  justify-content: center;
  margin: 1em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pixel-cat svg,
.pixel-avatar svg {
  shape-rendering: crispEdges;
}

#audio-engine {
  display: none;
}
.intro {
  font-size: 30px;
  font-weight: bold;
  color: var(--intro-color);
}

.retro-rc {
  font-family: VT323;
  font-size: 20px;
  padding: 10px 0;
  border: 4px solid var(--pixel-border);
  background: var(--btn-face);
  color: var(--input-text);
  cursor: pointer;
  outline: none;
  flex-grow: 1;
  position: relative;

  /* Pixel art extrusion look using standard box shadows */
  box-shadow:
    inset -4px -4px 0 #5f5d5d,
    inset 4px 4px 0 #fff;
  align-items: baseline;
}
.container {
  direction: rtl;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex-grow: 1;
  justify-content: flex-start;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

@keyframes flicker {
  to {
    -webkit-mask-position:
      50% 50%,
      0 50%;
    mask-position:
      50% 50%,
      0 50%;
  }
}
/* Main Cabinet Wrapper */
.pixel-player {
  margin-top: 30px;
  background: var(--player-bg);
  padding: 24px;
  width: 320px;
  box-shadow:
    0 8px 0 0 #312440,
    0 -8px 0 0 #695582,
    8px 0 0 0 #695582,
    -8px 0 0 0 #312440,
    inset 0 0 0 4px var(--pixel-border);
  border: 4px solid var(--pixel-border);
  position: relative;
}

/* Shared Pixel Layout Boxes (NES style edges) */
.pixel-box {
  border: 4px solid var(--pixel-border);
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  background: var(--card-bg);
}

/* Green Gameboy LCD Screen */
.screen {
  background: var(--screen-bg);
  padding: 12px;
  color: var(--screen-text);
  overflow: hidden;
}

.marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 6px;
}

.pixel-text {
  font-size: 10px;
  line-height: 1.4;
  image-rendering: pixelated;
}

#track-title {
  display: inline-block;
  font-size: 12px;
  animation: marquee 8s linear infinite;
}

.sub-text {
  font-size: 8px;
  opacity: 0.8;
}

/* Marquee Scroll Animation */
@keyframes marquee {
  0% {
    transform: translate3d(100%, 0, 0);
  }
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* Album Art Framing */
.album-container {
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--card-bg);
}

.album-art {
  width: 120px;
  height: 120px;
  background-size: cover;
  background-position: center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  border: 4px solid var(--pixel-border);
}

/* Timeline & Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.timestamp {
  font-size: 8px;
  color: var(--text-main);
  width: 45px;
}

.slider-wrapper {
  flex-grow: 1;
  margin: 0 8px;
  min-height: 20px;
  position: relative;
}

/* Custom 8-bit Progress Bar Slider */
input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  background: var(--track-bg);
  border: 2px solid var(--pixel-border);
  box-sizing: border-box;
  border-radius: 0;
}

input[type="range"]::-webkit-slider-thumb {
  height: 14px;
  width: 10px;
  background: var(--thumb-bg);
  border: 2px solid var(--pixel-border);
  -webkit-appearance: none;
  appearance: none;
  margin-top: -1px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
  border-radius: 0;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 12px;
  background: var(--track-bg);
  border: 2px solid var(--pixel-border);
  box-sizing: border-box;
  border-radius: 0;
}

input[type="range"]::-moz-range-thumb {
  height: 14px;
  width: 10px;
  background: var(--thumb-bg);
  border: 2px solid var(--pixel-border);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
  border-radius: 0;
}

input[type="range"]::-ms-track {
  width: 100%;
  height: 12px;
  background: transparent;
  border-color: transparent;
  color: transparent;
  box-sizing: border-box;
}

input[type="range"]::-ms-fill-lower,
input[type="range"]::-ms-fill-upper {
  background: var(--track-bg);
  border: 2px solid var(--pixel-border);
}

input[type="range"]::-ms-thumb {
  display: block;
  box-sizing: border-box;
  height: 16px;
  width: 10px;
  background: var(--thumb-bg);
  border: 2px solid var(--pixel-border);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
}

/* Hardware Controls Layout */
.controls-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Modular Pixel Push-Buttons */
.retro-btn {
  font-family: var(--font-family);
  font-size: 14px;
  flex-grow: 1;
  padding: 10px 0;
  border: 4px solid var(--pixel-border);
  background: var(--btn-face);
  color: var(--btn-text);
  cursor: pointer;
  outline: none;
  position: relative;
  /* Pixel art extrusion look using standard box shadows */
  box-shadow:
    inset -4px -4px 0 #85858b,
    inset 4px 4px 0 #fff;
}

.retro-btn:active {
  box-shadow:
    inset 4px 4px 0 #85858b,
    inset -4px -4px 0 transparent;
  padding-top: 12px;
  padding-bottom: 8px;
}

.accent-btn {
  background: var(--btn-face-accent);
  color: var(--accent-btn-text);
  box-shadow:
    inset -4px -4px 0 #b31929,
    inset 4px 4px 0 #ff7685;
}

.accent-btn:active {
  box-shadow:
    inset 4px 4px 0 #b31929,
    inset -4px -4px 0 transparent;
}
.side {
  justify-content: center;
  align-items: center;
}

/* Sidebar navigation (fixed left) */
.sidebar {
  position: fixed;
  left: 1rem;
  top: 1rem;
  bottom: 1rem;
  width: 340px;
  min-height: calc(100vh - 2rem);
  background: var(--sidebar-bg);
  border: 4px solid var(--pixel-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 30;
}
.nav-link {
  display: inline-block;
  padding: 10px 8px;
  color: var(--nav-link-fg);
  text-decoration: none;
  border: 3px solid var(--pixel-border);
  background: var(--nav-link-bg);
  font-family: var(--font-family);
  font-size: 20px;
  text-align: center;
}
.sidebar .logo-small {
  font-family: var(--font-family);
  font-size: 20px;
  color: gold;
  margin: 0 0 12px 0;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.sidebar-player {
  width: 100%;
  margin-top: 16px;
}
.sidebar-player-title {
  font-family: var(--font-family);
  font-size: 20px;
  color: gold;
  margin-bottom: 10px;
  text-align: center;
}
.sidebar .pixel-player {
  width: 100%;
  max-width: 320px;
  padding: 14px;
}
.sidebar .album-art {
  width: 92px;
  height: 92px;
}
.sidebar .progress-container {
  gap: 6px;
}
.sidebar .controls-row {
  flex-wrap: wrap;
  gap: 6px;
}
.sidebar .retro-btn {
  padding: 8px 0;
  font-size: 12px;
}
.nav-link {
  display: inline-block;
  padding: 8px 6px;
  color: var(--nav-link-fg);
  text-decoration: none;
  border: 3px solid var(--pixel-border);
  background: var(--nav-link-bg);
  font-family: var(--font-family);
  font-size: 18px;
  text-align: center;
}
.nav-link:focus,
.nav-link:hover {
  outline: none;
  background: var(--nav-link-hover);
}

/* Centered main boxed layout */
.main-box {
  margin: 2rem auto;
  margin-left: calc(360px + 2rem);
  width: min(960px, calc(100% - 360px - 4rem));
  max-width: 960px;
  padding: 24px;
  background: var(--overlay-bg);
  border: 4px solid var(--pixel-border);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.6);
  overflow-x: hidden;
  box-sizing: border-box;
  text-align: center;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.header-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pixel-avatar {
  width: 112px;
  height: 112px;
  padding: 10px;
  background: var(--header-avatar-bg);
  border: 4px solid var(--pixel-border);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.pixel-avatar svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.header-text {
  min-width: 0;
  flex: 1 1 180px;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  text-align: center;
}

.header-text h1 {
  font-size: clamp(1.35rem, 5vw, 3.4rem);
  margin: 0;
  color: var(--title-color);
  text-shadow: 0 0 0.25em rgba(255, 255, 255, 0.12);
  min-height: 1.2em;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}

.header-text h2 {
  margin: 8px 0 0;
  font-size: clamp(0.62rem, 2.5vw, 1rem);
  color: var(--subtitle-color);
  letter-spacing: clamp(0.04em, 1vw, 0.18em);
  text-transform: uppercase;
  min-height: 1.2em;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.theme-toggle {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  font-size: clamp(11px, 2.8vw, 14px);
  padding: 10px 14px;
}

.header-text.typing h1,
.header-text.typing h2 {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  position: relative;
}

.header-text.typing h1::after,
.header-text.typing h2::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: rgba(255, 255, 255, 0.75);
  animation: caret-blink 1.2s steps(2) infinite;
}

:root.light .header-text.typing h1::after,
:root.light .header-text.typing h2::after {
  background: rgba(0, 0, 0, 0.65);
}

@keyframes caret-blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.library-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 6px;
  padding-bottom: 26px;
  position: relative;
}
.book {
  position: relative;
  width: 120px;
  flex: 0 0 auto;
  text-align: center;
  border: 4px solid var(--pixel-border);
  background: var(--book-bg);
  padding: 6px;
  margin-bottom: 10px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  will-change: transform, box-shadow;
}
.book:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(120, 63, 172, 0.45);
  border-color: rgba(152, 78, 208, 0.9);
  z-index: 20;
}
.book img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  display: block;
  border: 3px solid var(--pixel-border);
}
.book-title {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-main);
  font-family: var(--font-family);
  display: block;
  width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.resume-section {
  background: var(--card-bg);
  border: 4px solid var(--pixel-border);
  padding: 16px;
  margin-top: 24px;
  text-align: center;
}

.resume-section a {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  color: var(--resume-link-fg);
  border: 3px solid var(--pixel-border);
  background: var(--resume-link-bg);
  text-decoration: none;
  font-family: var(--font-family);
}

/* Hover + focus styles for the resume download button */
.resume-section a:hover,
.resume-section a:focus {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(120, 63, 172, 0.45);
  border-color: rgba(152, 78, 208, 0.9);
  background: linear-gradient(
    180deg,
    rgba(152, 78, 208, 0.95),
    rgba(120, 63, 172, 0.6)
  );
  color: var(--text-main);
  outline: none;
}

.resume-section a:focus-visible {
  box-shadow:
    0 0 0 4px rgba(152, 78, 208, 0.18),
    0 14px 28px rgba(120, 63, 172, 0.35);
}

/* Contact box styles */
.contact-box {
  display: block;
  margin: 20px auto;
  max-width: 820px;
  padding: 18px;
  position: relative;
  border: 5px solid var(--pixel-border);
  background: var(--panel-bg);
}
.contact-grid {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.contact-section a:hover,
.contact-section a:focus {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(120, 63, 172, 0.45);
  border-color: rgba(152, 78, 208, 0.9);
  background: linear-gradient(
    180deg,
    rgba(152, 78, 208, 0.95),
    rgba(120, 63, 172, 0.6)
  );
  color: var(--text-main);
  outline: none;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--social-fg);
  text-decoration: none;
  border: 3px solid var(--pixel-border);
  background: var(--social-bg);
  font-family: var(--font-family);
}
.pixel-icon {
  width: 28px;
  height: 28px;
  display: inline-block;
  image-rendering: pixelated;
  background-size: 7px 7px;
}
.linkedin .pixel-icon,
.linkedin-icon {
  background-image:
    linear-gradient(90deg, #0a66c2 33%, transparent 33%),
    linear-gradient(#0a66c2 33%, transparent 33%);
}
.email .pixel-icon,
.email-icon {
  background-image:
    linear-gradient(90deg, #ffcc00 33%, transparent 33%),
    linear-gradient(#ffcc00 33%, transparent 33%);
}
.social-text {
  font-size: 12px;
}

.about-section {
  margin-top: 0;
}
.about-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  margin: 0 auto;
}
.about-text-box {
  border: 4px solid var(--pixel-border);
  background: rgba(0, 0, 0, 0.45);
  padding: 18px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.about-text {
  font-size: 18px;
  line-height: 1.8;
  text-align: justify;
  max-width: 100%;
  word-break: normal;
  hyphens: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  body {
    display: block;
  }

  .sidebar {
    position: relative;
    left: 0;
    top: 0;
    bottom: auto;
    width: 100%;
    min-height: auto;
    height: auto;
    margin: 0 0 18px;
    padding: 12px;
  }

  .main-box {
    margin: 0 auto;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  .header {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .header-brand {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .header-text {
    flex: 1 1 auto;
  }

  .pixel-avatar {
    width: 96px;
    height: 96px;
    padding: 8px;
  }

  .library-scroll {
    gap: 10px;
    padding: 8px 4px;
  }

  .contact-box {
    padding: 16px;
  }

  .contact-form {
    min-width: unset;
    max-width: 100%;
  }

  .pixel-player {
    width: 100%;
    padding: 16px;
  }

  .screen {
    padding: 10px;
  }

  .album-container {
    min-height: 100px;
  }

  .progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .timestamp {
    width: auto;
    text-align: center;
  }

  .slider-wrapper {
    margin: 0;
  }

  .contact-grid {
    flex-direction: column;
    gap: 14px;
  }

  .contact-social {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .header-text h1 {
    font-size: clamp(1.2rem, 7vw, 1.85rem);
  }

  .header-text h2 {
    font-size: clamp(0.58rem, 3vw, 0.82rem);
    letter-spacing: 0.06em;
  }

  .pixel-avatar {
    width: 84px;
    height: 84px;
    padding: 6px;
  }

  .theme-toggle {
    width: 100%;
    max-width: 220px;
    white-space: normal;
    text-align: center;
  }

  .book {
    width: 90px;
  }

  .library-scroll {
    gap: 8px;
    padding: 8px 2px;
  }

  .nav-link {
    font-size: 16px;
    padding: 8px 6px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar .logo-small,
  .sidebar-player-title {
    font-size: 18px;
  }

  .sidebar .retro-btn {
    font-size: 12px;
  }

  .main-box {
    padding: 14px;
  }

  .contact-box {
    padding: 14px;
  }

  .about-text-box {
    max-height: 260px;
    overflow-y: auto;
    padding: 14px;
  }

  .about-text {
    font-size: 16px;
    line-height: 1.6;
  }

  p {
    font-size: 18px;
  }

  .intro {
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .header-text h1 {
    font-size: 1.15rem;
  }

  .header-text h2 {
    font-size: 0.55rem;
    letter-spacing: 0.04em;
  }

  .book {
    width: 82px;
  }

  .nav-link {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .el {
    animation: none;
  }

  #track-title {
    animation: none;
  }
}

:root.light {
  --bg-color: #f1f0ef;
  --btn-text: #111;
  --accent-btn-text: #fff;
  --player-bg: #d4d3d2;
  --screen-bg: #e8e6e4;
  --screen-text: #333;
  --pixel-border: #1a1a1a;
  --btn-face: #ededed;
  --btn-face-accent: #2f2f2f;
  --text-main: #111;
  --text-muted: #444;
  --page-bg:
    radial-gradient(
      circle at top left,
      rgba(200, 150, 255, 0.18),
      transparent 24%
    ),
    radial-gradient(
      circle at 82% 18%,
      rgba(255, 180, 90, 0.14),
      transparent 18%
    ),
    linear-gradient(180deg, #f5f3f7 0%, #d8d4e4 50%, #f9f8fc 100%);
  --overlay-bg: rgba(240, 240, 245, 0.92);
  --panel-bg: rgba(255, 255, 255, 0.9);
  --card-bg: #ededed;
  --input-bg: #f7f7f7;
  --input-text: #111;
  --nav-link-bg: #f3f3f3;
  --nav-link-fg: #111;
  --header-avatar-bg: rgba(255, 255, 255, 0.72);
  --intro-color: #111;
  --book-bg: #f6f5f5;
  --social-bg: #f4f4f4;
  --social-fg: #111;
  --resume-link-bg: #e3e3e3;
  --resume-link-fg: #111;
  --nav-link-hover: #d8d8d8;
  --sidebar-bg: linear-gradient(180deg, #ededed, #f1eff4);
  --preloader-bg: #f2f2f2;
  --preloader-text: #111;
}

:root.light body {
  color: var(--text-main);
}

:root.light .pixel-avatar {
  background: var(--header-avatar-bg);
}

:root.light .nav-link {
  background: var(--nav-link-bg);
  color: var(--nav-link-fg);
}

:root.light .main-box,
:root.light .contact-box,
:root.light .resume-section,
:root.light .game-card,
:root.light .pixel-box,
:root.light .album-container,
:root.light .contact-form input,
:root.light .contact-form textarea,
:root.light .sidebar {
  background: var(--panel-bg);
}

:root.light .retro-btn {
  background: var(--btn-face);
  color: var(--input-text);
}

:root.light .accent-btn {
  background: var(--btn-face-accent);
  box-shadow:
    inset -4px -4px 0 #333,
    inset 4px 4px 0 #fff;
}

:root.light .nav-link:hover,
:root.light .nav-link:focus {
  background: var(--nav-link-hover);
}

/* Preloader overlay */
.preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--preloader-bg);
  z-index: 9999;
  color: var(--preloader-text);
}
.preloader-inner {
  text-align: center;
}
.preloader-text {
  font-family: var(--font-family);
  font-size: 20px;
  color: gold;
  margin-bottom: 12px;
}
.preloader.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.preloader.hidden {
  display: none;
}
