/* =========================================================
   Anil Ahlawat — Portfolio
   Dark glassmorphism theme
   ========================================================= */

:root {
  --bg: #06070d;
  --bg-alt: #090b14;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.09);
  --text: #eef0f7;
  --text-dim: #9aa1b8;
  --text-faint: #666e88;
  --accent: #7c5cff;
  --accent-2: #35e0c9;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4f8bff 50%, #35e0c9 100%);
  --danger: #ff6b81;
  --success: #35e0c9;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --container: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; color: var(--text-dim); }

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide { max-width: 1400px; }

/* ---------- background glow ---------- */
.bg-glow {
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}
.bg-glow-1 { top: -15%; left: -10%; background: #5b3cff; }
.bg-glow-2 { bottom: -20%; right: -10%; background: #17c9b0; opacity: 0.18; }

/* ---------- glass surface ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
  background: var(--accent-grad);
  color: #07080f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124, 92, 255, 0.35); }
.btn-outline {
  background: transparent;
  border-color: var(--surface-border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(6, 7, 13, 0.75);
  backdrop-filter: blur(16px);
  padding: 12px 0;
  border-color: var(--surface-border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand span { color: var(--accent-2); }

.nav-links {
  display: flex;
  gap: 28px;
  margin: 0 auto;
}
.nav-link {
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--accent-grad);
  transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 90px;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }

.eyebrow {
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.hero-name {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
}
.hero-role {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 600;
  color: var(--text-dim);
  min-height: 2.2em;
}
#typedRole { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cursor { color: var(--accent-2); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { max-width: 560px; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 16px; margin-top: 1.5rem; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--surface-border);
  border-radius: 20px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--accent-2);
  border-radius: 2px;
  animation: scrollcue 1.6s ease infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* =========================================================
   SECTIONS (shared)
   ========================================================= */
.section { position: relative; padding: 120px 0; z-index: 1; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02), transparent); }
.section-tag {
  color: var(--accent-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.section-title { font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 680px; }
.section-sub { max-width: 560px; }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
.about-card { padding: 36px; font-size: 1.02rem; }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.fact { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.fact-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.fact-value { font-weight: 600; word-break: break-word; }
.fact-value a:hover { color: var(--accent-2); }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.skill-card { padding: 26px; transition: transform 0.25s ease, border-color 0.25s ease; }
.skill-card:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, 0.4); }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
  color: #cfc7ff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
}
.chip-sm { font-size: 0.72rem; padding: 4px 10px; }
.chips-tight { margin: 10px 0 14px; }

/* =========================================================
   SERVICES
   ========================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.service-card { padding: 30px; transition: transform 0.25s ease, border-color 0.25s ease; }
.service-card:hover { transform: translateY(-4px); border-color: rgba(53, 224, 201, 0.35); }
.service-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #06070d;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.service-card h3 { font-size: 1.05rem; }
.service-card p { font-size: 0.92rem; margin-bottom: 0; }

/* =========================================================
   PROJECTS CAROUSEL
   ========================================================= */
.empty-state {
  margin-top: 40px;
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state code {
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}
.empty-state a { color: var(--accent-2); font-weight: 600; }

.carousel {
  margin-top: 48px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.carousel-track {
  display: flex;
  gap: 24px;
  width: max-content;
  padding: 4px 24px 20px;
  will-change: transform;
}

.project-card {
  width: 340px;
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.project-card:hover { border-color: rgba(124, 92, 255, 0.4); transform: translateY(-4px); }

.project-thumb {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.04);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-thumb-fallback {
  font-family: 'Sora', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.55;
}
.project-category {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(6,7,13,0.7);
  border: 1px solid var(--surface-border);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-dim);
}
.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.1rem; }
.project-body p { font-size: 0.9rem; margin-bottom: 10px; }
.project-links { margin-top: auto; display: flex; gap: 18px; padding-top: 10px; }
.project-links a { font-size: 0.85rem; font-weight: 600; color: var(--accent-2); }
.project-links a:hover { text-decoration: underline; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  margin-top: 48px;
  align-items: start;
}
.contact-info { padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.contact-item { display: flex; flex-direction: column; gap: 6px; }
.contact-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.contact-item a:hover { color: var(--accent-2); }
.social-links { display: flex; gap: 14px; flex-wrap: wrap; }
.social-links a { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.social-links a:hover { color: var(--accent-2); }

.contact-form { padding: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.optional { color: var(--text-faint); font-weight: 400; }

.field input, .field textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.06);
}

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  font-weight: 500;
}
.form-alert.success { background: rgba(53, 224, 201, 0.12); border: 1px solid rgba(53, 224, 201, 0.35); color: #b7f5ec; }
.form-alert.error { background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.35); color: #ffc4cd; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { padding: 32px 0 48px; position: relative; z-index: 1; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-faint);
  border-top: 1px solid var(--surface-border);
  padding-top: 28px;
}
.footer-admin { color: var(--text-faint); transition: color 0.2s ease; }
.footer-admin:hover { color: var(--accent-2); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .skills-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .navbar.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(6,7,13,0.97);
    border-bottom: 1px solid var(--surface-border);
  }
  .navbar.open .nav-links .nav-link { padding: 16px 24px; border-bottom: 1px solid var(--surface-border); }
  .navbar.open .nav-cta { display: none; }
  .navbar.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .navbar.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 80px 0; }
  .skills-grid, .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .about-facts { grid-template-columns: 1fr; }
  .project-card { width: 280px; }
}
