/* ===========================================
   Prateek Kansal — Site Styles
   Clean, modern, with a bit more visual polish:
   soft gradients, card depth, and a stronger accent.
=========================================== */

:root {
  --bg: #ffffff;
  --text: #14161c;
  --muted: #5b6270;
  --accent: #2455e0;
  --accent-2: #7c3aed;
  --accent-dark: #1a3fb0;
  --border: #e7e9ee;
  --surface: #f7f8fb;
  --dark: #0f1220;
  --header-bg: rgba(255,255,255,0.85);
  --max-width: 900px;
  --radius: 14px;
  font-size: 16px;
}

html[data-theme="dark"] {
  --bg: #0b0d14;
  --text: #eef0f6;
  --muted: #9aa1b2;
  --border: #232636;
  --surface: #141726;
  --dark: #05060a;
  --header-bg: rgba(11,13,20,0.85);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(36,85,224,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
header.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(10px);
  z-index: 10;
}

header.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-name {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

nav.site-nav { display: flex; align-items: center; }
nav.site-nav a {
  color: var(--text);
  margin-left: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
nav.site-nav a:hover { color: var(--accent); background: var(--surface); text-decoration: none; }
nav.site-nav a.active { color: #fff; background: var(--accent); }

.theme-toggle {
  margin-left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.08); border-color: var(--accent); }

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  margin-left: 10px;
  position: relative;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { top: 13px; }
.nav-toggle span { top: 18px; }
.nav-toggle::after { top: 23px; }
.nav-toggle.open::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle.open::after { transform: translateY(-5px) rotate(-45deg); }
.nav-toggle.open span { opacity: 0; }

@media (max-width: 720px) {
  header.site-header .wrap { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  nav.site-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  nav.site-nav.open { max-height: 400px; margin-top: 14px; }
  nav.site-nav a { margin-left: 0; margin-bottom: 6px; }
  .theme-toggle { margin-left: 0; margin-top: 8px; align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 70px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -160px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(36,85,224,0.16) 0%, rgba(124,58,237,0.08) 45%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  z-index: -1;
}

.hero-text { flex: 1 1 420px; }

.avatar-badge {
  flex: 0 0 auto;
  width: 280px;
  height: 446px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 26px 54px -14px rgba(36,85,224,0.45);
  padding: 7px;
}
.avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid var(--bg);
  display: block;
}

@media (max-width: 640px) {
  .avatar-badge { width: 220px; height: 350px; font-size: 3.4rem; }
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.hero .role {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(36,85,224,0.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero p.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 30px;
}

.button-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(36,85,224,0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(36,85,224,0.6); text-decoration: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-2px); }

/* ---------- Stats row ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 20px 0 50px;
}
@media (min-width: 640px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}
.stat-item { text-align: left; }
.stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }

/* ---------- Companies strip ---------- */
.companies { padding: 26px 0 74px; border-top: 1px solid var(--border); }
.companies .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.companies ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.companies li a {
  display: block;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.companies li a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Section ---------- */
section.page-section { padding: 60px 0; }
section.page-section + section.page-section { border-top: 1px solid var(--border); }
section.page-section h2 {
  font-size: 1.7rem;
  margin: 0 0 22px;
  position: relative;
  padding-left: 18px;
}
section.page-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.section-intro { color: var(--muted); max-width: 640px; margin-bottom: 8px; }

/* ---------- Resume timeline ---------- */
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 128px;
  width: 2px;
  background: var(--border);
}
.resume-block {
  position: relative;
  border-top: none;
  padding: 0 0 36px;
  scroll-margin-top: 100px;
}
.resume-block:last-child { padding-bottom: 4px; }
.resume-block::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline .resume-block {
  display: grid;
  grid-template-columns: 114px 1fr;
  column-gap: 24px;
}
.timeline .resume-block::before { left: 122px; }
.resume-year {
  text-align: right;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  padding-top: 3px;
}
.resume-content { min-width: 0; }
.resume-block h3 { font-size: 1.12rem; margin: 0; }
.resume-block .company { color: var(--accent-2); font-weight: 700; margin: 4px 0 10px; }
.resume-block ul { margin: 10px 0 0; padding-left: 20px; color: var(--text); }
.resume-block li { margin-bottom: 6px; }

@media (max-width: 720px) {
  .timeline::before { left: 0; }
  .timeline .resume-block {
    grid-template-columns: 1fr;
    padding-left: 26px;
  }
  .timeline .resume-block::before { left: -6px; top: 6px; }
  .resume-year {
    text-align: left;
    display: inline-block;
    background: rgba(36,85,224,0.08);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
  }
}

.skills-grid, .stack-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Cards (Projects / Recommendations) ---------- */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
}
.project-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(20,22,28,0.04);
  scroll-margin-top: 100px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -12px rgba(20,22,28,0.14);
  border-color: rgba(36,85,224,0.25);
}
.project-card:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36,85,224,0.25);
}
.resume-block:target {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 10px;
}
.project-card::before {
  content: "\201C";
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 3.2rem;
  font-weight: 800;
  color: rgba(36,85,224,0.08);
  line-height: 1;
  font-family: Georgia, serif;
}
.project-card .company-tag {
  display: inline-block;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.project-card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.project-card p { color: var(--muted); margin-bottom: 12px; }
.project-card ul { margin: 0; padding-left: 20px; color: var(--text); }
.project-card li { margin-bottom: 6px; }

/* ---------- Interest cards (Beyond Work) ---------- */
.interest-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  background: var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.interest-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -12px rgba(20,22,28,0.14);
  border-color: rgba(36,85,224,0.25);
}
.interest-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.interest-card p { color: var(--muted); margin: 0; }
.photo-placeholder {
  aspect-ratio: 16 / 10;
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--bg);
  margin-bottom: 14px;
  text-align: center;
}

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item { border-top: 1px solid var(--border); padding: 26px 0; transition: padding-left 0.15s ease; }
.post-item:first-child { border-top: none; }
.post-item:hover { padding-left: 6px; }
.post-item .post-date {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.post-item h3 { margin: 0 0 8px; font-size: 1.3rem; }
.post-item p { color: var(--muted); margin: 0 0 8px; }

.post-body { padding: 54px 0 74px; }
.post-body .post-date { color: var(--accent); font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.post-body h1 { font-size: 2.1rem; margin: 0 0 20px; letter-spacing: -0.02em; }
.post-body p { margin-bottom: 18px; font-size: 1.05rem; }
.back-link { display: inline-block; margin-bottom: 26px; font-weight: 700; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 0;
  margin-top: 20px;
  font-size: 0.88rem;
}
footer.site-footer a { color: #fff; font-weight: 600; }
footer.site-footer a:hover { color: rgba(255,255,255,0.8); }
footer.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
