:root{
  --bg: #050814;
  --panel: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.14);
  --text: #e6e9f2;
  --muted: rgba(230,233,242,0.7);
}

*{ box-sizing: border-box; }

html, body { height: 100%; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(76,201,255,0.25), transparent 60%),
    radial-gradient(700px 500px at 85% 10%, rgba(52,211,153,0.20), transparent 60%),
    radial-gradient(700px 500px at 70% 95%, rgba(167,139,250,0.14), transparent 60%),
    linear-gradient(180deg, #04060f, #050814);
  min-height: 100vh;
}

/* NAV */
.topnav{
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
}

.topnav a{
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  margin-right: 16px;
  padding: 8px 10px;
  border-radius: 10px;
  display: inline-block;
}

.topnav a:hover{ background: rgba(255,255,255,0.06); }

.topnav a.active{
  background: rgba(76,201,255,0.12);
  border: 1px solid rgba(76,201,255,0.30);
}

/* HERO */
.hero{
  max-width: 1100px;
  margin: 24px auto 14px;
  padding: 0 18px;
}

.hero h1{
  margin: 0 0 10px;
  font-size: 34px;
  letter-spacing: 0.2px;
}

.hero p{
  margin: 0;
  color: var(--muted);
  max-width: 92ch;
}

/* PAGE LAYOUT: TOC + CONTENT */
.page{
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
  overflow: visible;
}

/* TOC */
.toc{
  position: sticky;
  top: 18px;
  align-self: start;
  height: fit-content;
}

.toc-card{
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  padding: 14px;
  overflow: hidden;
  position: relative;
}

.toc-card:before{
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg,
    rgba(76,201,255,0.30),
    rgba(52,211,153,0.18),
    rgba(167,139,250,0.18)
  );
  filter: blur(18px);
  opacity: 0.22;
  z-index: 0;
}

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

.toc-title{
  margin: 2px 0 10px;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(230,233,242,0.92);
}

.toc-nav{ display: grid; gap: 8px; }

.toc-link{
  display: block;
  text-decoration: none;
  color: rgba(230,233,242,0.9);
  font-size: 13px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.toc-link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(76,201,255,0.22);
}

.toc-link.active{
  background: rgba(76,201,255,0.12);
  border-color: rgba(76,201,255,0.30);
}

.toc-tip{
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(230,233,242,0.65);
}

.toc-top{
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(76,201,255,0.95);
  text-decoration: none;
}

.toc-top:hover{ text-decoration: underline; }

@media (min-width: 981px){
  .toc.force-fixed{
    position: fixed;
    top: 18px;
    width: 280px;
  }
  .page{ grid-template-columns: 280px 1fr; }
}

.projects-grid{ display: grid; gap: 22px; }

/* CARD */
.project-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 18px;
}

.project-card:before{
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg,
    rgba(76,201,255,0.30),
    rgba(52,211,153,0.18),
    rgba(167,139,250,0.18)
  );
  filter: blur(20px);
  opacity: 0.30;
  z-index: 0;
}

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

.project-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.project-card h2{ margin: 0; font-size: 20px; }

.project-card h3{
  margin: 18px 0 8px;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(76,201,255,0.95);
}

.project-card p{ color: var(--muted); margin-top: 12px; }

.project-card ul{
  margin: 8px 0 0 18px;
  padding-right: 8px;
  color: var(--muted);
}

.project-card li{ margin: 6px 0; line-height: 1.65; }

.project-card strong{
  color: rgba(230,233,242,0.92);
  font-weight: 700;
}

.techline{
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  font-size: 13px;
  color: rgba(52,211,153,0.95);
}

/* TAGS */
.tagrow{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tag{
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}

.tag-cloud { border-color: rgba(76,201,255,0.40); background: rgba(76,201,255,0.14); color: rgba(76,201,255,0.95); }
.tag-net   { border-color: rgba(34,211,238,0.40); background: rgba(34,211,238,0.12); color: rgba(34,211,238,0.95); }
.tag-sec   { border-color: rgba(52,211,153,0.40); background: rgba(52,211,153,0.12); color: rgba(52,211,153,0.95); }
.tag-ops   { border-color: rgba(251,191,36,0.45); background: rgba(251,191,36,0.12); color: rgba(251,191,36,0.95); }
.tag-id    { border-color: rgba(167,139,250,0.45); background: rgba(167,139,250,0.12); color: rgba(167,139,250,0.95); }
.tag-ms    { border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.12); color: rgba(147,197,253,1); }
.tag-api   { border-color: rgba(244,63,94,0.45);  background: rgba(244,63,94,0.12);  color: rgba(251,113,133,1); }
.tag-vm    { border-color: rgba(250,204,21,0.45); background: rgba(250,204,21,0.10); color: rgba(250,204,21,0.95); }

@media (max-width: 980px){
  .page{ grid-template-columns: 1fr; }
  .toc{ position: relative; top: auto; }
  .tagrow{ justify-content: flex-start; }
}

@media (max-width: 720px){
  .topnav{ margin-top: 18px; }
  .hero h1{ font-size: 28px; }
}
