/* ============================================================
   PORTFOLIO — Dark minimal theme
   Edit the CSS variables below to change colors, fonts, spacing.
   ============================================================ */

:root {
  --background: #08080a;
  --foreground: #ededf0;
  --card: #101014;
  --muted: #16161b;
  --muted-foreground: #7a7a85;
  --border: #1e1e24;
  --accent: #7c9cff;
  --accent-2: #b58cff;

  --gradient-hero:
    radial-gradient(1000px 500px at 15% -10%, rgba(124, 156, 255, 0.18), transparent 60%),
    radial-gradient(700px 400px at 85% 10%, rgba(181, 140, 255, 0.14), transparent 60%);
  --gradient-accent: linear-gradient(135deg, #7c9cff 0%, #b58cff 100%);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; color-scheme: dark; -webkit-font-smoothing: antialiased; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  position: relative;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ------- Ambient background layers ------- */
.bg-glow {
  position: fixed; inset: 0; z-index: -10;
  background-image: var(--gradient-hero);
  pointer-events: none;
}
.bg-orb {
  position: fixed; top: 0; left: 0; right: 0; height: 520px; z-index: -10;
  background-size: cover; background-position: center top;
  opacity: 0.6; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
}
.shimmer-line {
  position: fixed; top: 0; left: 0; right: 0; height: 1px; z-index: -10;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  opacity: 0.4;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ------- Top bar ------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid rgba(30, 30, 36, 0.6);
  background: rgba(8, 8, 10, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar-inner {
  max-width: 42rem; margin: 0 auto; padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: flex-end;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--muted-foreground);
}
#siteNav { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
#siteNav a { transition: color 0.2s; }
#siteNav a:hover { color: var(--foreground); }

/* ------- Hamburger toggle (hidden on desktop) ------- */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 30px; height: 30px; border: 0; background: none; cursor: pointer;
  z-index: 70; position: relative;
}
.nav-toggle span {
  display: block; width: 100%; height: 1.5px; background: var(--foreground);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(4, 4, 6, 0.6); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

/* ------- Main layout ------- */
main {
  max-width: 42rem; margin: 0 auto;
  padding: 8rem 1.5rem 8rem;
}
@media (min-width: 768px) { main { padding-top: 10rem; } }

.section { margin-top: 7rem; }

.tag {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}
.lede { color: var(--muted-foreground); margin-bottom: 2.5rem; }
.muted { color: var(--muted-foreground); }
.hl { color: var(--foreground); }

/* ------- Hero ------- */
.avatar-wrap {
  position: relative; width: 64px; height: 64px; margin-bottom: 1.5rem;
}
.avatar-glow {
  position: absolute; inset: 0; z-index: -1; border-radius: 999px;
  background: var(--gradient-accent); filter: blur(20px); opacity: 0.6;
}
.avatar {
  width: 100%; height: 100%; border-radius: 999px;
  object-fit: cover; border: 1px solid var(--border);
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.name {
  font-size: 22px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.375rem;
}
.verified {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 9px;
}
.role { color: var(--muted-foreground); margin-top: 0.25rem; }

.intro { margin-top: 2rem; line-height: 1.75; color: var(--muted-foreground); }
.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 500;
}

.copy-cta {
  margin-top: 2rem; display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--muted-foreground); transition: color 0.2s;
}
.copy-cta:hover { color: var(--foreground); }
kbd {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--muted);
  color: var(--foreground); font-size: 11px; font-family: var(--font-mono);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* ------- About ------- */
.about-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--muted-foreground); line-height: 1.75; margin-bottom: 1.1rem; }
.about-text p:last-child { margin-bottom: 0; }

.skill-bars { display: flex; flex-direction: column; gap: 1.35rem; }
.skill-bar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em;
  color: var(--foreground);
}
.skill-bar-head span:last-child { color: var(--muted-foreground); }
.skill-bar-track {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--muted); border: 1px solid var(--border);
}
.skill-bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--gradient-accent);
  transition: width 1.1s cubic-bezier(0.16,1,0.3,1);
}

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ------- Experience ------- */
.exp-list { display: flex; flex-direction: column; gap: 2rem; }
.exp-item { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; }
.exp-period {
  padding-top: 2px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--muted-foreground);
}
.exp-role { font-size: 15px; color: var(--foreground); }
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--border); background: rgba(22, 22, 27, 0.6);
  font-size: 13.5px; font-weight: 500; transition: border-color 0.2s;
}
.exp-item:hover .chip { border-color: rgba(124, 156, 255, 0.4); }
.chip-dot {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--gradient-accent);
}
.exp-blurb { margin-top: 0.5rem; font-size: 14.5px; color: var(--muted-foreground); }

/* ------- Project cards ------- */
.stack-list { display: flex; flex-direction: column; gap: 1rem; }
.stack-card {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.25rem; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(16, 16, 20, 0.6);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.stack-card:hover { border-color: rgba(124, 156, 255, 0.4); background: var(--card); transform: translateY(-2px); }
.stack-glow {
  position: absolute; top: -4rem; right: -4rem;
  width: 10rem; height: 10rem; border-radius: 999px;
  background: var(--gradient-accent); filter: blur(48px);
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.stack-card:hover .stack-glow { opacity: 0.4; }
.stack-badge {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 6px; background: var(--gradient-accent);
  font-family: var(--font-mono); font-size: 11px; color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 156, 255, 0.6);
}
.stack-body { position: relative; z-index: 1; flex: 1; }
.stack-title {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 14.5px; font-weight: 500; color: var(--foreground);
}
.arr { color: var(--muted-foreground); transition: transform 0.2s, color 0.2s; }
.stack-card:hover .arr { transform: translate(2px, -2px); color: var(--accent); }
.stack-desc {
  margin-top: 0.25rem; font-size: 13.5px; color: var(--muted-foreground);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stack-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.85rem; }
.stack-tag {
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: rgba(22, 22, 27, 0.5);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-foreground);
}

