:root {
  --bg: #0f1220;
  --panel: #11152b;
  --text: #e8ecff;
  --muted: #b9c0d9;
  --primary: #7aa2ff;
  --ring: rgba(122,162,255,.3);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, #182042 0%, var(--bg) 60%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible { outline: none; box-shadow: 0 0 0 6px var(--ring); border-radius: 8px; }

.container { width: min(1100px, 92%); margin: 0 auto; }

/* ========== Header / Nav ========== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(120%) blur(10px);
  background: rgba(15,18,32,.6);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}

.logo { font-weight: 700; color: var(--text); }
.logo:hover { opacity: .9; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 14px; border-radius: 999px;
  background: var(--primary); color: #0a0e1f; font-weight: 600;
  box-shadow: 0 0 0 0 var(--ring); transition: box-shadow .2s ease, transform .1s ease;
}
.btn:hover { box-shadow: 0 0 0 6px var(--ring); transform: translateY(-1px); }

.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.16);
}
.btn-secondary:hover { box-shadow: 0 0 0 6px var(--ring); border-color: rgba(255,255,255,.28); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: var(--panel); color: var(--text); cursor: pointer;
}
.menu-toggle:active { transform: scale(.98); }

/* ========== Hero ========== */
.hero { padding: 88px 0 44px; }
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1; margin: 0 0 10px;
}
.lead { color: var(--muted); font-size: 1.125rem; margin: 8px 0 22px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ========== Sections / Layout ========== */
.section { padding: 64px 0; }
.section.alt { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)); }

.grid-2 { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1.2fr .8fr; }
}

/* ========== Cards ========== */
.cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.card h3 { margin-top: 0; }
.card .meta { color: var(--muted); font-size: .95rem; margin: 8px 0 10px; }
.card .links { display: flex; gap: 14px; flex-wrap: wrap; }
.card .link { color: var(--primary); }
.card .link:hover { text-decoration: underline; }

/* ========== Footer ========== */
.site-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 60px; padding: 24px 0; color: var(--muted);
  font-size: .95rem;
}

/* ========== Mobile Nav Behavior ========== */
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-toggle { display: inline-grid; place-items: center; }

  /* When toggled open (JS adds .open) */
  .nav.open {
    display: grid;
    position: absolute; top: 58px; right: 4%; left: 4%;
    background: rgba(15,18,32,.98);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; padding: 12px;
    gap: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,.45);
  }
  .nav.open a { padding: 10px 12px; border-radius: 10px; }
  .nav.open a:hover { background: rgba(255,255,255,.04); color: var(--text); }
}

/* ========== Subtle Improvements ========== */
.section h2 { margin: 0 0 12px; font-size: clamp(22px, 3vw, 30px); }
p { margin: 0 0 12px; }
ul { margin: 0; padding-left: 18px; }
li { margin: 6px 0; }

::selection { background: rgba(122,162,255,.28); color: var(--text); }

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

/* underline any link styled as .link */
.link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px; /* slightly lower underline for modern look */
  text-decoration-thickness: 1.5px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

/* hover effect for emphasis */
.link:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* optionally: only underline links that open in a new tab */
a[target="_blank"] {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}

/* profile picture */
.profile-pic {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  margin-bottom: 20px;
}

/* interactive project cards */
.card {
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 15px rgba(122,162,255,0.5);
}
.card:hover .meta {
  opacity: 1;
  transform: translateY(0);
}
.card .meta {
  opacity: 0;
  transform: translateY(10px);
  transition: all .3s ease;
}

/* === HERO VISIBILITY FIX === */
/* Adds a subtle dark gradient overlay + soft text shadow for legibility */

.hero {
  position: relative;
  padding: 100px 0 60px; /* slightly more breathing room */
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* gentle radial fade behind the text */
  background: radial-gradient(
    circle at center,
    rgba(15, 18, 32, 0.25) 0%,    /* faint center glow */
    rgba(15, 18, 32, 0.8) 70%     /* darker edges */
  );
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1; /* ensures text sits above the overlay */
  text-align: center;
}

/* improve readability */
.hero h1,
.hero .lead {
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.8),
    0 0 14px rgba(15, 18, 32, 0.8);
}

/* optional: smooth fade for the overlay when loading */
.hero::before {
  opacity: 0;
  animation: fadeInOverlay 1.5s ease forwards;
}

@keyframes fadeInOverlay {
  to { opacity: 1; }
}

/* === HERO IMAGE GLOW === */
/* Adds a soft animated blue halo around your portrait */

.hero img {
  display: block;
  margin: 0 auto 24px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.08),
    0 0 30px rgba(122,162,255,0.4);
  transition: box-shadow 0.4s ease;
  position: relative;
  z-index: 1;
}


@keyframes glowPulse {
  0%   { box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 0 30px rgba(122,162,255,0.4); }
  100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.12), 0 0 60px rgba(122,162,255,0.85); }
}


/* ACE node hover description panel */
.node-info{
  margin-top:12px;
  padding:12px 14px;
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  color: var(--text);
  font-size: 0.95rem;
}
.node-info strong{ color: var(--primary); }
svg .node rect{ pointer-events: all; }  /* ensure nodes receive hover */


/* make equal-height cards inside grid-2 sections */
.section .grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: stretch; /* ensures equal height */
}

.section .grid-2 .card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* contact card info */
.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}
.contact-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 0 12px rgba(122,162,255,0.2);
  color: var(--primary);
}
.contact-card .icon {
  width: 22px;
  height: 22px;
  filter: invert(80%) brightness(150%);
}
