* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  zoom: 0.8;
}

body {
  background-color: #000319;
  overflow-x: hidden;
}

p {
  margin: 0;
}

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

ul {
  margin: 0;
}

li {
  padding-left: 4px;
}

/* ─── Navigation: Liquid Glass ─── */
.nav-bar {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  height: 56px;
  padding: 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(6, 9, 31, 0.45);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.nav-bar:hover {
  background: rgba(8, 12, 38, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}

.nav-link {
  color: rgba(193, 194, 211, 0.65);
  transition: color 0.3s ease;
  leading-trim: both;
  line-height: 1.1;
  cursor: pointer;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.nav-link.active {
  color: #ffffff;
}

.nav-indicator {
  position: absolute;
  bottom: -8px;
  width: 7px;
  height: 7px;
  background: #cbacf9;
  border-radius: 50%;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.15, 1);
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(203, 172, 249, 0.5);
}

/* ─── CTA Button ─── */
.cta-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 40px;
  border-radius: 14px;
  border: 1px solid rgba(105, 113, 162, 0.4);
  background-image: linear-gradient(to right, #161a31 3.395%, #06091f);
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    opacity 0.2s ease;
  cursor: pointer;
}

.cta-button:hover {
  opacity: 0.98;
  border-color: rgba(203, 172, 249, 0.42);
  box-shadow: 0 16px 34px rgba(9, 12, 37, 0.56), 0 0 0 1px rgba(203, 172, 249, 0.12);
  transform: translateY(-2px);
}

/* ─── Animated Border Glow ─── */
.cta-glow {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  z-index: 0;
}

.cta-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    transparent 0deg,
    rgba(203, 172, 249, 0.55) 60deg,
    transparent 120deg,
    transparent 180deg,
    rgba(203, 172, 249, 0.35) 240deg,
    transparent 300deg
  );
  animation: glow-spin 4s linear infinite;
  z-index: -2;
}

.cta-glow::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 13px;
  background: linear-gradient(to right, #161a31 3.395%, #06091f);
  z-index: -1;
}

@keyframes glow-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.cta-glow:hover::before {
  background: conic-gradient(
    transparent 0deg,
    rgba(203, 172, 249, 0.8) 60deg,
    transparent 120deg,
    transparent 180deg,
    rgba(203, 172, 249, 0.5) 240deg,
    transparent 300deg
  );
}

/* ─── Tech Stack Pills ─── */
.tech-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 8px 0;
}

.tech-marquee::before,
.tech-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  width: 120px;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tech-marquee::before {
  left: 0;
  background: linear-gradient(to right, #000319, rgba(0, 3, 25, 0));
}

.tech-marquee::after {
  right: 0;
  background: linear-gradient(to left, #000319, rgba(0, 3, 25, 0));
}

.tech-marquee-track {
  display: flex;
  width: fit-content;
  will-change: transform;
}

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

.tech-marquee-group {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 14px;
  flex-shrink: 0;
}

.tech-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(14, 17, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.2px;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  cursor: default;
}

.tech-pill-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tech-pill:hover {
  background: rgba(22, 26, 49, 0.95);
  border-color: rgba(203, 172, 249, 0.2);
  transform: translateY(-1px);
}

@keyframes tech-marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ─── Social Icon Buttons ─── */
.social-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: block;
  background: rgba(5, 4, 31, 0.08);
  border-radius: 8px;
  overflow: clip;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    background-color 0.3s ease;
}

.social-icon-border {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.social-icon-gradient {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(4 0 0 4 20 40)'><stop stop-color='rgba(255,255,255,0.04)' offset='0'/><stop stop-color='rgba(255,255,255,0)' offset='1'/></radialGradient></defs></svg>");
}

.social-icon-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0px 0px 8px 0.82px rgba(255, 255, 255, 0.12);
}

.social-icon-btn:hover {
  background: rgba(203, 172, 249, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 18px rgba(203, 172, 249, 0.2);
  transform: translateY(-2px);
}

/* ─── Project Cards ─── */
.project-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s ease,
    box-shadow 0.32s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: -30% -70%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(203, 172, 249, 0.1) 50%, transparent 60%);
  transform: translateX(-14%) rotate(3deg);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(203, 172, 249, 0.4);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(203, 172, 249, 0.12);
}

.project-card:hover::before {
  transform: translateX(12%) rotate(3deg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cta-button,
  .social-icon-btn,
  .project-card,
  .project-card::before,
  .cta-glow::after,
  .tech-marquee-track {
    transition: none;
    animation: none;
  }
}

/* ─── Mask Composites ─── */
.grid-pattern-mask {
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
}

.profile-mask {
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
}

.spotlight-layer {
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
}

.pattern-mid {
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
  height: 800px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #000319;
}

::-webkit-scrollbar-thumb {
  background: rgba(22, 26, 49, 0.7);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 35, 64, 0.9);
}

