/* =========================================================
   Sidisha Shyam Barik — Portfolio
   Theme: Modern technical (indigo accent)
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

/* ---------- Design tokens ---------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max-width: 880px;
  --nav-max: 1080px;
  --nav-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;

  /* Light theme */
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e7e7ea;
  --border-strong: #d6d6db;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #8a8a93;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.05), 0 1px 3px rgba(16, 16, 24, 0.06);
  --shadow-md: 0 6px 24px rgba(16, 16, 24, 0.10);
  --nav-bg: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] {
  --bg: #0c0c0f;
  --bg-subtle: #141418;
  --surface: #16161b;
  --surface-2: #1a1a20;
  --border: #26262e;
  --border-strong: #36363f;
  --text: #ececf1;
  --text-muted: #a6a6b2;
  --text-faint: #6f6f7d;
  --accent: #8b8cf9;
  --accent-strong: #a8a9fb;
  --accent-contrast: #0c0c0f;
  --accent-soft: rgba(139, 140, 249, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(12, 12, 15, 0.70);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

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

::selection { background: var(--accent-soft); }

a { color: var(--accent); }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--nav-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: border-color .2s ease, background .2s ease, transform .08s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--accent); }
.theme-toggle:active { transform: scale(0.93); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 36px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 130% at 50% -25%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 38px;
}
.hero-avatar {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
}
.hero-text { min-width: 0; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text);
}
.hero-tagline {
  margin-top: 16px;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
}
.hero-links {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .12s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-contrast);
}

/* ---------- Main / back link ---------- */
main { padding: 8px 0 96px; }
.back-link {
  display: inline-block;
  margin: 28px 0 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color .2s ease;
}
.back-link:hover { color: var(--accent); }

/* ---------- Prose (markdown content) ---------- */
.prose { font-size: 1.02rem; color: var(--text); }
.prose > *:first-child { margin-top: 0; }

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 18px 0 18px;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 58px 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 36px 0 12px;
  padding-left: 16px;
  position: relative;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.prose h3 a { color: var(--text); text-decoration: none; border-bottom: 0; }
.prose h3 a:hover { color: var(--accent); }
.prose h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--text-faint); }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.prose a:hover { color: var(--accent-strong); border-bottom-color: currentColor; }

.prose strong, .prose b { font-weight: 700; color: var(--text); }
.prose em { color: var(--text-muted); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 42px 0;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.96rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.prose thead th {
  background: var(--bg-subtle);
  font-weight: 600;
}
.prose th, .prose td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background .15s ease; }
.prose tbody tr:hover { background: var(--accent-soft); }

/* Code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}
.prose pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 22px 0;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }

/* Images & figures */
.prose img {
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: var(--radius-sm);
}
.prose blockquote {
  margin: 26px 0;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.prose blockquote > *:first-child { margin-top: 0; }
.prose blockquote > *:last-child { margin-bottom: 0; }
.prose blockquote img {
  margin: 14px auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.prose blockquote em,
.prose .caption {
  display: block;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-top: 8px;
}
.prose .caption { margin: 8px 0 20px; }

/* Native <figure>/<video> figures (used on project pages, e.g. demo video) */
.prose figure { margin: 26px 0; }
.prose figure img,
.prose video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.prose figcaption {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-top: 8px;
}

/* "Read more" project links rendered as call-to-action buttons */
.prose a[href*="/projects/"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border-bottom: 0;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.prose a[href*="/projects/"]:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-bottom: 0;
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer p { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 24px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 22px; }
  .hero-avatar { width: 104px; height: 104px; }
  .nav-links { gap: 18px; }
  .prose h2 { margin-top: 46px; }
}
@media (max-width: 560px) {
  .nav-links a { display: none; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner { animation: fade-up .6s ease both; }
  main { animation: fade-up .6s ease .06s both; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   Homepage sections (data-driven cards & timeline)
   ========================================================= */
main { padding: 0 0 80px; }

.section {
  padding: 30px 0;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Shared placeholder for items without an image */
.media--placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--bg-subtle);
}
.placeholder-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
  padding: 0 18px;
  line-height: 1.5;
}

/* Badges & tags */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 6px;
}

/* Card links */
.card-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 18px; padding-top: 4px; }
.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color .18s ease, gap .18s ease;
}
.card-link:hover { color: var(--accent-strong); }

/* ---------- Publications (horizontal media cards) ---------- */
.pub-list { display: flex; flex-direction: column; gap: 22px; }
.pub-card {
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pub-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.pub-media { overflow: hidden; background: var(--bg-subtle); min-height: 168px; padding: 14px; }
.pub-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; }
.pub-card:hover .pub-media img { transform: scale(1.04); }
.pub-body { padding: 24px 26px; display: flex; flex-direction: column; }
.pub-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 10px;
  color: var(--text);
}
.pub-authors { font-size: 0.82rem; color: var(--text-faint); margin: 0 0 12px; }
.pub-authors strong { color: var(--text-muted); font-weight: 600; }
.pub-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.65; margin: 0 0 18px; }

/* ---------- Projects (card grid) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-subtle); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-title {
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 10px;
  color: var(--text);
}
.card-desc { font-size: 0.93rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; }

/* ---------- Experience (timeline) ---------- */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding: 0 0 32px 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-role {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.timeline-company { font-size: 0.95rem; color: var(--accent); font-weight: 500; margin: 3px 0 10px; }
.timeline-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.65; margin: 0; }

/* ---------- Education (list) ---------- */
.edu-list { display: flex; flex-direction: column; }
.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:first-child { padding-top: 0; }
.edu-item:last-child { border-bottom: 0; padding-bottom: 0; }
.edu-degree { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 0 0 3px; color: var(--text); }
.edu-school { font-size: 0.93rem; color: var(--text-muted); margin: 0; }
.edu-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); white-space: nowrap; }

/* ---------- Section responsiveness ---------- */
@media (max-width: 640px) {
  .pub-card { grid-template-columns: 1fr; }
  .pub-media { aspect-ratio: 16 / 9; min-height: 0; }
  .edu-item { flex-direction: column; gap: 4px; }
}
