/* styles.css — Nitin Singh Rathore portfolio
   To retheme: only edit the :root variables below */

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

:root {
  --bg:         #070b14;          /* page background */
  --bg2:        #080e1a;          /* slightly lighter bg for alternating sections */
  --card:       #0c1220;          /* card / panel background */
  --border:     #192233;          /* subtle border colour */
  --border2:    #243348;          /* slightly brighter border on hover */
  --accent:     #9b6dff;          /* primary accent — violet */
  --accent-dim: rgba(155,109,255,.1); /* tinted background for accent elements */
  --green:      #00e676;          /* success / shipped badge colour */
  --green-dim:  rgba(0,230,118,.08);
  --amber:      #ffb74d;          /* hackathon / warning badge colour */
  --amber-dim:  rgba(255,183,77,.08);
  --text:       #d8e4f0;          /* primary text */
  --muted:      #6b7a99;          /* secondary / subdued text */
  --dim:        #3a4560;          /* very quiet text (footer, hints) */
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --sans:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h:      68px;             /* navbar height — used for scroll offset */
  --r:          12px;             /* standard border-radius */
  --r-lg:       18px;             /* larger border-radius for cards */
  --ease:       cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;            /* prevent horizontal scroll on mobile */
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(155,109,255,.24); color: #fff; }

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* --- Layout helpers --- */
.container  { max-width: 1080px; margin: 0 auto; padding: 0 24px; } /* centers content */
.section    { padding: 100px 0; }                                    /* vertical section spacing */
.sec-header { margin-bottom: 56px; }

.overline {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.sec-title {
  font-size: clamp(26px, 4.5vw, 38px); /* fluid: scales between 26–38px */
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -.5px;
}
.sec-sub { color: var(--muted); font-size: 15px; max-width: 480px; }

/* --- Scroll fade-in --- */
.fu {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease), transform .65s var(--ease); /* animates in from below */
}
.fu.vis { opacity: 1; transform: none; }  /* JS adds .vis when element enters viewport */
.d1 { transition-delay: .1s; }            /* stagger delays for grouped elements */
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; }
.d5 { transition-delay: .5s; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .22s var(--ease);
  border: none;
  white-space: nowrap;
  font-family: var(--sans);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #b391ff; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(155,109,255,.32); }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-icon { padding: 11px 15px; background: transparent; border: 1px solid var(--border2); color: var(--muted); border-radius: 8px; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-amber { background: transparent; color: var(--amber); border: 1px solid rgba(255,183,77,.35); }
.btn-amber:hover { background: var(--amber-dim); transform: translateY(-2px); }

.btn-green { background: transparent; color: var(--green); border: 1px solid rgba(0,230,118,.35); }
.btn-green:hover { background: var(--green-dim); transform: translateY(-2px); }

/* --- Tech tags & skill chips --- */
.tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all .2s;
  cursor: default;
}
.tag:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(155,109,255,.34); }

.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: default;
  transition: all .2s;
}
.chip:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(155,109,255,.34); }
.chip.hi    { background: var(--accent-dim); color: var(--accent); border-color: rgba(155,109,255,.3); } /* pre-highlighted chips */

/* --- Navigation --- */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;            /* border appears only after scroll */
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
nav.scrolled {
  background: rgba(7,11,20,.92);                   /* frosted glass effect on scroll */
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: -1px; }
.nav-logo span { color: var(--muted); font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; font-family: var(--mono); transition: color .2s; letter-spacing: .3px; }
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }       /* .active set by JS on scroll */

.nav-cta { padding: 6px 16px !important; border: 1px solid rgba(155,109,255,.42) !important; border-radius: 6px; color: var(--accent) !important; }
.nav-cta:hover { background: var(--accent-dim) !important; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; } /* hidden on desktop */
.hamburger span { display: block; width: 21px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }

.mob-menu { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: rgba(7,11,20,.97); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 20px 24px; flex-direction: column; gap: 0; z-index: 99; }
.mob-menu.open { display: flex; }                   /* toggled by hamburger click */
.mob-menu a { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mob-menu a:last-child { border-bottom: none; }

/* --- Hero --- */
#hero { min-height: 100vh; display: flex; align-items: center; position: relative; overflow: hidden; padding-top: var(--nav-h); }
#hero-canvas { position: absolute; inset: 0; z-index: 0; }  /* canvas sits behind all content */

.grid-overlay {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(155,109,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,109,255,.03) 1px, transparent 1px);
  background-size: 56px 56px;                      /* subtle coordinate-grid texture */
}
.hero-vignette {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 20%, var(--bg) 80%); /* fades canvas edges */
}
.hero-content { position: relative; z-index: 2; padding: 40px 0 100px; }

