/* ------------------------------------------------------------------
   raviheer.in — dark developer portfolio
   ------------------------------------------------------------------ */
:root {
  --bg: #f7f9fc;
  --bg-2: #ffffff;
  --bg-3: #eef2f7;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #5b6b7f;
  --accent: #0d9488;
  --accent-2: #4f6df5;
  --accent-3: #d98c00;
  --accent-glow: rgba(13, 148, 136, 0.14);
  --on-accent: #ffffff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 1px 1px, rgba(15,23,42,.10) 1px, transparent 0) 0 0 / 28px 28px,
    linear-gradient(transparent, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
}

/* ---------- animated background layers ---------- */
#bg-canvas {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  mask-image: linear-gradient(#000 60%, transparent);
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
}
.orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.o1 { width: 520px; height: 520px; left: -140px; top: -120px; background: rgba(13,148,136,.28); }
.o2 { width: 460px; height: 460px; right: -120px; top: 60px; background: rgba(79,109,245,.26); animation-duration: 28s; animation-delay: -8s; }
.o3 { width: 380px; height: 380px; left: 40%; top: 55%; background: rgba(217,140,0,.16); animation-duration: 32s; animation-delay: -15s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-40px, 70px) scale(.96); }
}
/* glass effect so content stays readable over the animation */
.card, .stats, .pill, .social a, .btn:not(.primary) { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card, .stats { background: rgba(255,255,255,.82); }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } #bg-canvas { display: none; } }

/* ---------- focus (keyboard) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }
::selection { background: var(--accent); color: var(--on-accent); }

/* scroll progress */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(247,249,252,.8);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font); font-weight: 800; letter-spacing: -.01em; color: var(--text); font-size: 1.15rem; }
.logo img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { color: var(--muted); font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 1.1rem;
}

/* ---------- hero ---------- */
.hero { padding: 96px 0 72px; }
.hero .hero-grid {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 48px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .8rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px 6px 10px; margin-bottom: 22px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--accent-glow); } 50% { box-shadow: 0 0 0 7px transparent; } }
.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { color: var(--muted); font-size: 1.12rem; margin: 20px 0 28px; max-width: 560px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); color: var(--text); background: var(--bg-2);
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 8px 20px rgba(13,148,136,.25); }
.btn.primary:hover { background: #0b857a; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.avatar-wrap { display: flex; justify-content: center; }
.avatar-ring {
  position: relative; padding: 6px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  animation: spin 14s linear infinite;
  box-shadow: 0 24px 50px rgba(15,23,42,.18), 0 0 60px rgba(13,148,136,.15);
}
.avatar-ring::after {
  content: ""; position: absolute; inset: -18px; border-radius: 50%; z-index: -1;
  border: 1px dashed rgba(15,23,42,.15);
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-ring .avatar { animation: spin 14s linear infinite reverse; }
.avatar {
  width: 280px; height: 280px; border-radius: 50%; object-fit: cover; display: block;
  border: 5px solid var(--bg);
}
@media (prefers-reduced-motion: reduce) { .avatar-ring, .avatar-ring .avatar, .pill .dot { animation: none; } }

.stats {
  margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden;
}
.stat { padding: 22px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong {
  display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- social ---------- */
.social { display: flex; gap: 12px; margin-top: 32px; }
.social a {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  transition: color .15s, border-color .15s, transform .15s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
.section-title {
  font-family: var(--mono); color: var(--accent); font-size: .9rem; margin-bottom: 10px;
}
.section-title::before { content: "// "; color: var(--muted); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); letter-spacing: -.02em; margin-bottom: 10px; }
h2::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin-top: 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.sub { color: var(--muted); margin-bottom: 32px; max-width: 800px; font-size: 1.02rem; }
.card {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%, transparent 60%, var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { box-shadow: 0 16px 40px rgba(15,23,42,.10); }

/* about */
.about-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 28px; align-items: stretch; }
.about p + p { margin-top: 14px; }
.facts { display: flex; flex-direction: column; gap: 0; padding: 10px 22px; }
.fact { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); flex: 1; }
.fact:last-child { border-bottom: 0; }
.fact-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.fact-label svg { width: 14px; height: 14px; fill: var(--accent); flex-shrink: 0; }
.fact-value { font-weight: 600; color: var(--text); font-size: .98rem; }
.fact-sep { color: var(--muted); font-weight: 400; margin: 0 2px; }
.fact-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fact-pills span {
  font-size: .8rem; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
}

/* skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.skill-group h3 { font-size: 1.05rem; margin-bottom: 16px; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: .8rem; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
}
.tag.hi { border-color: rgba(13,148,136,.45); color: var(--accent); background: var(--accent-glow); }
.tag { transition: transform .15s; }
.tag:hover { transform: translateY(-2px); }

/* experience / timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--accent), var(--line));
}
.tl-item { position: relative; margin-bottom: 34px; }
.tl-item::after {
  content: ""; position: absolute; left: -26px; top: 30px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.tl-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.badge {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--mono); font-weight: 600; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.tl-item h3 { font-size: 1.2rem; }
.tl-item .meta { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.tl-item ul { padding-left: 18px; color: var(--muted); }
.tl-item li { margin-bottom: 6px; }

/* projects */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project { display: flex; flex-direction: column; gap: 12px; transition: transform .15s, border-color .15s; }
.project:hover { transform: translateY(-3px); border-color: rgba(13,148,136,.5); }
.project .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project h3 { font-size: 1.1rem; }
.project .period { font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: nowrap; }
.project .role { font-size: .85rem; color: #3b55d6; font-family: var(--mono); }
.project p { color: var(--muted); font-size: .95rem; flex: 1; }
.project ul { padding-left: 18px; color: var(--muted); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.chip.dom { color: var(--accent); background: var(--accent-glow); border-color: rgba(13,148,136,.4); }
.chip { font-family: var(--mono); font-size: .72rem; color: #3b55d6; background: rgba(79,109,245,.08); border: 1px solid rgba(79,109,245,.3); border-radius: 999px; padding: 3px 9px; }

/* education */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edu h3 { font-size: 1.05rem; }
.edu .meta { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin: 4px 0 8px; }
.edu .meta a { color: var(--accent); }

/* contact */
.contact .card { text-align: center; padding: 56px 26px; background: linear-gradient(180deg, rgba(238,242,247,.85), rgba(255,255,255,.9)); }
.contact-title { font-size: 1.5rem; margin-bottom: 12px; letter-spacing: -.01em; }
.contact .card p { color: var(--muted); max-width: 540px; margin: 0 auto 24px; }
.contact .social { justify-content: center; margin-top: 0; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .btn-row, .social { justify-content: center; }
  .avatar-wrap { order: -1; }
  .about-grid, .projects-grid, .edu-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .avatar { width: 200px; height: 200px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 24px; border-top: 1px solid var(--line); width: 100%; }
  .nav-toggle { display: block; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  section { padding: 56px 0; }
}
