/* ==========================================================================
   Mahmoud Aladin Portfolio
   --------------------------------------------------------------------------
   Sections
   01. Base reset & design tokens
   02. Global overlays & motion
   03. Controls (buttons, nav, toggles)
   04. Layout sections (hero, stats, about, etc.)
   05. Interactive components (projects, cmdk)
   06. Utilities & responsive tweaks
   ========================================================================== */

/* 01. Base reset & design tokens */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root{
  --bg:#000000;
  --text:#ffffff;
  --text-dim:#9a9a9a;
  --text-faint:#6f6f6f;
  --accent:#00f0ff;
  --accent-2:#ff00ff;
  --accent-3:#00ff88;
  --border:rgba(255,255,255,.10);
  --glass:rgba(255,255,255,.04);
  --glass-2:rgba(0,240,255,.08);
  --shadow: 0 24px 80px rgba(0,0,0,.55);
  --shadow-soft: 0 18px 60px rgba(0, 240, 255, .12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1600px;
}

html{ scroll-behavior: auto; }
body{
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
  line-height:1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection{ background: var(--accent); color: var(--bg); }

/* 02. Global overlays & motion */
/* Subtle grain + vignette */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  z-index:2;
  opacity:.14;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(1200px 800px at 50% 15%, rgba(0,240,255,.10), transparent 55%),
    radial-gradient(900px 700px at 10% 70%, rgba(255,0,255,.09), transparent 50%),
    radial-gradient(900px 700px at 90% 75%, rgba(0,255,136,.07), transparent 52%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  background-size: cover, cover, cover, 260px 260px;
}
body::after{
  content:"";
  position:fixed; inset:-10px;
  pointer-events:none;
  z-index:1;
  background:
    radial-gradient(1000px 600px at 50% 0%, rgba(0,0,0,.0), rgba(0,0,0,.70)),
    radial-gradient(900px 900px at 50% 50%, rgba(0,0,0,.0), rgba(0,0,0,.75));
}

/* 3D Canvas Background */
#canvas3d{ position:fixed; inset:0; width:100%; height:100%; z-index:0; }

/* Mouse spotlight */
.spotlight{
  position:fixed;
  inset:0;
  z-index:3;
  pointer-events:none;
  background: radial-gradient(600px 600px at var(--mx,50%) var(--my,50%), rgba(0,240,255,.10), transparent 60%);
  mix-blend-mode: screen;
  opacity:.75;
  transition: opacity .3s ease;
}

/* Watermarks */
.watermark{
  position:fixed;
  z-index:2;
  pointer-events:none;
  user-select:none;
  font-family:'Syne',sans-serif;
  font-weight:800;
  color: rgba(255,255,255,.06);
  mix-blend-mode: soft-light;
  letter-spacing: 10px;
  line-height: 1.02;
}
.wm-a{
  left: clamp(18px, 6vw, 86px);
  bottom: clamp(36px, 14vh, 180px);
  font-size: clamp(36px, 11vw, 132px);
  transform: rotate(-6deg);
}
.wm-b{
  right: clamp(12px, 5vw, 72px);
  top: clamp(78px, 16vh, 210px);
  font-size: clamp(16px, 3.3vw, 34px);
  letter-spacing: 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: translateY(-8px);
}

.gradient-text{
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift{
  0%,100%{ background-position:0% 50%; }
  50%{ background-position:100% 50%; }
}
/* 03. Controls & chrome */
/* Buttons + magnetic */
.btn{
  padding: 16px 26px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, background .35s ease, border-color .35s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  will-change: transform;
}
.btn span{ position:relative; z-index: 1; }
.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--bg);
  box-shadow: 0 16px 60px rgba(0,240,255,.25);
}
.btn-primary::before{
  content:"";
  position:absolute; inset:-40%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  opacity:0;
  transform: rotate(8deg);
  transition: opacity .45s ease;
}
.btn-primary:hover{ transform: translateY(-4px); box-shadow: 0 26px 80px rgba(0,240,255,.35); }
.btn-primary:hover::before{ opacity:.9; }
.btn-secondary{
  background: rgba(255,255,255,.03);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover{
  transform: translateY(-4px);
  border-color: rgba(0,240,255,.45);
  box-shadow: var(--shadow-soft);
  background: rgba(0,240,255,.06);
}
/* Nav */
nav{
  position:fixed; top: 0; left: 0; right: 0;
  display:flex; justify-content:space-between; align-items:center;
  z-index: 1000;
  padding: 18px 26px;
  border-radius: 0 0 30px 30px;
  border: 1px solid transparent;
  background: rgba(0,0,0,0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), background .5s ease, border-color .5s ease, backdrop-filter .5s ease, box-shadow .5s ease;
}
nav.scrolled{
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 44px rgba(0,0,0,.30);
}
.logo{
  font-family:'Syne',sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  white-space:nowrap;
}
.nav-left{ display:flex; align-items:center; gap:14px; }
.nav-menu{ display:flex; gap: 22px; list-style:none; align-items:center; }
.nav-menu a{
  color: rgba(255,255,255,.78);
  text-decoration:none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-radius: 999px;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.nav-menu a:hover{
  background: rgba(255,255,255,.06);
  color: var(--text);
  transform: translateY(-1px);
}
.nav-right{ display:none; align-items:center; gap:10px; }
.icon-btn{
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.92);
  display:grid; place-items:center;
  cursor:pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.icon-btn:hover{ transform: translateY(-2px); border-color: rgba(0,240,255,.4); background: rgba(0,240,255,.06); }
.icon{
  width:18px; height:18px;
  display:block;
}

@media (min-width: 1201px){
  html{
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  body::-webkit-scrollbar{
    width: 0;
    height: 0;
  }
}

/* 04. Layout sections */
/* Hero */
.hero{
  min-height: 100svh;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  padding: 120px 22px 80px;
  z-index: 5;
}
.hero-content{
  text-align:center;
  max-width: var(--max);
  width:100%;
  padding: 0 22px;
  position:relative;
  z-index: 10;
}
.hero-tag{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 18px;
  background: rgba(0, 240, 255, 0.09);
  border: 1px solid rgba(0,240,255,.28);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
  opacity:0;
  transform: translateY(12px);
  animation: fadeInUp 1s ease .25s forwards;
}
.hero-tag .dot{
  width: 8px; height:8px; border-radius:99px;
  background: var(--accent-3);
  box-shadow: 0 0 18px rgba(0,255,136,.55);
}
.hero-title{
  font-family:'Syne',sans-serif;
  font-size: clamp(48px, 9.2vw, 160px);
  font-weight: 800;
  letter-spacing: -2.8px;
  line-height: .82;
  margin-bottom: 14px;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  max-inline-size: 100%;
  opacity:0;
  transform: translateY(18px);
  animation: fadeInUp 1s ease .4s forwards;
}
.hero-title-no-break{
  white-space: nowrap;
}
.hero-subtitle{
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 350;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto 36px;
  opacity:0;
  transform: translateY(18px);
  animation: fadeInUp 1s ease .55s forwards;
}
.hero-subtitle-mobile{ display:none; }
.hero-cta{
  display:flex;
  justify-content:center;
  gap: 14px;
  flex-wrap: wrap;
  opacity:0;
  transform: translateY(18px);
  animation: fadeInUp 1s ease .7s forwards;
}
.hero-cta .btn{
  min-width: 190px;
}

/* Floating blobs */
.floating-shape{
  position:absolute;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0,240,255,0.12), rgba(255,0,255,0.10));
  filter: blur(44px);
  animation: float 18s ease-in-out infinite;
  z-index: 4;
  opacity: .9;
}
.shape-1{ width: 420px; height: 420px; top: 8%; right: 9%; }
.shape-2{ width: 340px; height: 340px; bottom: 16%; left: 10%; animation-delay: -7s; }
.shape-3{ width: 260px; height: 260px; top: 54%; left: 44%; animation-delay: -12s; }
@keyframes float{
  0%,100%{ transform: translate(0,0) rotate(0deg); }
  33%{ transform: translate(56px,-52px) rotate(120deg); }
  66%{ transform: translate(-52px,52px) rotate(240deg); }
}
@keyframes fadeInUp{
  to{ opacity:1; transform: translateY(0); }
}

/* Sections */
section{
  position:relative;
  z-index: 6;
  padding: 140px 22px;
}
.container{ max-width: var(--max); margin: 0 auto; }
.section-header{ text-align:center; margin-bottom: 80px; }
.section-number{
  font-family:'Syne',sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 18px;
  text-transform: uppercase;
}
.section-title{
  font-family:'Syne',sans-serif;
  font-size: clamp(44px, 6.8vw, 120px);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -2px;
  margin-bottom: 16px;
}
.section-subtitle{
  font-size: 18px;
  color: var(--text-dim);
  max-width: 70ch;
  margin: 0 auto;
  line-height: 1.8;
}

/* Stats (bigger, more flex) */
.stats-container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  position:relative;
  z-index: 6;
  transform: translateY(-54px);
}
.stat-card{
  position:relative;
  overflow:hidden;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(18px) saturate(160%);
  padding: 34px 22px;
  text-align:left;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .45s ease, box-shadow .45s ease;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap: 12px;
  min-height: 190px;
}
.stat-card::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(500px 260px at 30% 10%, rgba(0,240,255,.15), transparent 60%),
              radial-gradient(500px 260px at 70% 95%, rgba(255,0,255,.12), transparent 60%);
  opacity:0;
  transition: opacity .45s ease;
  pointer-events:none;
}
.stat-card:hover{ transform: translateY(-10px); border-color: rgba(0,240,255,.35); box-shadow: var(--shadow); }
.stat-card:hover::before{ opacity:1; }
.stat-number{
  font-family:'Syne',sans-serif;
  font-size: clamp(44px, 5.2vw, 62px);
  line-height: 1;
  letter-spacing:-1px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  display:block;
  margin-bottom: 10px;
}
.stat-word{
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -1.2px;
  line-height: 1.05;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.stat-label{
  font-size: 12px;
  color: rgba(255,255,255,.78);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  margin-top:auto;
}

/* About */
.about-grid{
  display:grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 70px;
  align-items:start;
}
.about-text{
  font-size: 20px;
  line-height: 1.9;
  color: var(--text-dim);
}
.about-text p{ margin-bottom: 22px; }
.highlight{
  color: var(--text);
  font-weight: 750;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}
.skills-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.skill-card{
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(18px);
  padding: 18px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease, background .35s ease;
  position:relative;
  overflow:hidden;
}
.skill-card::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity:.0;
  transition: opacity .35s ease;
}
.skill-card:hover{
  transform: translateY(-6px);
  border-color: rgba(0,240,255,.35);
  background: rgba(0,240,255,.05);
}
.skill-card:hover::before{ opacity: 1; }
.skill-name{ font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.skill-level{ font-size: 12px; color: var(--text-dim); letter-spacing:.5px; }


/* Approach */
.approach{
  padding: 110px 0;
  position:relative;
  z-index: 5;
}
.approach-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.approach-card{
  grid-column: span 6;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 26px;
  position:relative;
  overflow:hidden;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.approach-card:before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(380px 220px at 20% 0%, rgba(0,240,255,.12), transparent 60%),
          radial-gradient(380px 220px at 80% 100%, rgba(187,0,255,.10), transparent 60%);
  opacity:0;
  transition: opacity .25s ease;
}
.approach-card:hover{
  transform: translateY(-6px);
  border-color: rgba(0,240,255,.22);
  background: rgba(255,255,255,.06);
}
.approach-card:hover:before{ opacity:1; }
.approach-icon{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,240,255,.10);
  border: 1px solid rgba(0,240,255,.18);
  margin-bottom: 14px;
  position:relative;
  z-index:1;
  font-size: 20px;
}
.approach-title{
  font-family:'Syne',sans-serif;
  font-size: 22px;
  margin-bottom: 10px;
  position:relative;
  z-index:1;
}
.approach-text{
  color: rgba(255,255,255,.74);
  line-height: 1.6;
  position:relative;
  z-index:1;
}
@media (max-width: 820px){
  .approach{ padding: 90px 0; }
  .approach-card{ grid-column: span 12; }
}
/* Experience timeline */
.experience-container{ max-width: 1400px; margin:0 auto; }
.timeline{ position:relative; padding-left: 58px; }
.timeline::before{
  content:""; position:absolute; left: 14px; top:0; bottom:0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(0,240,255,.9), rgba(255,0,255,.85), transparent);
  opacity: .65;
}
.timeline-item{ margin-bottom: 38px; opacity:0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.timeline-item.visible{ opacity:1; transform: translateY(0); }
.timeline-item::before{
  content:""; position:absolute; left: 8px; margin-top: 22px;
  width: 14px; height: 14px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(0,240,255,.15), 0 0 26px rgba(0,240,255,.7);
}
.experience-card{
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(18px) saturate(150%);
  padding: 34px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .4s ease, box-shadow .4s ease;
}
.experience-card:hover{ transform: translateY(-8px); border-color: rgba(0,240,255,.35); box-shadow: var(--shadow-soft); }
.experience-header{ display:flex; justify-content:space-between; align-items:baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.experience-title{ font-family:'Syne',sans-serif; font-size: 34px; font-weight: 800; letter-spacing:-.8px; }
.experience-date{ font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: 2.2px; text-transform: uppercase; }
.experience-company{ color: var(--text-dim); margin-bottom: 18px; }
.experience-description ul{ list-style:none; }
.experience-description li{
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-left: 26px;
  position:relative;
  line-height: 1.75;
  font-size: 15px;
}
.experience-description li::before{
  content:"▸";
  position:absolute;
  left: 0;
  color: var(--accent);
}

/* Projects — bento grid */
.projects-toolbar{
  display:flex;
  gap: 10px;
  justify-content:center;
  flex-wrap:wrap;
  margin: 30px auto 0;
  max-width: 980px;
}
.chip{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.82);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 800;
  cursor:pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.chip:hover{ transform: translateY(-2px); border-color: rgba(0,240,255,.32); background: rgba(0,240,255,.06); }
.chip.active{ border-color: rgba(0,240,255,.55); background: rgba(0,240,255,.09); color: var(--text); }

.projects-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  max-width: var(--max);
  margin: 60px auto 0;
}

/* Featured work: consistent card sizing */
#projects .projects-grid:not(#repoGrid){
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 34px;
}
#projects .projects-grid:not(#repoGrid) .project-card{
  grid-column: auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 56px rgba(0,0,0,.45);
  backdrop-filter: blur(18px) saturate(150%);
  gap: 18px;
  overflow: visible;
  cursor: default;
  transform-style: preserve-3d;
  transform-origin: center bottom;
  transform: translateY(26px) perspective(1200px) rotateX(0deg);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1), border-color .35s ease, box-shadow .35s ease;
}
#projects .projects-grid:not(#repoGrid) .project-card.visible{
  transform: translateY(0) perspective(1200px) rotateX(0deg);
}
#projects .projects-grid:not(#repoGrid) .project-card:hover{
  transform: translateY(-8px) perspective(1200px) rotateX(8deg);
  border-color: rgba(0,240,255,.36);
  box-shadow: var(--shadow-soft);
}
#projects .projects-grid:not(#repoGrid) .project-card::before{
  display: none;
}
#projects .projects-grid:not(#repoGrid) .project-preview{
  position: relative;
  min-height: clamp(210px, 26vw, 320px);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
  background:
    radial-gradient(460px 240px at 25% 15%, rgba(0,240,255,.18), transparent 60%),
    radial-gradient(460px 240px at 85% 85%, rgba(255,0,255,.14), transparent 60%),
    rgba(0,0,0,.26);
}
#projects .projects-grid:not(#repoGrid) .project-preview img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#projects .projects-grid:not(#repoGrid) .project-preview.project-preview-placeholder{
  display: grid;
  place-items: center;
}
#projects .projects-grid:not(#repoGrid) .project-preview.project-preview-placeholder span{
  font-family: 'Syne', sans-serif;
  font-size: clamp(20px, 2.1vw, 30px);
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.9);
  text-align: center;
  text-transform: uppercase;
}
#projects .projects-grid:not(#repoGrid) .project-title{
  margin: 0;
  font-family: 'Syne',sans-serif;
  font-size: clamp(32px, 3.1vw, 52px);
  line-height: .98;
  letter-spacing: -.8px;
  max-width: 18ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#projects .projects-grid:not(#repoGrid) .project-description{
  margin: 0;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.62;
  color: rgba(255,255,255,.74);
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#projects .projects-grid:not(#repoGrid) .project-tech{
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#projects .projects-grid:not(#repoGrid) .tech-tag{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.92);
  font-size: 14px;
  letter-spacing: -.3px;
  text-transform: uppercase;
  font-weight: 800;
}
#projects .projects-grid:not(#repoGrid) .tech-icon{
  width: 22px;
  height: 22px;
  display: block;
}
#projects .projects-grid:not(#repoGrid) .project-cta,
#projects .projects-grid:not(#repoGrid) .project-top{
  display: none;
}
@media (max-width: 860px){
  #projects .projects-grid:not(#repoGrid){
    grid-template-columns: 1fr;
    gap: 24px;
  }
  #projects .projects-grid:not(#repoGrid) .project-card{
    min-height: 0;
    padding: 18px;
    border-radius: 24px;
  }
  #projects .projects-grid:not(#repoGrid) .project-title{
    white-space: normal;
  }
  #projects .projects-grid:not(#repoGrid) .project-description{
    font-size: 13px;
    line-height: 1.55;
  }
  #projects .projects-grid:not(#repoGrid) .tech-tag{
    width: 44px;
    height: 44px;
    font-size: 12px;
  }
  #projects .projects-grid:not(#repoGrid) .tech-icon{
    width: 18px;
    height: 18px;
  }
}

