/* ===== Base Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", sans-serif;
  background: #181a1b;
  color: #e8e6e3;
  overflow-x: hidden;
  color-scheme: dark;
}

/* ===== Top Navigation ===== */
.site-nav { position: sticky; top: 0; z-index: 1001; background: rgba(32,35,36,0.85); backdrop-filter: blur(10px); box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.site-nav nav { width: min(92%, 70rem); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0; }
.site-nav .brand { font-weight: 800; letter-spacing: -0.02em; color: #e8e6e3; text-decoration: none; }
.site-nav .links { display: flex; align-items: center; gap: 0.75rem; }
.site-nav a { color: #e8e6e3; text-decoration: none; padding: 0.5rem 0.7rem; border-radius: 999px; transition: background 0.25s ease, color 0.25s ease; }
.site-nav a:hover { background: rgba(255,255,255,0.06); }
.site-nav .dropdown { position: relative; }
.site-nav .dropdown > a:after { content: "\25BE"; font-size: 0.7em; margin-left: 0.35rem; opacity: 0.8; }
.site-nav .dropdown .menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #202324; border-radius: 0.75rem; padding: 0.4rem; box-shadow: 0 10px 24px rgba(0,0,0,0.35); min-width: 180px; }
.site-nav .dropdown .menu a { display: block; padding: 0.55rem 0.8rem; border-radius: 0.5rem; }
.site-nav .dropdown:hover .menu { display: block; }

/* ===== Theme Accents ===== */
:root {
  --grad-0: #3391ff;
  --grad-50: #3391ff;
}

/* Animated gradient bloom background */
body::before { content: none; }

/* ===== Branding & Socials ===== */
.logo { position: fixed; top: 1rem; left: 1rem; width: 48px; height: auto; z-index: 1000; opacity: 0.85; }
.socials { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; gap: 1.25rem; z-index: 1000; }
.socials a { font-size: 1.5rem; color: #e8e6e3; transition: color 0.3s ease; }
.socials a:hover { color: var(--grad-0); }

/* ===== Intro Sequence ===== */
#intro { height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
#intro-wrap { display: grid; gap: 1.25rem; place-items: center; }
.intro-line { font-size: clamp(1.6rem, 6.5vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; min-height: 1.2em; }
.intro-line span { display: inline-block; background: linear-gradient(90deg, var(--grad-0), var(--grad-50)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #e8e6e3; opacity: 0; }
/* Dedicated spacer for intro so spaces are visible */
.intro-line .gap { width: 0.6ch; height: 1em; background: none; -webkit-text-fill-color: initial; opacity: 1; }
.intro-cta { margin-top: 1rem; }

/* Emphasis before drop */
.alias-ch { text-shadow: none; transition: text-shadow 0.25s ease, transform 0.25s ease; }
.intro-line span.alias-ch { background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important; -webkit-text-fill-color: currentColor !important; color: #e8e6e3 !important; }
.alias-highlight .alias-ch { text-shadow: 0 0 10px rgba(0,216,255,0.9), 0 0 22px rgba(139,0,255,0.6); transform: scale(1.06); }

/* ===== Hero ===== */
header { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 1.25rem; }
.gradient-text { font-size: clamp(2.5rem, 9vw, 6rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; background: linear-gradient(90deg, var(--grad-0), var(--grad-50)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
header h2 { color: #a1a1aa; margin-top: 1rem; font-weight: 400; font-size: clamp(1.25rem, 4vw, 2rem); }
.btn { margin-top: 3rem; padding: 0.85rem 2.5rem; border-radius: 999px; font-weight: 600; background: linear-gradient(90deg, var(--grad-0), var(--grad-50)); color: #181a1b; text-decoration: none; transition: transform 0.3s ease; display: inline-block; }
.btn:hover { transform: translateY(-4px); }

/* ===== Sections ===== */
section { min-height: 100vh; width: min(90%, 65rem); margin: 0 auto; padding: 6rem 0; }

/* ===== Projects Grid ===== */
#projects-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card { background: #202324; border-radius: 1.5rem; padding: 2.5rem 2rem; position: relative; overflow: hidden; cursor: pointer; transition: transform 0.4s cubic-bezier(.34,1.56,.64,1); }
.card:hover { transform: translateY(-10px) rotateX(4deg) rotateY(2deg); }
.card::after { content: none; }
.card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; font-weight: 600; }
.card p { font-size: 0.95rem; line-height: 1.55; color: #d4d4d8; }

/* Optional thumbnail on cards */
.card-thumb { width: 100%; height: 160px; border-radius: 1rem; object-fit: cover; margin-bottom: 1rem; background: #202324; }

/* ===== Modal ===== */
#project-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; z-index: 999; }
#project-modal.active { pointer-events: all; }
.modal-content { background: #202324; border-radius: 1.5rem; max-width: 48rem; width: 90%; padding: 2.5rem; position: relative; }
.modal-content img { width: 100%; border-radius: 0.75rem; margin-bottom: 1.5rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; font-size: 1.25rem; background: none; border: none; color: #e8e6e3; cursor: pointer; }
.modal-close:hover { color: var(--grad-0); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #181a1b; }
::-webkit-scrollbar-thumb { background: var(--grad-0); border-radius: 999px; }

/* ===== Category Pills ===== */
#category-nav, #subcategory-nav, #index-category-links { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 1.25rem 0 2rem; }
#subcategory-nav { margin-top: -0.5rem; opacity: 0.95; }
.pill { appearance: none; border: none; cursor: pointer; padding: 0.55rem 0.95rem; border-radius: 999px; background: #202324; color: #e8e6e3; font-weight: 600; transition: transform 0.2s ease, background 0.3s ease, color 0.3s ease; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.pill:hover { transform: translateY(-2px); }
.pill.active { background: var(--grad-0); color: #181a1b; box-shadow: none; }
.pill.sub { font-weight: 500; opacity: 0.9; }

/* ===== Contact ===== */
#contact .contact-card { background: #202324; border-radius: 1rem; padding: 1.25rem 1.5rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
#contact a { color: var(--grad-0); text-decoration: none; }
#contact a:hover { text-decoration: underline; }
