/* =====================
   CSS VARIABLES
===================== */
:root {
  --bg: #020617;
  --card: #0f172a;
  --accent: #38bdf8;
  --text: #e5e7eb;
  --muted: #9ca3af;
}

/* =====================
   BASE RESET (PERF SAFE)
===================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* =====================
   BACKGROUND (GPU SAFE)
===================== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  animation: drift 120s linear infinite;
  will-change: background-position;
}

@keyframes drift {
  to { background-position: 600px 600px; }
}

/* =====================
   NAVIGATION
===================== */
.nav,
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
}

.nav a,
.page-header a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
}

.logo { font-weight: 700; }

/* =====================
   HERO
===================== */
.hero {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  background: linear-gradient(to right, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* HOME PAGE IMAGE */
.home-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-top: 2rem;
}

/* =====================
   BUTTONS
===================== */
.cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .8rem 1.5rem;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #020617;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

/* =====================
   PROJECT CARDS
===================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

.card {
  background: linear-gradient(180deg, var(--card), #020617);
  padding: 2rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform .25s ease;
}

.card:hover {
  transform: translateY(-6px);
}

/* PROJECT CARD IMAGES */
.project-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

/* =====================
   CONTENT PAGES
===================== */
.content {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
}

/* PER-PAGE IMAGE SELECTORS */
.soc-image,
.network-image,
.vuln-image,
.site-image,
.skills-image,
.contact-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 14px;
  margin: 1.5rem 0;
}

/* =====================
   SKILLS
===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 1rem;
  padding: 2rem 0;
}

.skill {
  background: rgba(255,255,255,.05);
  padding: 1.2rem;
  border-radius: 12px;
  text-align: center;
}

/* =====================
   FOOTER
===================== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .9rem;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 768px) {
  .nav,
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards {
    padding: 1rem;
  }
}