/* GitHub repo grid: responsive cards (no slices) */
#repoGrid{
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
#repoGrid .project-card{
  grid-column: auto !important;
}
.project-card{
  grid-column: span 4;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(18px) saturate(150%);
  overflow:hidden;
  position:relative;
  padding: 22px;
  opacity:0;
  transform: translateY(26px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1), border-color .35s ease, box-shadow .35s ease;
  cursor:pointer;
  min-height: 240px;
}
.project-card.visible{ opacity:1; transform: translateY(0); }
.project-card:hover{ border-color: rgba(0,240,255,.36); box-shadow: var(--shadow-soft); transform: translateY(-6px); }
.project-card::before{
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(420px 260px at 20% 10%, rgba(0,240,255,.18), transparent 60%),
    radial-gradient(420px 260px at 90% 80%, rgba(255,0,255,.14), transparent 60%);
  opacity:.85;
  pointer-events:none;
  transition: opacity .35s ease;
  mix-blend-mode: screen;
}
.project-card:hover::before{ opacity: 1; }
.project-top{
  display:flex; align-items:center; justify-content:space-between; gap: 10px;
  position:relative; z-index: 1;
  margin-bottom: 18px;
}
.project-icon{
  width: 46px; height:46px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 20px;
}
.project-badge{
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 900;
  color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(0,0,0,.30);
}
.project-title{
  font-family:'Syne',sans-serif;
  font-size: 24px;
  letter-spacing: -.6px;
  line-height: 1.15;
  margin-bottom: 10px;
  position:relative;
  z-index:1;
}
.project-description{
  font-size: 13px;
  color: rgba(255,255,255,.74);
  line-height: 1.75;
  position:relative;
  z-index:1;
  margin-bottom: 14px;
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-tech{ display:flex; flex-wrap:wrap; gap: 8px; position:relative; z-index: 1; }
.tech-tag{
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,240,255,.08);
  border: 1px solid rgba(0,240,255,.18);
  color: var(--accent);
  letter-spacing: .9px;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}
