/* =========================================================================
   Tokens
   ========================================================================= */
:root {
  --accent: #a78bfa;
  --accent-rgb: 167, 139, 250;

  --bg: #050507;
  --surface: rgba(16, 16, 22, 0.55);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f4f4f6;
  --muted: rgba(244, 244, 246, 0.6);
  --faint: rgba(244, 244, 246, 0.52); /* 0.52: about 5:1 on the dark grounds (0.38 was 3.3:1, under WCAG's 4.5) */

  --radius: 22px;
  --radius-sm: 12px;

  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

body.has-cursor,
body.has-cursor a,
body.has-cursor button,
body.has-cursor input,
body.has-cursor [role="button"] {
  cursor: none;
}

::selection {
  background: rgba(var(--accent-rgb), 0.35);
  color: #fff;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.8);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

/* skip link: off screen until it gets keyboard focus */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}
#projects:focus {
  outline: none;
}

/* read by screen readers, not shown */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   Background
   ========================================================================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg__image {
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  filter: saturate(1.1);
}

.bg__video {
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bg__video.is-ready {
  opacity: 1;
}

.bg__aurora {
  inset: -30%;
  width: 160%;
  height: 160%;
  background:
    radial-gradient(40% 35% at 25% 30%, rgba(var(--accent-rgb), 0.22), transparent 70%),
    radial-gradient(35% 30% at 75% 65%, rgba(var(--accent-rgb), 0.12), transparent 70%),
    radial-gradient(30% 30% at 60% 20%, rgba(96, 165, 250, 0.08), transparent 70%);
  filter: blur(40px);
  animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(4%, -3%, 0) rotate(8deg); }
  100% { transform: translate3d(-3%, 4%, 0) rotate(-6deg); }
}

.bg__dim {
  background: #000;
  opacity: 0.55;
}

.bg__noise {
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg__vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

/* =========================================================================
   Enter overlay
   ========================================================================= */
.enter {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(3, 3, 5, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  cursor: pointer;
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}

.enter.is-gone {
  opacity: 0;
  visibility: hidden;
}

.enter__inner {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: clamp(16px, 2.4vw, 22px);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.enter__bracket {
  color: rgba(var(--accent-rgb), 0.9);
  transition: transform 0.4s var(--ease);
}

.enter:hover .enter__bracket:first-child { transform: translateX(-6px); }
.enter:hover .enter__bracket:last-child { transform: translateX(6px); }

.enter__text {
  animation: pulse 2.2s ease-in-out infinite;
}

.enter__hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}

@keyframes pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.6); }
  50% { opacity: 0.45; text-shadow: none; }
}

/* =========================================================================
   Cursor
   ========================================================================= */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.9), 0 0 2px #fff;
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease),
    background 0.25s, opacity 0.3s;
  will-change: transform;
}

body.has-cursor .cursor {
  opacity: 1;
}

.cursor.is-hover {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.5);
}

.trail {
  position: fixed;
  inset: 0;
  z-index: 199;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* =========================================================================
   Audio control (top right)
   ========================================================================= */
.audio-ctl {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s var(--ease) 0.6s, transform 0.6s var(--ease) 0.6s;
}

body.is-entered .audio-ctl {
  opacity: 1;
  transform: none;
}

.audio-ctl__btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.audio-ctl__btn:hover {
  color: #fff;
  background: var(--surface-2);
}

.audio-ctl__vol {
  width: 0;
  opacity: 0;
  transition: width 0.35s var(--ease), opacity 0.3s, margin 0.35s;
}

.audio-ctl:hover .audio-ctl__vol,
.audio-ctl:focus-within .audio-ctl__vol {
  width: 90px;
  opacity: 1;
  margin-right: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--val, 35%), rgba(255, 255, 255, 0.15) var(--val, 35%));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

/* =========================================================================
   Hero / profile card
   ========================================================================= */
main {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 80px 16px 110px;
  position: relative;
  perspective: 1200px;
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  width: min(100%, 520px);
  padding: 40px 32px 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 60px -30px rgba(var(--accent-rgb), 0.6);
  text-align: center;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s;
  opacity: 0;
  translate: 0 24px;
  scale: 0.97;
}