.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  border: 1px solid rgba(155,109,255,.32); border-radius: 20px; padding: 5px 14px;
  margin-bottom: 30px; letter-spacing: .5px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livepulse 2s ease infinite; }
@keyframes livepulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,230,118,.5); }
  50%      { opacity: .7; box-shadow: 0 0 0 6px rgba(0,230,118,0); } /* expanding ring then fades */
}

.hero-name { font-size: clamp(44px, 8.5vw, 82px); font-weight: 800; color: #fff; line-height: 1.02; letter-spacing: -2.5px; margin-bottom: 6px; }
.hero-name .ac { color: var(--accent); }

.hero-role { font-family: var(--mono); font-size: clamp(13px, 2vw, 16px); color: var(--muted); margin-bottom: 26px; font-weight: 500; }
.hero-role .sep { color: var(--accent); margin: 0 10px; opacity: .5; }

.hero-tagline { font-size: clamp(15px, 1.8vw, 17.5px); color: #8fa0bc; max-width: 560px; line-height: 1.75; margin-bottom: 44px; }
.hero-tagline strong { color: var(--text); font-weight: 600; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 60px; }

.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--border); }
.hstat { display: flex; flex-direction: column; gap: 3px; }
.hstat-n { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1; }
.hstat-l { font-size: 11.5px; color: var(--muted); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; color: var(--dim); z-index: 2;
  animation: bobble 2.2s ease infinite;
}
@keyframes bobble {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }  /* gentle bounce */
}

/* --- Projects --- */
#projects { background: linear-gradient(to bottom, var(--bg), var(--bg2) 50%, var(--bg)); }

.feat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 40px; margin-bottom: 24px; position: relative; overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}
.feat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(155,109,255,.24) 60%, transparent 100%); /* accent top border */
}
.feat-card:hover { border-color: rgba(155,109,255,.45); box-shadow: 0 0 60px rgba(155,109,255,.1); }

.feat-inner { display: grid; grid-template-columns: 1fr 220px; gap: 40px; align-items: start; } /* text | drone diagram */

.pbadge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; margin-bottom: 18px; }
.pb-blue  { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(155,109,255,.28); }
.pb-amber { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(255,183,77,.25); }
.pb-green { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(0,230,118,.25); }

.ptitle { font-size: 21px; font-weight: 700; color: #fff; margin-bottom: 6px; line-height: 1.3; }
.psub   { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 26px; }

.metrics4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; } /* 4 big numbers */
.metric { background: rgba(155,109,255,.05); border: 1px solid rgba(155,109,255,.12); border-radius: 10px; padding: 16px 14px; transition: border-color .2s, background .2s; }
.feat-card:hover .metric { border-color: rgba(155,109,255,.22); background: rgba(155,109,255,.08); } /* brightens on card hover */
.m-num   { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 7px; }
.m-label { font-size: 11px; color: var(--muted); line-height: 1.45; }

.metrics3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 22px; } /* 3 numbers for smaller cards */
.mc   { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 9px; padding: 14px 12px; }
.mc-n { font-family: var(--mono); font-size: 21px; font-weight: 700; line-height: 1; margin-bottom: 5px; }
.mc-l { font-size: 10px; color: var(--muted); line-height: 1.4; }
.mc-n.acc { color: var(--accent); }
.mc-n.amb { color: var(--amber); }
.mc-n.grn { color: var(--green); }

.pdesc         { font-size: 14px; color: var(--muted); line-height: 1.75; margin-bottom: 24px; max-width: 640px; }
.pdesc strong  { color: var(--text); }
.tags          { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.pactions      { display: flex; gap: 10px; align-items: center; }

.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }  /* 2-column card layout */
.proj-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 30px;
  position: relative; overflow: hidden;
  transition: border-color .28s, transform .28s, box-shadow .28s;
}
.proj-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; opacity: 0; transition: opacity .28s; }  /* colour bar hidden until hover */
.proj-card.ca::after { background: linear-gradient(90deg, var(--amber), transparent); }
.proj-card.cg::after { background: linear-gradient(90deg, var(--green), transparent); }
.proj-card:hover       { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(0,0,0,.32); }
.proj-card:hover::after { opacity: 1; }
.proj-card.ca:hover    { border-color: rgba(255,183,77,.45); }
.proj-card.cg:hover    { border-color: rgba(0,230,118,.45); }

.drone-viz     { width: 220px; height: 220px; flex-shrink: 0; }  /* UAV formation SVG container */
.drone-viz svg { width: 100%; height: 100%; }