.project-cta{
  margin-top: 16px;
  position:relative; z-index: 1;
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 800;
}
.project-cta span:last-child{
  color: var(--accent);
}

/* GitHub repo grid (auto loaded) */
.repo-status{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 10px;
  text-align:center;
  color: rgba(255,255,255,.62);
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-size: 11px;
}
.repo-card{
  min-height: 220px;
}
.repo-meta{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  margin-top: 10px;
  position:relative;
  z-index:1;
}
.repo-pill{
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.26);
  color: rgba(255,255,255,.78);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}

/* Bento sizing */
.span-6{ grid-column: span 6; min-height: 290px; }
.span-8{ grid-column: span 8; min-height: 310px; }
.span-4{ grid-column: span 4; }

/* Contact */
.contact{
  min-height: 92vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding-bottom: 110px;
}
.contact-content{ text-align:center; max-width: 1000px; }
.contact-title{
  font-family:'Syne',sans-serif;
  font-size: clamp(56px, 9vw, 140px);
  line-height: .9;
  letter-spacing: -3px;
  margin-bottom: 18px;
}
.contact-subtitle{
  font-size: 20px;
  color: var(--text-dim);
  margin-bottom: 34px;
  line-height: 1.8;
}
.contact-email{
  display:inline-block;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 750;
  color: var(--text);
  text-decoration:none;
  padding: 16px 0;
  margin-bottom: 30px;
  position:relative;
}
.contact-email::after{
  content:"";
  position:absolute; left:0; bottom:0;
  width:0; height:3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.contact-email:hover::after{ width:100%; }
.social-links{ display:flex; gap: 12px; justify-content:center; flex-wrap:wrap; }
.social-link{
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 900;
  padding: 16px 22px;
  min-width: 170px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease, background .3s ease, color .3s ease;
}
.social-link:hover{
  transform: translateY(-4px);
  border-color: rgba(0,240,255,.35);
  background: linear-gradient(135deg, rgba(0,240,255,.22), rgba(255,0,255,.18));
}

/* Footer */
footer{
  padding: 70px 22px 34px;
  border-top: 1px solid rgba(255,255,255,.10);
  position:relative;
  z-index: 6;
}
.footer-content{
  max-width: var(--max);
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-text{ font-size: 12px; color: var(--text-dim); letter-spacing: .4px; }

/* Command palette */
.cmdk{
  position:fixed;
  inset:0;
  z-index: 12000;
  display:none;
  align-items:center;
  justify-content:center;
  padding: 24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(16px);
}
.cmdk.show{ display:flex; }
.cmdk-panel{
  width:min(780px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.cmdk-list{ padding: 14px; display:grid; gap: 8px; max-height: 420px; overflow:auto; }
.cmdk-item{
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
  gap: 12px;
}
.cmdk-item:hover{
  transform: translateY(-2px);
  border-color: rgba(0,240,255,.34);
  background: rgba(0,240,255,.06);
}
.cmdk-item strong{ font-size: 13px; letter-spacing:.2px; }
.cmdk-item small{ color: rgba(255,255,255,.55); font-weight: 700; letter-spacing:1px; text-transform:uppercase; font-size: 10px; }

/* Reveal */
.reveal{ opacity:0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.active{ opacity:1; transform: translateY(0); }

/* Accessibility */
:focus-visible{ outline: 2px solid rgba(0,240,255,.7); outline-offset: 3px; border-radius: 12px; }

/* Responsive */
@media (max-width: 1200px){
  .stats-container{ grid-template-columns: repeat(2, 1fr); transform: translateY(-44px); }
  .about-grid{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: repeat(2, 1fr); }
  .projects-grid{ grid-template-columns: repeat(12, 1fr); }
  .span-8, .span-6, .span-4{ grid-column: span 6; }
}
@media (max-width: 820px){
  nav{ top: 0; left: 0; right: 0; padding: 12px 14px; border-radius: 0 0 22px 22px; }
  .logo{ font-size: 14px; letter-spacing: 1px; }
  .nav-menu{ display:none; }
  .nav-right{ display:flex; }
  .cmdk{ align-items:flex-start; padding: 86px 14px 20px; }
  .cmdk-panel{ width:min(420px, 100%); }
  .hero{ padding: 92px 10px 44px; min-height: 100svh; }
  .hero-content{
    padding: 0 4px;
    max-width: min(100%, 96vw);
  }
  .hero-title{
    font-size: clamp(28px, 10.2vw, 42px);
    letter-spacing: -0.02em;
    line-height: .92;
    margin-bottom: 10px;
  }
  .hero-title-no-break{ white-space: nowrap; }
  .hero-tag{
    display:block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 18px;
    font-size: 10px;
    letter-spacing: 1.7px;
    line-height: 1.45;
    text-wrap: balance;
    white-space: normal;
    padding: 10px 14px;
  }
  .hero-subtitle-desktop{ display:none; }
  .hero-subtitle-mobile{ display:inline; }
  .hero-subtitle{
    font-size: clamp(16px, 5.4vw, 22px);
    line-height: 1.45;
    max-width: 30ch;
    margin: 0 auto 22px;
  }
  .hero-cta{
    width: min(100%, 360px);
    margin: 0 auto;
    gap: 10px;
  }
  .hero-cta .btn{
    min-width: 0;
    width: 100%;
  }
  .timeline{ padding-left: 0; }
  .timeline::before,
  .timeline-item::before{ display:none; }
  .stats-container{ grid-template-columns: 1fr; transform: translateY(-34px); }
  .skills-grid{ grid-template-columns: 1fr; }
  .projects-grid{ gap: 12px; }
  .span-8, .span-6, .span-4{ grid-column: span 12; }
  .watermark{ display:none; }
}

@media (max-width: 430px){
  .hero{
    padding-left: 8px;
    padding-right: 8px;
  }
  .hero-content{ padding: 0; }
  .hero-title{
    font-size: clamp(26px, 9.8vw, 36px);
    letter-spacing: -0.015em;
  }
  .hero-tag{
    font-size: 9px;
    letter-spacing: 1.35px;
    padding: 9px 12px;
  }
}

@media (max-height: 500px) and (pointer: coarse){
  .hero{
    padding: 84px 16px 38px;
    min-height: 100svh;
  }
  .hero-content{ max-width: min(100%, 94vw); }
  .hero-title{
    font-size: clamp(24px, 6.2vh, 34px);
    letter-spacing: -0.02em;
    line-height: .92;
  }
  .hero-title-no-break{ white-space: nowrap; }
  .hero-subtitle{
    font-size: clamp(15px, 2.5vw, 20px);
    margin-bottom: 18px;
  }
}

/* Short viewports (laptops/landscape) — keep hero above the fold */
@media (max-height: 760px) and (pointer: fine){
  .hero{ padding-top: 110px; padding-bottom: 62px; }
  .hero-tag{ margin-bottom: 18px; }
  .hero-subtitle{ margin-bottom: 22px; }
  .hero-title{ font-size: clamp(44px, 8.4vw, 132px); margin-bottom: 10px; }
}
@media (max-height: 680px) and (pointer: fine){
  .hero-title{ font-size: clamp(40px, 7.8vw, 120px); }
  .hero-subtitle{ font-size: clamp(16px, 2vw, 22px); }
}
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .spotlight{ display:none; }
}