body.is-entered .card {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: transform 0.5s var(--ease), opacity 1s var(--ease) 0.15s,
    translate 1s var(--ease) 0.15s, scale 1s var(--ease) 0.15s;
}

.card.is-tilting {
  transition: transform 0.12s linear, opacity 1s, translate 1s, scale 1s;
}

.card::before {
  /* animated gradient border */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg),
      transparent 0 70%,
      rgba(var(--accent-rgb), 0.9) 80%,
      transparent 90% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-angle 6s linear infinite;
  pointer-events: none;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin-angle {
  to { --angle: 360deg; }
}

.card__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.07), transparent 40%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover .card__glare {
  opacity: 1;
}

.card__views {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Avatar */
.avatar {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  transform: translateZ(40px);
}

.avatar__ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%, var(--accent));
  animation: spin 5s linear infinite;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.6));
}

.avatar__ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #0a0a0f;
}

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

.avatar__img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
}

.avatar__status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #23a55a;
  border: 4px solid #0e0e14;
}

.avatar__status[data-status="online"] { background: #23a55a; box-shadow: 0 0 10px #23a55a; }
.avatar__status[data-status="idle"] { background: #f0b232; box-shadow: 0 0 10px #f0b232; }
.avatar__status[data-status="dnd"] { background: #f23f43; box-shadow: 0 0 10px #f23f43; }
.avatar__status[data-status="offline"] { background: #80848e; }

/* Name */
.name {
  position: relative;
  margin: 0;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(100deg, #fff 30%, rgba(var(--accent-rgb), 1) 50%, #fff 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.45));
  animation: shine 6s linear infinite;
  transform: translateZ(30px);
}

@keyframes shine {
  from { background-position: 125% 0; }
  to { background-position: -125% 0; }
}

.name .sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px #fff, 0 0 12px var(--accent);
  pointer-events: none;
  animation: sparkle 1.2s ease-out forwards;
}

@keyframes sparkle {
  0% { opacity: 0; transform: scale(0); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.2); }
}

.handle {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.handle__dot {
  color: var(--faint);
}

.handle__loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.handle__loc i {
  font-size: 11px;
  color: rgba(var(--accent-rgb), 0.9);
}

/* Badges */
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 16px auto 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.badges:empty {
  display: none;
}

.badge {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--c, #fff);
  transition: transform 0.3s var(--ease);
}

.badge i {
  filter: drop-shadow(0 0 6px var(--c, #fff));
}

.badge:hover {
  transform: translateY(-3px) scale(1.12);
}

/* Tooltip */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(10, 10, 14, 0.95);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, translate 0.25s var(--ease);
  z-index: 10;
  filter: none;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  translate: -50% 0;
}

/* Bio */
.bio {
  min-height: 1.6em;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  color: rgba(244, 244, 246, 0.82);
}

.bio__caret {
  margin-left: 2px;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Discord presence */
.presence {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  text-align: left;
}

.presence__img {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #111;
}

.presence__body {
  min-width: 0;
  display: grid;
  gap: 1px;
  font-size: 12.5px;
}

.presence__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.95);
}

.presence__title {
  font-weight: 600;
}

.presence__title,
.presence__sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence__sub {
  color: var(--muted);
}

/* Socials */
.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.social {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 19px;
  color: rgba(255, 255, 255, 0.85);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.35s;
  transform: translateZ(20px);
}

.social:hover,
.social:focus-visible {
  color: #fff;
  background: color-mix(in srgb, var(--c, var(--accent)) 22%, transparent);
  border-color: color-mix(in srgb, var(--c, var(--accent)) 60%, transparent);
  box-shadow: 0 8px 24px -6px var(--c, var(--accent));
  transform: translateZ(20px) translateY(-4px);
}

.social i {
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.3s;
}

.social:hover i {
  filter: drop-shadow(0 0 6px var(--c, var(--accent)));
}

/* Music player */
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  text-align: left;
}

.player__cover {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0.1));
  background-size: cover;
  background-position: center;
  color: #fff;
}

.player.is-playing .player__cover {
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  50% { transform: scale(0.94); }
}

.player__body {
  flex: 1;
  min-width: 0;
}

.player__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.player__title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__artist {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__bar {
  position: relative;
  height: 4px;
  margin: 8px 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.player__bar::before {
  /* bigger hit area */
  content: "";
  position: absolute;
  inset: -8px 0;
}

.player__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8);
}

.player__time {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}

.player__btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 14px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.player__btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.7);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: 0;
  transition: color 0.25s, opacity 1s ease 1s;
}