/* --- About --- */
#about { background: var(--bg); }
.about-grid { display: grid; grid-template-columns: 1fr 280px; gap: 72px; align-items: center; }
.atext p       { color: #8fa0bc; font-size: 16.5px; line-height: 1.82; margin-bottom: 20px; }
.atext p:last-child { margin-bottom: 0; }
.atext strong  { color: var(--text); font-weight: 600; }
.atext .hl     { color: var(--accent); font-weight: 600; }
.astats        { display: flex; flex-direction: column; gap: 14px; }
.astat         { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 22px; transition: border-color .22s; }
.astat:hover   { border-color: rgba(155,109,255,.4); }
.astat-n       { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.astat-l       { font-size: 12.5px; color: var(--muted); }

/* --- Skills --- */
#skills      { background: linear-gradient(to bottom, var(--bg), var(--bg2)); }
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sgroup {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 0;
}
.sgroup-title {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 10px;
}
.sgroup-title i { font-size: 13px; }
.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
}
.chip.hi {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--border);
}

/* --- Experience timeline --- */
#experience { background: var(--bg2); }
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent); /* fading vertical line */
}
.titem             { position: relative; margin-bottom: 46px; }
.titem:last-child  { margin-bottom: 0; }
.tdot              { position: absolute; left: -41px; top: 5px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--accent); transition: background .22s; }
.tdot.edu          { border-color: var(--green); }                 /* education entries use green */
.titem:hover .tdot     { background: var(--accent); }             /* fills on hover */
.titem:hover .tdot.edu { background: var(--green); }
.tmeta  { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tco    { font-size: 16.5px; font-weight: 700; color: #fff; }
.tsep   { color: var(--dim); }
.trole  { font-size: 13.5px; color: var(--accent); font-weight: 500; }
.trole.edu { color: var(--green); }
.tdate  { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.tlist  { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.tlist li { font-size: 13.5px; color: var(--muted); padding-left: 16px; position: relative; line-height: 1.65; }
.tlist li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }
.tlist li strong  { color: var(--text); }

@media (min-width: 961px) {
  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .titem {
    width: calc(50% - 42px);
  }

  .titem:nth-child(odd) {
    margin-right: auto;
    padding-right: 18px;
  }

  .titem:nth-child(even) {
    margin-left: auto;
    padding-left: 18px;
  }

  .titem:nth-child(odd) .tdot {
    left: auto;
    right: -50px;
  }

  .titem:nth-child(even) .tdot {
    left: -50px;
  }
}

/* --- Contact --- */
#contact { background: var(--bg); text-align: center; }
.open-badge  { display: inline-block; font-family: var(--mono); font-size: 12.5px; color: var(--green); background: var(--green-dim); border: 1px solid rgba(0,230,118,.22); border-radius: 20px; padding: 7px 20px; margin-bottom: 30px; }
.contact-h   { font-size: clamp(26px, 5vw, 44px); font-weight: 800; color: #fff; letter-spacing: -.8px; line-height: 1.15; margin-bottom: 16px; }
.contact-sub { color: var(--muted); font-size: 15.5px; max-width: 420px; margin: 0 auto 44px; }
.clinks { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.clink  {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: all .24s;
}
.clink i      { font-size: 17px; }
.clink:hover  { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(155,109,255,.14); }

/* --- Footer --- */
footer   { background: var(--bg); border-top: 1px solid var(--border); padding: 22px 0; text-align: center; }
.foot-t  { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.foot-t span { color: var(--accent); }

/* --- Responsive breakpoints --- */
@media (max-width: 960px) {
  .feat-inner  { grid-template-columns: 1fr; }     /* stack text + diagram vertically */
  .drone-viz   { display: none; }                   /* hide diagram on tablet */
  .metrics4    { grid-template-columns: repeat(2,1fr); }
  .proj-grid   { grid-template-columns: 1fr; }
  .about-grid  { grid-template-columns: 1fr; gap: 48px; }
  .astats      { flex-direction: row; flex-wrap: wrap; }
  .astat       { flex: 1; min-width: 130px; }
  .sgroup      { grid-template-columns: 1fr; gap: 10px; }
  .sgroup-title { padding-top: 0; }
  .timeline    { padding-left: 34px; }
  .timeline::before { left: 0; transform: none; }
  .titem       { width: auto; padding-left: 0; padding-right: 0; }
  .tdot        { left: -41px; right: auto; }
}
@media (max-width: 640px) {
  .section    { padding: 68px 0; }
  .nav-links  { display: none; }                    /* replaced by hamburger menu */
  .hamburger  { display: flex; }
  .hero-stats { gap: 24px; }
  .metrics4   { grid-template-columns: 1fr 1fr; }
  .metrics3   { grid-template-columns: 1fr 1fr; }
  .clinks     { flex-direction: column; align-items: center; }
  .hero-ctas  { gap: 8px; }
}
@media (max-width: 380px) {
  .metrics4 { grid-template-columns: 1fr 1fr; }
}
