/* =========================================================
   Kuldeep Chauhan — Personal Portfolio
   Custom build, original CSS. No template files reused.
   Color: Deep navy + warm gold accent + neutral greys.
   Type: Inter (body) + Space Grotesk (display) — Google Fonts (open license).
   Icons: Phosphor Icons via CDN — MIT license.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --c-ink:        #0A1F3D;   /* deep navy */
  --c-ink-soft:   #14305C;
  --c-ink-line:   #1F3D6E;
  --c-bg:         #F7F6F2;   /* warm off-white */
  --c-bg-alt:     #FFFFFF;
  --c-paper:      #FFFFFF;
  --c-text:       #1B2330;
  --c-muted:      #5A6275;
  --c-line:       #E2E0D6;
  --c-gold:       #C9A961;
  --c-gold-soft:  #F1E7CC;
  --c-shadow:     0 12px 40px rgba(10, 31, 61, .08);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --space-section: clamp(64px, 9vw, 120px);
  --container: 1180px;

  --ff-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --ff-disp: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul, ol { padding: 0; list-style: none; margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--ff-disp); color: var(--c-ink); letter-spacing: -.01em; }

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

main > section { padding: var(--space-section) 0; }
main > section:nth-of-type(even) { background: var(--c-bg-alt); }

/* ---------- Section heads ---------- */
.section__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 48px;
  max-width: 760px;
}
.section__head--row { flex-direction: row; align-items: baseline; gap: 16px; }
.section__num {
  font-family: var(--ff-disp);
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--c-gold);
  font-weight: 600;
}
.section__title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.15;
}
.section__sub {
  margin: 6px 0 0;
  color: var(--c-muted);
  font-size: 17px;
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  font-family: var(--ff-disp);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 18px;
  padding: 6px 12px;
  background: var(--c-gold-soft);
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn i { font-size: 18px; }
.btn--primary {
  background: var(--c-ink);
  color: #fff;
  border-color: var(--c-ink);
}
.btn--primary:hover {
  background: var(--c-ink-soft);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(10, 31, 61, .25);
}
.btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
}
.btn--ghost:hover {
  background: var(--c-ink);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 242, .85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, padding .25s ease;
}
.topbar.is-scrolled {
  border-bottom-color: var(--c-line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--c-ink);
}
.topbar__mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--c-ink);
  color: #fff;
  font-family: var(--ff-disp);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
}
.topbar__name {
  font-family: var(--ff-disp);
  font-size: 16px;
}
.topbar__nav {
  display: none;
  gap: 28px;
  font-size: 14.5px;
  color: var(--c-text);
}
.topbar__nav a {
  position: relative;
  padding: 6px 2px;
  font-weight: 500;
  transition: color .2s ease;
}
.topbar__nav a:hover { color: var(--c-ink); }
.topbar__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.topbar__nav a:hover::after { transform: scaleX(1); }
.topbar__cta { display: none; }

@media (min-width: 880px) {
  .topbar__nav { display: flex; }
  .topbar__cta { display: inline-flex; padding: 10px 18px; font-size: 14px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(60px, 7vw, 96px);
  padding-bottom: clamp(60px, 7vw, 96px);
  background:
    radial-gradient(ellipse at 90% 0%, rgba(201, 169, 97, .12), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(10, 31, 61, .08), transparent 60%),
    var(--c-bg);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
.hero__title {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.08;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero__title-accent {
  color: var(--c-gold);
  font-style: italic;
  font-weight: 500;
}
.hero__lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--c-muted);
  max-width: 58ch;
  margin: 0 0 28px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-bottom: 32px;
  color: var(--c-muted);
  font-size: 14.5px;
}
.hero__meta i { color: var(--c-gold); margin-right: 6px; }
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__portrait {
  position: relative;
  justify-self: center;
  width: min(420px, 100%);
}
.hero__portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--c-ink) 0%, var(--c-ink-soft) 100%);
  overflow: hidden;
  box-shadow: var(--c-shadow);
}
.hero__portrait-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(201, 169, 97, .35), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .08), transparent 50%);
}
.hero__portrait-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--ff-disp);
  font-weight: 700;
  font-size: 90px;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .14);
}
.hero__badge {
  position: absolute;
  bottom: -22px;
  left: -22px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-paper);
  padding: 14px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--c-shadow);
  border: 1px solid var(--c-line);
}
.hero__badge i {
  font-size: 28px;
  color: var(--c-gold);
}
.hero__badge strong {
  display: block;
  font-family: var(--ff-disp);
  font-size: 14px;
  color: var(--c-ink);
}
.hero__badge small {
  font-size: 12px;
  color: var(--c-muted);
}

@media (min-width: 920px) {
  .hero__grid {
    grid-template-columns: 1.25fr .9fr;
    gap: 80px;
  }
  .hero__portrait { justify-self: end; }
}

/* ---------- Impact stats ---------- */
.impact {
  background: var(--c-ink) !important;
  color: #fff;
  position: relative;
}
.impact .section__title { color: #fff; }
.impact .section__num { color: var(--c-gold); }
.impact__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 720px) { .impact__grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1020px) { .impact__grid { grid-template-columns: repeat(6, 1fr); } }