/* ------- Tech / skills icons ------- */
.tech-grid {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.tech-icon {
  position: relative; overflow: hidden;
  width: 56px; height: 56px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: rgba(16, 16, 20, 0.6);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.tech-icon:hover {
  border-color: rgba(124, 156, 255, 0.4);
  background: var(--card);
  transform: translateY(-3px);
}
.tech-icon img {
  width: 26px; height: 26px; object-fit: contain;
}

/* ------- Publication ------- */
.pub-card {
  position: relative; overflow: hidden; display: block;
  padding: 1.25rem; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(16, 16, 20, 0.6);
  transition: border-color 0.2s, background 0.2s;
}
.pub-card:hover { border-color: rgba(124, 156, 255, 0.4); background: var(--card); }
.pub-card:hover .arr { transform: translate(2px, -2px); color: var(--accent); }
.pub-title .arr { margin-left: 0.25rem; }
.pub-glow {
  position: absolute; inset: 0;
  background-image: var(--gradient-hero); opacity: 0.2; pointer-events: none;
}
.pub-title { position: relative; font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.pub-meta { position: relative; margin-top: 0.5rem; font-size: 13px; color: var(--muted-foreground); }
.pub-tags { position: relative; display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 1rem; }
.pub-tag {
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: rgba(22, 22, 27, 0.5);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-foreground);
}

/* ------- Blogs ------- */
.write-list { display: flex; flex-direction: column; }
.write-item {
  display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--border);
  transition: color 0.2s;
}
.write-item:first-child { border-top: 0; }
.write-date, .write-len {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--muted-foreground);
}
.write-title { font-size: 14.5px; color: var(--foreground); transition: color 0.2s; }
.write-item:hover .write-title { color: var(--accent); }

/* ------- Contact ------- */
.email-btn {
  position: relative; overflow: hidden;
  margin-top: 1.5rem; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: rgba(22, 22, 27, 0.6);
  color: var(--foreground); font-size: 14px; cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}
.email-btn:hover { border-color: rgba(124, 156, 255, 0.4); }
.email-glow {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s;
  background: var(--gradient-accent); pointer-events: none;
}
.email-btn:hover .email-glow { opacity: 0.2; }
.email-btn > * { position: relative; }

.socials { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.social {
  padding: 6px 12px; border-radius: 6px; font-size: 13.5px;
  border: 1px solid var(--border); background: rgba(16, 16, 20, 0.4);
  transition: border-color 0.2s, background 0.2s;
}
.social:hover { border-color: rgba(124, 156, 255, 0.4); background: var(--card); }

/* ------- Footer ------- */
footer {
  margin-top: 7rem; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--muted-foreground);
}

/* ------- Reveal-on-scroll ------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ------- Section CTA buttons (View GitHub / Read more on Medium) ------- */
.section-cta-wrap { margin-top: 1.25rem; }
.section-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: rgba(22, 22, 27, 0.6);
  font-size: 13.5px; font-family: var(--font-mono); letter-spacing: 0.04em;
  color: var(--foreground); transition: border-color 0.2s, background 0.2s;
}
.section-cta:hover { border-color: rgba(124, 156, 255, 0.4); background: var(--card); }
.section-cta:hover .arr { transform: translate(2px, -2px); color: var(--accent); }

/* ------- Starfield ------- */
#starfield {
  position: fixed; inset: 0; z-index: -9; pointer-events: none;
}

/* ------- Glitch / decrypt intro text ------- */
#glitchName, #glitchRole { display: inline-block; }

/* ------- Mobile nav (hamburger dropdown) ------- */
@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  #siteNav {
    position: fixed; top: 0; right: -85%; height: 100vh; width: 78%; max-width: 300px;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.5rem; padding: 2rem;
    background: var(--card); border-left: 1px solid var(--border);
    z-index: 60; transition: right 0.3s cubic-bezier(0.16,1,0.3,1);
  }
  #siteNav.open { right: 0; }
  #siteNav a { font-size: 13px; }
}

/* ------- Mobile: hero photo + name centered, sections stacked cleanly ------- */
@media (max-width: 640px) {
  #hero {
    display: flex; flex-direction: column; align-items: center; text-align: center;
  }
  #hero .avatar-wrap { margin-left: auto; margin-right: auto; }
  #hero .copy-cta { margin-left: auto; margin-right: auto; }

  main { padding-left: 1.25rem; padding-right: 1.25rem; }
  .about-grid { gap: 2rem; }
  .stack-card { flex-direction: row; align-items: flex-start; }
  .stack-badge { width: 38px; height: 38px; }
}

/* ------- Mobile ------- */
@media (max-width: 520px) {
  .exp-item { grid-template-columns: 90px 1fr; gap: 1rem; }
  .write-item { grid-template-columns: 60px 1fr auto; gap: 0.75rem; }
}