/* ─── Cookie Leaderboard ─── */
.cookie-lb {
  width: 160px;
  border-radius: 14px;
  border: 1px solid rgba(54, 55, 73, 0.35);
  background: rgba(4, 7, 29, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 12px 8px;
  z-index: 3;
}

.cookie-lb-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #cbacf9;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}

.cookie-lb-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 180px;
  overflow-y: auto;
}

.cookie-lb-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 4px;
  font-size: 11px;
  transition: background 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
  border-radius: 5px;
}

.cookie-lb-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cookie-lb-row.is-you {
  background: rgba(203, 172, 249, 0.06);
}

.cookie-lb-rank {
  width: 20px;
  text-align: center;
  font-weight: 700;
  color: rgba(193, 194, 211, 0.4);
  font-size: 10px;
  flex-shrink: 0;
  margin-right: 6px;
}

.cookie-lb-row:nth-child(1) .cookie-lb-rank { color: #ffd700; }
.cookie-lb-row:nth-child(2) .cookie-lb-rank { color: #c0c0c0; }
.cookie-lb-row:nth-child(3) .cookie-lb-rank { color: #cd7f32; }

.cookie-lb-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #c1c2d3;
  font-weight: 500;
}

.cookie-lb-row.is-you .cookie-lb-name { color: #cbacf9; font-weight: 600; }

.cookie-lb-sep {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 8px;
  flex-shrink: 0;
}

.cookie-lb-score {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

.cookie-lb-row.is-you .cookie-lb-score { color: #cbacf9; }

.cookie-lb-empty {
  text-align: center;
  font-size: 10px;
  color: rgba(193, 194, 211, 0.35);
  padding: 8px 0;
}

/* ─── Cookie Username Display ─── */
.cookie-username {
  font-size: 10px;
  color: rgba(203, 172, 249, 0.6);
  text-align: center;
  margin-top: 2px;
  transition: opacity 0.4s ease;
}

/* ─── Cookie Name Prompt ─── */
.cookie-name-prompt {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.95);
  width: 170px;
  background: rgba(4, 7, 29, 0.92);
  border: 1px solid rgba(203, 172, 249, 0.2);
  border-radius: 12px;
  padding: 10px 12px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.15, 1);
  z-index: 10;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.cookie-name-prompt.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(8px) scale(1);
}

.cookie-name-prompt-label {
  font-size: 11px;
  color: #c1c2d3;
  margin-bottom: 8px;
  text-align: center;
}

.cookie-name-input {
  flex: 1;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid rgba(105, 113, 162, 0.4);
  background: rgba(12, 15, 36, 0.95);
  color: #f0f0f5;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.25s ease;
}

.cookie-name-input::placeholder {
  color: rgba(193, 194, 211, 0.4);
}

.cookie-name-input:focus {
  border-color: rgba(203, 172, 249, 0.6);
  background: rgba(16, 19, 42, 0.95);
}

.cookie-name-save {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(203, 172, 249, 0.3);
  background: rgba(203, 172, 249, 0.12);
  color: #cbacf9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.cookie-name-save:hover {
  background: rgba(203, 172, 249, 0.22);
  border-color: rgba(203, 172, 249, 0.5);
}

.cookie-name-error {
  font-size: 10px;
  color: #f05032;
  margin-top: 4px;
  text-align: center;
  min-height: 14px;
}


/* ─── Cookie Clicker ─── */
.cookie-clicker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
  user-select: none;
}

.cookie-count {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.5px;
  text-align: center;
  min-width: 40px;
}

.cookie-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 13, 32, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.cookie-btn:hover {
  border-color: rgba(203, 172, 249, 0.25);
  box-shadow: 0 0 24px rgba(203, 172, 249, 0.1);
  transform: scale(1.08);
}

.cookie-btn:active {
  transform: scale(0.92);
}

.cookie-emoji {
  font-size: 40px;
  line-height: 1;
  display: block;
  transition: transform 0.1s ease;
  pointer-events: none;
}

.cookie-label {
  font-size: 11px;
  color: rgba(193, 194, 211, 0.5);
  letter-spacing: -0.2px;
  text-align: center;
  white-space: nowrap;
}

.cookie-pop {
  position: absolute;
  pointer-events: none;
  font-size: 16px;
  font-weight: 700;
  color: #cbacf9;
  opacity: 0;
  animation: cookie-float 0.7s ease-out forwards;
}

@keyframes cookie-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.7); }
}

