/* ============================================
   SAUD'S PORTFOLIO — DARK MINIMAL EDITORIAL
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ─── CSS Variables ─────────────────────────── */
:root {
  --bg:           #080808;
  --bg-2:         #0d0d0d;
  --surface:      #111111;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text:         #f0ede8;
  --muted:        #555;
  --accent:       #00e5ff;
  --accent-dim:   rgba(0, 229, 255, 0.12);
  --accent-glow:  rgba(0, 229, 255, 0.25);
  --red:          #ff3c3c;
  --font-display: 'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius:       12px;
  --nav-height:   80px;
}

/* ─── Reset & Base ──────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

/* ─── Custom Cursor ─────────────────────────── */
body::before {
  content: '';
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
  mix-blend-mode: difference;
}

/* ─── Noise Grain Overlay ───────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.35;
}

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ─── Container ─────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Selection ─────────────────────────────── */
::selection {
  background: var(--accent);
  color: #000;
}

/* ════════════════════════════════════════════════
   HEADER — GLASSMORPHISM
   ════════════════════════════════════════════════ */
header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  max-width: 720px;
  min-width: 0;

  /* macOS Dock Glass — dark charcoal translucent */
  background: rgba(28, 28, 30, 0.72);
  backdrop-filter: blur(32px) saturate(200%) brightness(0.9);
  -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(0.9);

  border: 1px solid rgba(255,255,255,0.10);
  border-bottom-color: rgba(255,255,255,0.05);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.06) inset,  /* top highlight */
    0 8px 32px rgba(0,0,0,0.55),
    0 2px 8px  rgba(0,0,0,0.4),
    0 0 0 0.5px rgba(0,0,0,0.6);

  border-radius: 9999px; /* full pill */
  padding: 0 6px;
  height: 52px;

  transition: box-shadow 0.3s ease, background 0.3s ease;
}

header:hover {
  box-shadow:
    0 2px 0 rgba(255,255,255,0.08) inset,
    0 12px 48px rgba(0,0,0,0.65),
    0 4px 12px rgba(0,0,0,0.5),
    0 0 0 0.5px rgba(0,0,0,0.6),
    0 0 24px rgba(0,229,255,0.04);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  gap: 32px;
}

#logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
}

nav ul li a {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

nav ul li a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* ════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

/* Radial glow behind hero text */
#hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0,229,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Grid lines */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

#hero .container {
  position: relative;
  z-index: 1;
}

#hero h1 {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}

#hero h1 span {
  color: var(--accent);
}

#hero h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.08em;
  max-width: 420px;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}



/* ════════════════════════════════════════════════
   SECTIONS — COMMON
   ════════════════════════════════════════════════ */
section {
  padding: 120px 0;
}

section h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 64px;
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ════════════════════════════════════════════════
   ABOUT / EDUCATION
   ════════════════════════════════════════════════ */
#about {
  background: var(--bg);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.about-text p {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 40px;
}

.achievements {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  max-width: 560px;
  transition: border-color 0.3s;
}

.achievements::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.achievements:hover {
  border-color: var(--border-hover);
}

.achievements h3 {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

.achievements ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.achievements ul li {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  padding-left: 18px;
  position: relative;
}

.achievements ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.achievements ul li b {
  color: var(--text);
  font-weight: 600;
}

/* ════════════════════════════════════════════════
   SKILLS
   ════════════════════════════════════════════════ */
#skills {
  background: var(--bg-2);
  position: relative;
}

#skills::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(0,229,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skill-item {
  background: var(--bg-2);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: background 0.3s;
  cursor: default;
}

.skill-item:hover {
  background: var(--surface);
  z-index: 1;
}

.skill-item:hover .skill-accent-dot {
  opacity: 1;
  transform: scale(1);
}

.skill-accent-dot {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.3s;
}

.skill-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(100%) brightness(1.2);
  transition: filter 0.3s;
  margin-bottom: 0;
}

.skill-item:hover img {
  filter: grayscale(0%) brightness(1);
}

.skill-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.skill-item p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.proficient, .skill-item span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,255,0.2);
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
  margin-top: auto;
}

/* ════════════════════════════════════════════════
   PROJECTS
   ════════════════════════════════════════════════ */
#projects {
  background: var(--bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.project-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-dim), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

.project-item:hover {
  border-color: rgba(0,229,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,229,255,0.08);
}

.project-item:hover::before {
  opacity: 1;
}

.project-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(80%) brightness(0.6);
  transition: filter 0.4s;
}

.project-item:hover img {
  filter: grayscale(0%) brightness(0.85);
}

.project-info {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.project-info h3,
.project-info h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}

.project-info p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}

.project-info a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(0,229,255,0.25);
  padding: 8px 16px;
  border-radius: 6px;
  width: fit-content;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  display: inline-block;
  margin-right: 8px;
  margin-top: 4px;
}

.project-info a:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════ */
#contact {
  background: var(--bg-2);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#contact::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(0,229,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}

#contact h2 {
  display: block;
}

#contact h2::after {
  left: 50%;
  transform: translateX(-50%);
}

#contact > .container > p {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 56px;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: 8px;
  background: var(--surface);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-links a:hover {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  text-align: center;
}

footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ════════════════════════════════════════════════
   SECTION ENTRY ANIMATIONS
   ════════════════════════════════════════════════ */
section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}

#hero {
  opacity: 1 !important;
  transform: none !important;
}

/* Staggered skill items on hover-group reveal */
.skill-item {
  animation: none;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  nav ul {
    gap: 2px;
  }
  nav ul li a {
    padding: 6px 10px;
    font-size: 0.68rem;
  }
  #logo {
    font-size: 0.85rem;
  }
  #hero h1 {
    font-size: clamp(3rem, 14vw, 5rem);
  }
  section {
    padding: 80px 0;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }
  nav ul {
    display: none;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════
   CURSOR FOLLOW (JS adds .cursor class to body)
   ════════════════════════════════════════════════ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s, width 0.2s, height 0.2s, opacity 0.2s;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease-out, width 0.25s, height 0.25s, border-color 0.2s;
}
