:root {
  --bg: #0e0e10;
  --fg: #ffffff;
  --accent: #9146ff;
  --card: #1f1f23;
  --border: #2c2c31;
  --hover: #2e2e33;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 4px;
}
::-webkit-scrollbar-thumb {
  background: #3a3a40;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #3a3a40 transparent;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Theme support */
:root[data-theme="light"] {
  --bg: #f7f7fb;
  --fg: #0e0e10;
  --card: #ffffff;
  --border: #e8e8ef;
  --hover: #f1f1f7;
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.grid-3col { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 2rem; }

.card {
  background: transparent;
  border: none;
  box-shadow: none;
}

.section {
  padding: 2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, border 0.3s ease;
}
.section:hover {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hoverable:hover { background: var(--hover); transform: translateY(-2px); }
.shadow { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }

/* Topbar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-left .profile-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff2;
}
.topbar-left .name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.topbar-center .nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.topbar-center .nav-links li a {
  color: #ccc;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}
.topbar-center .nav-links li a:hover,
.topbar-center .nav-links li a.active {
  color: var(--accent);
}
.topbar-center .nav-links i {
  font-size: 1rem;
}
.topbar-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.topbar-right .theme-toggle {
  color: white;
  background: #2a2a2e;
  padding: 0.5rem;
  border-radius: 8px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.topbar-right .theme-toggle:hover { background: var(--hover); transform: scale(1.05); }
.topbar-right .social-link {
  color: white;
  background: #2a2a2e;
  padding: 0.5rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.topbar-right .social-link:hover {
  background: var(--hover);
  transform: scale(1.1);
}

/* Bio */
.bio-section {
  padding: 3rem 2rem;
  margin: 2rem auto;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.bio-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.bio-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}
.bio-text {
  max-width: 600px;
}
.bio-text h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}
.bio-text p {
  color: #ccc;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  margin: 2rem auto 1rem;
  padding: 4rem 2rem 5rem;
  border-radius: 16px;
  background: radial-gradient(1000px 500px at 10% -20%, #9146ff22, transparent 60%),
              radial-gradient(800px 400px at 90% 120%, #00e5ff22, transparent 60%),
              linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.hero-title { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0; letter-spacing: -0.02em; }
.gradient-text { background: linear-gradient(90deg, #b57bff, #7aa2ff, #00e5ff); -webkit-background-clip: text; background-clip: text; color: transparent; animation: hue 10s linear infinite; filter: drop-shadow(0 0 10px #9146ff22); }
.hero-subtitle { color: #bbb; margin-top: 0.25rem; font-weight: 600; letter-spacing: 0.02em; }
.hero-blurb { color: #cfcfd6; margin: 0.75rem auto 1.25rem; max-width: 760px; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-stats .stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); padding: 0.6rem 0.9rem; border-radius: 12px; min-width: 180px; }
.hero-stats .stat span { display: block; font-weight: 800; font-size: 1.1rem; }
.hero-stats .stat label { display: block; font-size: 0.8rem; color: #aaa; margin-top: 0.15rem; }
.hero-bg .blob { position: absolute; width: 360px; height: 360px; filter: blur(60px); opacity: 0.35; border-radius: 50%; animation: float 18s ease-in-out infinite; }
.hero-bg .b1 { background: #9146ff; right: -120px; top: -120px; }
.hero-bg .b2 { background: #00e5ff; left: -120px; bottom: -120px; animation-delay: -6s; }
.scroll-indicator { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; color: #cfcfd6; opacity: 0.75; text-decoration: none; transition: opacity .2s ease; }
.scroll-indicator:hover { opacity: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 0.9rem; border-radius: 10px; font-weight: 700; text-decoration: none; border: 1px solid rgba(255,255,255,0.08); color: var(--fg); background: rgba(255,255,255,0.04); transition: transform .15s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(135deg, #9146ff, #7aa2ff); color: white; border-color: transparent; box-shadow: 0 6px 20px rgba(145,70,255,0.2); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,0.12); color: #e9e9ee; }
.btn.small { padding: 0.45rem 0.7rem; font-weight: 600; }
.btn.link { background: transparent; border: none; color: var(--accent); font-weight: 700; }

/* Pills / Skills */
.skills { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pill { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: #ddd; padding: 0.4rem 0.6rem; border-radius: 999px; font-size: 0.9rem; }
.section-title { text-align: center; margin: 0 0 1rem; font-weight: 800; }
.skills-note { text-align: center; color: #aaa; margin: 0.5rem 0 0.75rem; }
.skills-actions { display: flex; justify-content: center; gap: 0.5rem; }

/* Reveal animations */
[data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }

/* Projects section gain a subtle glow */
.projects { box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset, 0 25px 70px -40px rgba(145,70,255,.6); }

/* Footer */
.footer { margin-top: 2rem; padding: 1rem 0; color: #bdbdcc; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-inner { max-width: 1000px; margin: 0 auto; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.footer-links a { color: #cfcfe6; text-decoration: none; margin-right: 0.75rem; }
.footer-links a:hover { color: white; }

/* Keyframes */
@keyframes hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
@keyframes float { 0%,100% { transform: translate(0,0); } 50% { transform: translate(10px, -10px);} }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

#top-modrinth-projects .project-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 240px;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
  transition: background 0.3s ease, transform 0.2s ease;
}
#top-modrinth-projects .project-card:hover {
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-2px);
}
#top-modrinth-projects .project-card img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  margin-bottom: 0.75rem;
}
#top-modrinth-projects .project-info {
  text-align: center;
}
#top-modrinth-projects .project-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
#top-modrinth-projects .project-type,
#top-modrinth-projects .project-downloads {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0.25rem;
}
#top-modrinth-projects .project-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  justify-content: center;
}

/* Platform Logos & Headings */
.platform-logo {
  height: 20px;
  width: auto;
  max-height: 24px;
  max-width: 100px;
  object-fit: contain;
  filter: brightness(0.9);
  transition: filter 0.2s ease;
}
.platform-logo:hover {
  filter: brightness(1.2);
}
.platform-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #ccc;
  margin: 1rem auto;
  text-align: center;
}
.modrinth-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1rem 0;
}

/* Buttons */
.action-btn {
  text-decoration: none;
}
.action-btn.globe {
  background: #2a2a2e;
  color: white;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.action-btn.globe:hover {
  background: var(--hover);
  transform: scale(1.1);
}

/* Project Card Layout */
.project-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
  transition: background 0.3s ease, transform 0.2s ease;
  min-height: 220px;
}
.project-info {
  flex-grow: 1;
}
.project-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* Project list should scroll horizontally instead of wrapping vertically */
#project-list {
  display: flex;
  gap: 1rem;
  justify-content: center; /* center cards within the page when they fit */
  align-items: flex-start;  /* keep card tops aligned */
  margin: 0 auto;
  /* allow the list to grow big enough to show five 240px cards + gaps/padding
     but never exceed the viewport on small screens */
  width: min(100%, 1300px);
  overflow-x: auto;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Ensure project cards keep a fixed width and do not wrap (so they scroll horizontally) */
#project-list .project-card {
  flex: 0 0 240px; /* fixed card width */
  scroll-snap-align: center;
}

/* Optional: slightly space the container from surrounding content on small screens */
@media (max-width: 640px) {
  #project-list { padding-left: 0.75rem; padding-right: 0.75rem; max-width: 100%; }
}