body.is-entered .scroll-hint {
  opacity: 1;
}

.scroll-hint:hover {
  color: #fff;
}

.scroll-hint i {
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  50% { transform: translateY(6px); }
}

/* =========================================================================
   Skills marquee
   ========================================================================= */
.skills {
  padding: 10px 0 30px;
}

.marquee {
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: marquee 40s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

@keyframes marquee {
  to { transform: translateX(calc(-50% - 6px)); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.chip i {
  font-size: 15px;
  color: rgba(var(--accent-rgb), 0.95);
}

.chip:hover {
  color: #fff;
  border-color: var(--border-strong);
}

/* =========================================================================
   Projects
   ========================================================================= */
.projects {
  width: min(100% - 32px, 1140px);
  margin: 0 auto;
  padding: 70px 0 40px;
  scroll-margin-top: 20px;
}

.projects__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.95);
}

.eyebrow__line {
  width: 28px;
  height: 1px;
  background: currentColor;
}

.projects__title {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.projects__title sup {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  vertical-align: super;
  color: var(--faint);
  margin-left: 4px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 300px);
}

.search i {
  position: absolute;
  left: 15px;
  font-size: 13px;
  color: var(--faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search input:focus {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.search kbd {
  position: absolute;
  right: 12px;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.filter:hover {
  color: #fff;
  border-color: var(--border-strong);
}

.filter.is-active {
  color: #0a0a0f;
  background: #fff;
  border-color: #fff;
}

.filter.is-active span {
  color: rgba(0, 0, 0, 0.5);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

/* Project card */
.pcard {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.45s;
  animation: card-in 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
}

.pcard::before {
  /* spotlight border */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.85), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.pcard::after {
  /* spotlight fill */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.09), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.pcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.9), 0 0 40px -20px rgba(var(--accent-rgb), 0.6);
}

.pcard:hover::before,
.pcard:hover::after,
.pcard:focus-visible::before {
  opacity: 1;
}

.pcard.is-featured {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.pcard__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0d12;
}

/* Featured project: wide horizontal card on larger screens */
@media (min-width: 900px) {
  .pcard.is-featured {
    grid-column: span 2;
    flex-direction: row;
  }

  .pcard.is-featured .pcard__cover {
    flex: 0 0 56%;
    aspect-ratio: auto;
    min-height: 300px;
  }

  .pcard.is-featured .pcard__body {
    padding: 26px 26px 22px;
    gap: 14px;
  }

  .pcard.is-featured .pcard__title {
    font-size: 24px;
  }

  .pcard.is-featured .pcard__desc {
    -webkit-line-clamp: 4;
    font-size: 14.5px;
  }

  .pcard.is-featured .cover-art__icon {
    font-size: 64px;
  }
}

.pcard__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.pcard:hover .pcard__cover img,
.pcard:hover .cover-art__icon {
  transform: scale(1.06);
}

/* Generated cover art */
.cover-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 80% at var(--x1, 20%) var(--y1, 20%), hsla(var(--h1), 80%, 60%, 0.55), transparent 70%),
    radial-gradient(60% 80% at var(--x2, 80%) var(--y2, 90%), hsla(var(--h2), 80%, 55%, 0.45), transparent 70%),
    linear-gradient(135deg, #0f0f16, #07070a);
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

.cover-art__icon {
  position: relative;
  font-size: 46px;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 6px 22px hsla(var(--h1), 90%, 60%, 0.8));
  transition: transform 0.7s var(--ease);
}

/* block-pattern cover (Minecraft projects): the drawing fills the frame, no grid lines */
.cover-art--pixel {
  background: #050505;
}
.cover-art--pixel::before {
  display: none;
}
.cover-art--pixel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cover-art--pixel .cover-art__icon {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pcard__flags {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  z-index: 1;
}

.status,
.featured {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sc);
  box-shadow: 0 0 8px var(--sc);
}

.status--live { --sc: #34d399; }
.status--live::before { animation: ping 1.6s ease-in-out infinite; }
.status--wip { --sc: #facc15; }
.status--done { --sc: #60a5fa; }
.status--archived { --sc: #9ca3af; }

@keyframes ping {
  50% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15), 0 0 8px var(--sc); }
}

.featured {
  margin-left: auto;
  color: #fff;
  background: rgba(var(--accent-rgb), 0.35);
  border-color: rgba(var(--accent-rgb), 0.6);
}

.pcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 20px 20px;
}

.pcard__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pcard__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pcard__year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.pcard__desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pcard__cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.pcard__links {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}

.icon-btn:hover {
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.18);
  transform: translateY(-2px);
}

.pcard__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--faint);
  transition: color 0.2s, gap 0.3s var(--ease);
}

.pcard:hover .pcard__more {
  color: #fff;
  gap: 10px;
}

.empty {
  padding: 50px 0;
  text-align: center;
  font-family: var(--mono);
  color: var(--faint);
}

/* Skeleton for GitHub loading */
.pcard--skeleton {
  min-height: 330px;
  cursor: default;
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.04) 50%, transparent 70%) 0 0 / 200% 100%,
    var(--surface);
  animation: skeleton 1.4s linear infinite;
}

