/* ==========================================================================
   Sanjib Shah — Portfolio
   Design tokens
   ========================================================================== */

:root {
  --paper: #F6F4EF;
  --paper-alt: #EDEAE1;
  --ink: #1B1D1B;
  --ink-soft: #5A5D55;
  --ink-faint: #8B8D84;
  --rule: #DAD5C8;
  --accent: #1F6F5C;
  --accent-ink: #14493D;
  --accent-soft: #E3EEEA;
  --gold: #9C7A29;
  --gold-soft: #F1E8D2;
  --shadow: none;
  --radius: 3px;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sidebar-w: 268px;
  --content-w: 700px;
}

[data-theme="dark"] {
  --paper: #14171A;
  --paper-alt: #1B1F22;
  --ink: #EAE8E1;
  --ink-soft: #A9ACA3;
  --ink-faint: #6F736B;
  --rule: #2B2F31;
  --accent: #55B69E;
  --accent-ink: #8BD3BF;
  --accent-soft: #17302A;
  --gold: #D8B463;
  --gold-soft: #2B2415;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14171A;
    --paper-alt: #1B1F22;
    --ink: #EAE8E1;
    --ink-soft: #A9ACA3;
    --ink-faint: #6F736B;
    --rule: #2B2F31;
    --accent: #55B69E;
    --accent-ink: #8BD3BF;
    --accent-soft: #17302A;
    --gold: #D8B463;
    --gold-soft: #2B2415;
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease;
}
a:hover, a:focus-visible { border-color: var(--accent-ink); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.4rem; margin-top: 2.4em; }
h3 { font-size: 1.05rem; margin-bottom: 0.4em; }

p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.4em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6em 1em;
  z-index: 100;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 1em;
  top: 1em;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.shell {
  display: flex;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
}

/* ---- Sidebar ---- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 2.6rem 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.9rem;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  flex-shrink: 0;
  background: var(--paper-alt);
}

.sidebar-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  color: var(--ink);
}

.sidebar-tagline {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0.15rem 0 0;
  font-family: var(--sans);
}

.sidebar nav {
  margin-bottom: auto;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav a {
  display: block;
  padding: 0.44rem 0;
  border-bottom: none;
  color: var(--ink-soft);
  font-size: 0.94rem;
  position: relative;
}

.sidebar nav a span {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sidebar nav a:hover span,
.sidebar nav a:focus-visible span {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.sidebar nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.sidebar nav a[aria-current="page"] span {
  border-color: var(--accent);
  color: var(--ink);
}

.sidebar-footer {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 1.1rem;
}

.social-row a {
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}
.social-row a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

.theme-toggle {
  font-family: var(--sans);
  font-size: 0.8rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.theme-toggle:hover { border-color: var(--ink-soft); color: var(--ink); }

/* ---- Mobile top bar ---- */

.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 20;
}

.mobile-bar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.mobile-bar .avatar { width: 34px; height: 34px; }

.menu-btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  width: 38px;
  height: 34px;
  cursor: pointer;
  position: relative;
}
.menu-btn span,
.menu-btn::before,
.menu-btn::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1.5px;
  background: var(--ink);
}
.menu-btn::before { top: 12px; }
.menu-btn span { top: 16px; }
.menu-btn::after { top: 20px; }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}
.mobile-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---- Main content ---- */

main {
  flex: 1;
  min-width: 0;
  padding: 3.4rem 3rem 5rem;
}

.content {
  max-width: var(--content-w);
}

.eyebrow-plain {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: -0.4em 0 1.6em;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.6rem 0;
}

/* ==========================================================================
   Home hero
   ========================================================================== */

.hero {
  display: flex;
  gap: 2.2rem;
  align-items: flex-start;
  margin-bottom: 2.2rem;
}

.hero-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  flex-shrink: 0;
  background: var(--paper-alt);
}

.hero-text .kicker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 0.15em;
}

.hero-text h1 { margin-bottom: 0.35em; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1.1rem;
}

@media (max-width: 640px) {
  .hero { flex-direction: column; }
}

/* ==========================================================================
   Timeline (education / volunteering)
   ========================================================================== */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--rule);
}

.timeline li {
  position: relative;
  padding: 0 0 2rem 1.6rem;
  margin: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 0.4em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--accent);
}

.timeline li:last-child { padding-bottom: 0; }

.tl-range {
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.15em;
}

.tl-title { margin: 0 0 0.1em; font-size: 1.05rem; }
.tl-org { color: var(--ink-soft); margin: 0 0 0.5em; font-size: 0.95rem; }
.tl-org .gpa { color: var(--ink-faint); }

.timeline ul { margin-top: 0.5em; }

/* ==========================================================================
   Skills
   ========================================================================== */

.skill-group {
  margin-bottom: 1.8rem;
}

.skill-group h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-row li {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.28rem 0.65rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Cards (projects / publications / certifications)
   ========================================================================== */

.entry {
  padding: 1.7rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1.4rem;
}

.entry:first-of-type { border-top: none; padding-top: 0; }

.entry-media {
  width: 148px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-alt);
  aspect-ratio: 4 / 3;
}
.entry-media img { width: 100%; height: 100%; object-fit: cover; }

.entry-body h3 { margin-bottom: 0.3em; }
.entry-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.6em;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .entry { flex-direction: column; }
  .entry-media { width: 100%; aspect-ratio: 16/9; }
}

.pub-entry { display: block; }

.pub-meta {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin: 0.2em 0;
}
.pub-authors { color: var(--ink); }

/* ==========================================================================
   Award / certification list (misc page)
   ========================================================================== */

.award {
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
}
.award:first-of-type { border-top: none; padding-top: 0; }

.award-badge {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: var(--radius);
  padding: 0.18rem 0.55rem;
  margin-bottom: 0.5em;
}

.award-gallery {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.award-gallery img {
  width: 92px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

.cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cert-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}
.cert-list li:first-child { border-top: none; }
.cert-name { color: var(--ink); }
.cert-org { color: var(--ink-faint); font-size: 0.9rem; white-space: nowrap; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 2rem;
  margin: 1.8rem 0 2.4rem;
}

.contact-item .label {
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.25em;
}
.contact-item .value { font-size: 1.05rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.3rem;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
}
.button:hover { background: var(--accent-ink); border-color: transparent; }

@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.page-footer {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ==========================================================================
   Responsive: collapse sidebar
   ========================================================================== */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-bar { display: flex; }
  main { padding: 2.2rem 1.3rem 4rem; }
  .shell { display: block; }
}