/* ─── Connect 4 ─── */
.c4-card {
  width: 420px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.c4-board {
  display: flex;
  gap: 6px;
  padding: 10px;
  background: rgba(6, 9, 31, 0.6);
  border-radius: 14px;
  border: 1px solid rgba(54, 55, 73, 0.25);
}

.c4-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.c4-col:hover { transform: translateY(-2px); }
.c4-col.disabled { pointer-events: none; }

.c4-slot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.c4-col:hover .c4-slot:not(.filled) {
  border-color: rgba(203, 172, 249, 0.2);
}

.c4-piece {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  animation: c4-drop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.c4-piece.you {
  background: radial-gradient(circle at 35% 35%, #d4bfff, #cbacf9 40%, #9b6dff);
  box-shadow: 0 2px 8px rgba(203, 172, 249, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.c4-piece.cpu {
  background: radial-gradient(circle at 35% 35%, #7cb8ff, #4a90d9 40%, #2563eb);
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.c4-piece.win-piece {
  animation: c4-drop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, c4-glow 0.8s ease-in-out infinite alternate;
}

@keyframes c4-drop {
  from { transform: translateY(-250px); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes c4-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.4); }
}

.c4-slot.filled { border-color: transparent; }

.c4-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.c4-you-dot {
  background: radial-gradient(circle at 35% 35%, #d4bfff, #cbacf9);
  box-shadow: 0 0 6px rgba(203, 172, 249, 0.4);
}

.c4-cpu-dot {
  background: radial-gradient(circle at 35% 35%, #7cb8ff, #4a90d9);
  box-shadow: 0 0 6px rgba(74, 144, 217, 0.4);
}

/* ─── Tic Tac Toe ─── */
.ttt-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  aspect-ratio: 1;
}

.ttt-cell {
  background: rgba(10, 13, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 36px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ttt-cell:hover:not([disabled]) {
  background: rgba(16, 20, 44, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  transform: scale(1.04);
}

.ttt-cell[disabled] {
  cursor: default;
}

.ttt-cell.x {
  color: #cbacf9;
  text-shadow: 0 0 18px rgba(203, 172, 249, 0.4);
}

.ttt-cell.o {
  color: #4a90d9;
  text-shadow: 0 0 18px rgba(74, 144, 217, 0.4);
}

.ttt-cell.win-cell {
  background: rgba(203, 172, 249, 0.12);
  border-color: rgba(203, 172, 249, 0.5);
  animation: ttt-pulse 0.6s ease;
}

.ttt-cell.lose-cell {
  background: rgba(240, 80, 50, 0.1);
  border-color: rgba(240, 80, 50, 0.45);
}

@keyframes ttt-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.ttt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.ttt-x-color {
  background: rgba(203, 172, 249, 0.18);
  color: #cbacf9;
}

.ttt-o-color {
  background: rgba(74, 144, 217, 0.18);
  color: #4a90d9;
}

.ttt-reset-btn {
  padding: 8px 20px;
  border-radius: 10px;
  border: 1px solid rgba(105, 113, 162, 0.35);
  background: linear-gradient(to right, #161a31, #06091f);
  color: white;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}

.ttt-reset-btn:hover {
  border-color: rgba(203, 172, 249, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ─── Ranked Text ─── */
.ttt-ranked-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  color: #cbacf9;
  letter-spacing: -1px;
}

/* ─── TTT Leaderboard ─── */
.ttt-lb {
  width: 210px;
  border-radius: 18px;
  border: 1px solid rgba(54, 55, 73, 0.35);
  background: rgba(4, 7, 29, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px 12px;
  position: relative;
}

.ttt-lb-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #cbacf9;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
}

.ttt-lb-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ttt-lb-list .cookie-lb-row {
  padding: 5px 5px;
  font-size: 12px;
}

.ttt-lb-list .cookie-lb-rank {
  width: 22px;
  font-size: 10px;
  margin-right: 6px;
}

.ttt-lb-list .cookie-lb-name {
  font-size: 12px;
}

.ttt-lb-list .cookie-lb-score {
  font-size: 11px;
  min-width: 28px;
}

/* TTT name prompt inside leaderboard */
.ttt-name-prompt {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.15, 1), opacity 0.35s ease, margin-top 0.35s ease, padding-top 0.35s ease;
  margin-top: 0;
  padding-top: 0;
}

.ttt-name-prompt.visible {
  max-height: 120px;
  opacity: 1;
  margin-top: 10px;
  padding-top: 10px;
}

/* ─── ELO Rank Badge ─── */
.ttt-rank-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid;
  transition: all 0.4s ease;
}

/* ─── Selection ─── */
::selection {
  background: rgba(203, 172, 249, 0.3);
  color: white;
}

/* ═══════════════════════════════════════════════
   Mobile Responsive — max-width: 768px
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Navigation ── */
  .nav-bar {
    top: 16px;
    height: 46px;
    padding: 0 22px;
  }
  .nav-bar .flex {
    gap: 22px !important;
    font-size: 14px !important;
  }

  /* ── Hero: absolute layout → flex column ── */
  #hero > div:first-child {
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 96px 24px 28px !important;
    gap: 14px;
  }

  .grid-pattern-mask {
    inset: 0 !important;
    height: 100% !important;
    opacity: 0.5;
  }

  #hero > div:first-child > *:not(.grid-pattern-mask) {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }

  /* Profile photo */
  #hero > div:first-child > :nth-child(2) {
    order: 1;
  }

  /* Name heading */
  #hero > div:first-child > :nth-child(3) {
    width: 100% !important;
    text-align: center;
    order: 2;
  }
  #hero h1 {
    font-size: 38px !important;
    letter-spacing: -1.8px !important;
  }

  /* Subtitle */
  #hero > div:first-child > p {
    font-size: 16px !important;
    white-space: normal !important;
    text-align: center !important;
    order: 3;
    padding: 0 8px;
  }

  /* CTA buttons — stack vertically */
  #hero > div:first-child > :nth-child(5) {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    order: 4;
  }
  #hero .cta-button {
    padding: 16px 28px !important;
    width: 100%;
    max-width: 260px;
  }

  /* Cookie section — stack on mobile */
  .cookie-section {
    position: static !important;
    flex-direction: column-reverse !important;
    align-items: center !important;
    gap: 12px !important;
    order: 5;
    margin-top: 6px;
  }
  .cookie-lb {
    width: 200px;
  }
  .cookie-clicker {
    position: relative !important;
  }
  .cookie-btn {
    width: 64px;
    height: 64px;
  }
  .cookie-emoji {
    font-size: 32px !important;
  }
  .cookie-count {
    font-size: 18px;
  }

  /* ── Marquee ── */
  #hero > div:nth-child(2) {
    margin-top: 12px !important;
  }
  .tech-marquee::before,
  .tech-marquee::after {
    width: 40px;
  }
  .tech-pill {
    padding: 6px 14px;
    font-size: 13px;
  }
  .tech-pill-icon {
    width: 16px;
    height: 16px;
  }

  /* ── Section Headings ── */
  #projects > div:first-child h2,
  #tictactoe > div:first-child h2 {
    font-size: 26px !important;
    letter-spacing: -1px !important;
    padding: 0 16px;
  }

  /* ── Projects Section ── */
  #projects {
    margin-top: 40px !important;
    padding: 0 16px;
  }

  .pattern-mid {
    display: none;
  }

  .project-card {
    width: 100% !important;
    border-radius: 16px !important;
    margin-bottom: 28px !important;
  }

  /* Card screenshot area */
  .project-card > div:first-child {
    width: calc(100% - 24px) !important;
    height: 180px !important;
    margin-top: 16px !important;
    border-radius: 10px !important;
  }

  /* Screenshot overlay — fill container */
  .project-card > div:first-child > div:last-child {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  .project-card > div:first-child > div:last-child img {
    object-fit: cover !important;
  }

  /* Card content */
  .project-card > div:last-child {
    padding: 16px 16px 24px !important;
  }
  .project-card h3 {
    font-size: 20px !important;
    line-height: 24px !important;
    margin-bottom: 12px !important;
  }
  .project-card ul {
    font-size: 14px !important;
    padding-left: 18px !important;
    margin-bottom: 20px !important;
  }

  /* Stats row */
  .project-card > div:last-child > div:nth-of-type(1) {
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
  }
  .project-card > div:last-child > div:nth-of-type(1) > div {
    width: 100% !important;
  }
  .project-card > div:last-child > div:nth-of-type(1) p {
    font-size: 20px !important;
    line-height: 24px !important;
  }

  /* Tech + CTA row */
  .project-card > div:last-child > div:nth-of-type(2) {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: flex-start !important;
    padding: 0 !important;
  }
  .project-card > div:last-child > div:nth-of-type(2) a span {
    font-size: 16px !important;
  }

  /* ── Tic Tac Toe ── */
  #tictactoe {
    margin-top: 48px !important;
    padding: 0 16px;
  }
  .ttt-card {
    width: 100% !important;
    max-width: 340px;
    padding: 24px 20px !important;
  }
  .ttt-cell {
    font-size: 28px;
    border-radius: 10px;
  }

  /* ── Contact ── */
  #contact {
    padding-top: 80px !important;
    padding-left: 24px;
    padding-right: 24px;
  }
  #contact h2 {
    font-size: 30px !important;
    letter-spacing: -1px !important;
  }
  #contact p {
    font-size: 14px !important;
  }

  /* ── Footer ── */
  footer {
    padding: 30px 24px 40px !important;
  }
  footer > .flex {
    flex-direction: column !important;
    gap: 20px;
    align-items: center;
    text-align: center;
  }
}