@keyframes skeleton {
  to { background-position: -200% 0, 0 0; }
}

/* =========================================================================
   Modal
   ========================================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}

.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s;
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal__panel {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border-radius: var(--radius);
  background: rgba(14, 14, 20, 0.92);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9), 0 0 80px -40px rgba(var(--accent-rgb), 0.8);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: none;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.3s var(--ease);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(90deg);
}

.modal__cover {
  position: relative;
  aspect-ratio: 16 / 8;
  background: #0d0d12;
}

.modal__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__cover .cover-art__icon {
  font-size: 64px;
}

.modal__body {
  display: grid;
  gap: 14px;
  padding: 24px 26px 28px;
}

.modal__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.modal__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.modal__text {
  margin: 0;
  color: rgba(244, 244, 246, 0.78);
  font-size: 14.5px;
  line-height: 1.7;
}

.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.gallery__thumb {
  flex: none;
  width: 92px;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb:hover,
.gallery__thumb.is-active {
  opacity: 1;
  border-color: rgba(var(--accent-rgb), 0.8);
}

.modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn--primary {
  color: #0a0a0f;
  background: #fff;
  border-color: #fff;
}

.btn--primary:hover {
  box-shadow: 0 10px 30px -8px rgba(var(--accent-rgb), 0.9);
}

/* =========================================================================
   Footer, toast, reveal
   ========================================================================= */
.footer {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 50px 16px 40px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.footer p {
  margin: 0;
}

.footer__top {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}

.footer__top:hover {
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.7);
  transform: translateY(-3px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(14, 14, 20, 0.92);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.8);
  font-size: 13px;
  translate: -50% 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, translate 0.4s var(--ease);
}

.toast.is-show {
  opacity: 1;
  translate: -50% 0;
}

.toast i {
  color: #34d399;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Click sparks */
.spark {
  position: fixed;
  z-index: 210;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px var(--accent);
  pointer-events: none;
  animation: spark 0.6s var(--ease) forwards;
}

@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .hero {
    padding: 70px 16px 100px;
  }

  .card {
    padding: 34px 20px 24px;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .bio {
    /* reserve two lines so the card doesn't jump while the bio types */
    min-height: 3.2em;
    font-size: 13px;
  }

  .socials {
    gap: 8px;
  }

  .social {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 17px;
  }

  .projects {
    padding-top: 50px;
  }

  .search {
    width: 100%;
  }

  .search kbd {
    display: none;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: none;
  }

  .modal {
    align-items: end;
    padding: 0;
  }

  .modal__panel {
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .modal__body {
    padding: 20px 20px 28px;
  }

  .modal__title {
    font-size: 23px;
  }

  .btn {
    flex: 1;
    justify-content: center;
  }
}

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

  .marquee__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }
}
