/* ============================================================
   Gaurav Ahire — Portfolio
   Aesthetic: dark / terminal-inspired / refined infosec
   ============================================================ */

:root {
  --bg: #0a0e0c;
  --bg-2: #0f1411;
  --bg-3: #141a17;
  --surface: #161c19;
  --border: #1f2924;
  --border-strong: #2a3631;
  --text: #d8e0dc;
  --text-dim: #8a948f;
  --text-faint: #5a635e;
  --accent: #00ff9c;
  --accent-dim: #00cc7d;
  --accent-glow: rgba(0, 255, 156, 0.15);
  --danger: #ff4d6d;
  --warn: #ffc857;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1180px;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* ---------- BG TEXTURE ---------- */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.015) 0,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--pad-x);
  background: rgba(10, 14, 12, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo-bracket { color: var(--accent); }
.logo-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.nav-links a {
  color: var(--text-dim);
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 22px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(7rem, 14vh, 10rem) var(--pad-x) clamp(4rem, 8vh, 7rem);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  width: fit-content;
  animation: fade-up 0.7s ease both;
}
.hero-meta-sep { color: var(--text-faint); }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.75rem, 8vw, 5.75rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.hero-title-line {
  display: block;
  animation: fade-up 0.7s ease both;
}
.hero-title-line:nth-child(2) { animation-delay: 0.15s; }
.hero-title-line.accent { color: var(--accent); }
.hero-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  line-height: 1.9;
  animation: fade-up 0.7s 0.3s ease both;
}
.tag { color: var(--text); }
.tag-sep { color: var(--accent); margin: 0 0.4rem; }

.hero-desc {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: var(--text-dim);
  margin-bottom: 2.25rem;
  max-width: 38rem;
  animation: fade-up 0.7s 0.45s ease both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  animation: fade-up 0.7s 0.6s ease both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-prompt { font-weight: 700; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* terminal */
.hero-terminal {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 255, 156, 0.04);
  animation: fade-up 0.9s 0.4s ease both;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.95rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.term-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 0.74rem;
  color: var(--text-faint);
}
.term-body {
  padding: 1.1rem 1.2rem 1.4rem;
  line-height: 1.85;
}
.term-line { color: var(--text); }
.term-prompt { color: var(--accent); margin-right: 0.5rem; font-weight: 700; }
.term-out { color: var(--text-dim); padding-left: 1.15rem; }
.term-blink {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

/* ---------- SECTIONS ---------- */
.section {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 8vh, 7rem) var(--pad-x);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
}
.hash { color: var(--accent); font-family: var(--font-mono); font-weight: 400; margin-right: 0.15rem; }

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-text p {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.about-text p:last-child { margin-bottom: 0; }

.about-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.stat {
  padding: 1.4rem 1.4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  transition: all 0.25s ease;
}
.stat:hover {
  border-left-width: 4px;
  transform: translateX(2px);
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-unit { color: var(--accent); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.skill-group {
  padding: 1.5rem 1.4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.25s ease;
}
.skill-group:hover { border-color: var(--border-strong); }
.skill-cat {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--border-strong);
  font-weight: 500;
}
.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.skill-list li {
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  padding-left: 1.1rem;
}
.skill-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem;
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
}
.tools-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-right: 0.5rem;
}
.tool {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  transition: all 0.2s ease;
}
.tool:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- WORK ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.work-card {
  padding: 1.75rem 1.6rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}
.work-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.work-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5);
}
.work-card:hover::before { transform: translateX(100%); }

.work-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.work-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}
.work-tag.pub { color: var(--warn); }
.work-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.work-card p {
  color: var(--text-dim);
  font-size: 0.94rem;
  margin-bottom: 1.1rem;
}
.work-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.work-meta li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-faint);
}
.work-card-feature {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border-color: var(--border-strong);
}
.work-card-feature h3 { color: var(--warn); }

/* ---------- TIMELINE ---------- */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--border) 8%, var(--border) 92%, transparent);
}
.tl-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute;
  left: -1.75rem;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--accent-glow);
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}
.tl-role {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.tl-company {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
}
.tl-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-left: auto;
}
.tl-points {
  list-style: none;
}
.tl-points li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  line-height: 1.6;
}
.tl-points li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
  top: 4px;
}
.tl-award {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 200, 87, 0.05);
  border-left: 2px solid var(--warn);
  border-radius: 3px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.award-icon {
  color: var(--warn);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* ---------- CERTS ---------- */
.certs-wrap {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.col-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}
.col-title-2 { margin-top: 2.5rem; }

.cert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cert-list li {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s ease;
}
.cert-list li:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}
.cert-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.cert-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: 0.2rem;
}

.edu-card {
  padding: 1.5rem 1.4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.edu-degree {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.edu-school {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.edu-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.interest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.interest {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
}

/* ---------- CONTACT ---------- */
.section-contact { padding-bottom: clamp(5rem, 10vh, 8rem); }
.contact-wrap {
  max-width: 720px;
}
.contact-prompt {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  margin-bottom: 1.5rem;
}
.contact-quote { color: var(--accent); }
.contact-text {
  color: var(--text-dim);
  margin-bottom: 2rem;
  font-size: 1.02rem;
  max-width: 36rem;
}
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.25s ease;
}
.contact-list li:hover {
  border-color: var(--accent);
  background: var(--bg-3);
}
.contact-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-all;
}
a.contact-val:hover { color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 1.75rem var(--pad-x);
  background: var(--bg-2);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.heart {
  color: var(--accent);
  animation: blink 1.4s steps(1) infinite;
}
.footer-top { color: var(--text-dim); }
.footer-top:hover { color: var(--accent); }

/* ---------- ANIMATIONS ---------- */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 6rem;
  }
  .about-grid,
  .certs-wrap {
    grid-template-columns: 1fr;
  }
  .tl-period { margin-left: 0; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 60px;
    right: 0;
    left: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .nav-links.open { max-height: 400px; }
  .nav-links li {
    border-bottom: 1px solid var(--border);
  }
  .nav-links a {
    display: block;
    padding: 1rem var(--pad-x);
  }
  .nav-toggle { display: block; }

  .hero-title { font-size: clamp(2.5rem, 12vw, 4rem); }
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
