:root {
  --bg: #0b0f14;
  --bg-elev: #11161d;
  --text: #e6e8eb;
  --muted: #a9b0bb;
  --primary: #6ea8fe;
  --accent: #9b87f5;
  --danger: #ef4444;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --bg-image: none;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, #0f1320 0%, var(--bg) 60%),
    radial-gradient(1200px 700px at 120% 10%, #111b2e 0%, var(--bg) 50%),
    var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.bg::before {
  content: "";
  position: absolute;
  left: -10%;
  top: -10%;
  width: 120%;
  height: 120%;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: saturate(1.1) contrast(1.05) brightness(0.9);
  mix-blend-mode: screen;
  will-change: transform;
  animation: bgPan 42s ease-in-out infinite alternate;
}

.light .bg::before {
  mix-blend-mode: multiply;
  opacity: 0.18;
  filter: saturate(1) contrast(1) brightness(1);
}

.bg span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  mix-blend-mode: screen;
}

.bg .b1 {
  left: -10%;
  top: -12%;
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 60%);
  animation: bg1 24s ease-in-out infinite alternate;
}

.bg .b2 {
  right: -18%;
  top: 20%;
  width: 50vmax;
  height: 50vmax;
  background: radial-gradient(circle at 50% 50%, var(--primary), transparent 60%);
  animation: bg2 32s ease-in-out infinite alternate;
}

.bg .b3 {
  left: 22%;
  bottom: -22%;
  width: 65vmax;
  height: 65vmax;
  background: radial-gradient(circle at 50% 50%, var(--danger), transparent 60%);
  animation: bg3 28s ease-in-out infinite alternate;
}

@keyframes bgPan {
  0% { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(-4%, 6%, 0) scale(1.12); }
}

@keyframes bg1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(10%, 6%, 0) scale(1.06); }
}

@keyframes bg2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-6%, 8%, 0) scale(1.1); }
}

@keyframes bg3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(4%, -6%, 0) scale(1.05); }
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.3) blur(12px);
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.85), rgba(11, 15, 20, 0.6));
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.4px;
  text-decoration: none;
  color: var(--text);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 22px;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.hero {
  padding: 96px 0 64px;
}

.hero-title {
  font-size: clamp(2rem, 3.5vw + 1rem, 4rem);
  line-height: 1.05;
  margin: 0 0 12px;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw + 0.6rem, 1.25rem);
  margin: 0 0 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border: none;
}

.btn.ghost {
  background: transparent;
}

.section {
  padding: 48px 0;
  scroll-margin-top: 80px;
}

.section-title {
  margin: 0 0 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid.three {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.tags li {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
}

.project-thumb {
  height: 140px;
  border-radius: 12px;
  margin: 4px 0 12px;
  background: conic-gradient(from 180deg at 50% 50%, #1d2432, #202639, #1a2130);
  border: 1px solid var(--border);
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.socials {
  display: flex;
  gap: 12px;
}

.social {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  text-decoration: none;
}

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.light {
  --bg: #fbfbfc;
  --bg-elev: #f4f5f7;
  --text: #0f1217;
  --muted: #475269;
  --primary: #3b82f6;
  --accent: #7c3aed;
  --card: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.light .bg span {
  mix-blend-mode: multiply;
  opacity: 0.25;
}

.about-left {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
}

.about-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.about-meta h2 {
  margin: 0 0 8px;
}

.facts {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.facts li {
  margin: 6px 0;
}

.about-right h3 {
  margin: 0 0 8px;
}

@media (max-width: 900px) {
  .about-left {
    grid-template-columns: 1fr;
  }
  .about-photo {
    height: 220px;
  }
}

.scrolling main {
  animation: pageScroll 600ms ease;
}

@keyframes pageScroll {
  0% { opacity: 0.9; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: absolute;
  width: min(480px, 80%);
  padding: 18px;
  place-items: center;
}

.modal-gif {
  display: block;
  width: 70%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elev);
}

.player-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.input {
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
  min-width: 280px;
}

.presets {
  display: flex;
  gap: 8px;
}

.scroller {
  position: relative;
  overflow: hidden;
}

.track {
  display: flex;
  gap: 12px;
  will-change: transform;
  animation: marqueeLTR 40s linear infinite;
}

.scroller:hover .track {
  animation-play-state: paused;
}

.tile {
  width: 240px;
  height: 160px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
}

@keyframes marqueeLTR {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

#gallery-modal .modal-dialog {
  width: min(1200px, 95%);
}

.modal-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