.stat {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-md);
  padding: 22px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: var(--c-gold);
  background: rgba(201, 169, 97, .08);
}
.stat__num {
  font-family: var(--ff-disp);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1;
  color: var(--c-gold);
  margin-bottom: 12px;
}
.stat__label {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  margin-bottom: 6px;
}
.stat__note {
  margin: 0;
  color: rgba(255, 255, 255, .58);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.about__lead {
  font-family: var(--ff-disp);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  color: var(--c-ink);
  margin: 0 0 20px;
  font-weight: 500;
}
.about__copy p { margin: 0 0 16px; color: var(--c-text); }
.about__pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 28px;
}
.about__pillars li {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}
.about__pillars i {
  font-size: 26px;
  color: var(--c-gold);
  flex-shrink: 0;
  margin-top: 2px;
}
.about__pillars strong {
  display: block;
  font-family: var(--ff-disp);
  color: var(--c-ink);
  margin-bottom: 4px;
}
.about__pillars span {
  font-size: 14.5px;
  color: var(--c-muted);
}

@media (min-width: 900px) {
  .about__grid { grid-template-columns: .8fr 2fr; gap: 60px; }
  .about__pillars { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--c-line);
}
.timeline__item {
  position: relative;
  padding: 0 0 40px 24px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-gold);
  box-shadow: 0 0 0 4px var(--c-bg-alt), 0 0 0 6px var(--c-line);
}
.timeline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.timeline__date {
  color: var(--c-gold);
  font-weight: 600;
  letter-spacing: .04em;
}
.timeline__company {
  color: var(--c-muted);
  font-weight: 500;
}
.timeline__body h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
}
.timeline__body p {
  color: var(--c-muted);
  margin: 0 0 12px;
}
.timeline__body ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--c-text);
}
.timeline__body ul li { margin-bottom: 6px; }

@media (min-width: 880px) {
  .timeline { padding-left: 200px; border-left: none; }
  .timeline__item { padding-left: 40px; border-left: 2px solid var(--c-line); }
  .timeline__item::before { left: -8px; }
  .timeline__meta {
    position: absolute;
    left: -200px;
    top: 6px;
    width: 160px;
    flex-direction: column;
    gap: 4px;
    text-align: right;
    align-items: flex-end;
  }
}

/* ---------- Engagements (cards) ---------- */
.engagements__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 760px) { .engagements__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .engagements__grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--c-shadow);
  border-color: var(--c-gold);
}
.card__head { margin-bottom: 14px; }
.card__tag {
  display: inline-block;
  font-family: var(--ff-disp);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--c-gold);
  margin-bottom: 10px;
}
.card h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}
.card p {
  color: var(--c-muted);
  margin: 0 0 14px;
  font-size: 15px;
}
.card__list {
  border-top: 1px solid var(--c-line);
  padding-top: 14px;
}
.card__list li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 14.5px;
  color: var(--c-text);
}
.card__list li::before {
  content: '\2714';
  position: absolute;
  left: 0;
  color: var(--c-gold);
  font-size: 13px;
  top: 8px;
}

/* ---------- Certifications grid ---------- */
.cert__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 700px) { .cert__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cert__grid { grid-template-columns: repeat(6, 1fr); } }

.cert {
  text-align: center;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 24px 18px;
  transition: border-color .2s ease, transform .2s ease;
}
.cert:hover {
  border-color: var(--c-gold);
  transform: translateY(-3px);
}
.cert i {
  font-size: 32px;
  color: var(--c-gold);
  margin-bottom: 12px;
}
.cert h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.cert span {
  font-size: 13px;
  color: var(--c-muted);
}

/* ---------- Skills ---------- */
.skills__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 720px) { .skills__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .skills__grid { grid-template-columns: repeat(4, 1fr); } }

.skillgroup {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 24px;
}
.skillgroup h4 {
  font-family: var(--ff-disp);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
}
.skillgroup h4 i { color: var(--c-gold); font-size: 20px; }
.skillgroup ul li {
  padding: 6px 0;
  font-size: 14.5px;
  color: var(--c-text);
  position: relative;
  padding-left: 18px;
}
.skillgroup ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-gold);
}

/* ---------- Education ---------- */
.edu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 760px;
}
.edu li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 18px 22px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}
.edu__year {
  font-family: var(--ff-disp);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--c-gold);
  font-weight: 600;
  padding-top: 2px;
}
.edu h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}
.edu span {
  font-size: 14px;
  color: var(--c-muted);
}

@media (max-width: 540px) {
  .edu li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Contact ---------- */
.contact { background: var(--c-ink) !important; color: #fff; }
.contact .section__title { color: #fff; }
.contact .section__sub { color: rgba(255,255,255,.7); }
.contact .section__num { color: var(--c-gold); }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 900px) { .contact__grid { grid-template-columns: 1fr 1.2fr; gap: 60px; } }

.contact__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .contact__cards { grid-template-columns: repeat(2, 1fr); } }

.contactcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-md);
  color: #fff;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.contactcard:not(.contactcard--static):hover {
  border-color: var(--c-gold);
  transform: translateY(-3px);
  background: rgba(201, 169, 97, .08);
}
.contactcard i {
  font-size: 24px;
  color: var(--c-gold);
}
.contactcard strong {
  display: block;
  font-family: var(--ff-disp);
  font-size: 14px;
  margin-bottom: 2px;
}
.contactcard span {
  font-size: 14px;
  color: rgba(255, 255, 255, .72);
  word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
  background: #06152C;
  color: rgba(255, 255, 255, .65);
  padding: 36px 0;
  font-size: 14px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer__brand {
  display: block;
  font-family: var(--ff-disp);
  font-weight: 600;
  color: #fff;
  font-size: 16px;
}
.footer__tag {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  margin-top: 2px;
}
@media (min-width: 720px) {
  .footer__inner { flex-direction: row; align-items: center; }
}

/* ---------- Floating back-to-top ---------- */
.totop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c-ink);
  color: #fff;
  box-shadow: var(--c-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 60;
}
.totop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.totop:hover { background: var(--c-gold); color: var(--c-ink); }

/* ---------- Reveal-on-scroll (for IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
