/* =========================================================
   Sreyas Chava — Professional Profile
   LinkedIn-style layout · light & dark themes
   ========================================================= */

:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --text: #1d2226;
  --muted: #5e6670;
  --border: #e0dfdc;
  --accent: #0a66c2;
  --accent-hover: #004182;
  --accent-soft: #e8f1fb;
  --chip-bg: #eef3f8;
  --chip-text: #1d2226;
  --shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --radius: 10px;
  --topbar: rgba(255,255,255,.92);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --card: #1b1f23;
    --text: #e8eaed;
    --muted: #a0a7b0;
    --border: #2d3238;
    --accent: #71b7fb;
    --accent-hover: #a6d1fd;
    --accent-soft: #1c2b3b;
    --chip-bg: #262c33;
    --chip-text: #e8eaed;
    --shadow: 0 0 0 1px rgba(255,255,255,.06);
    --topbar: rgba(27,31,35,.92);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113;
  --card: #1b1f23;
  --text: #e8eaed;
  --muted: #a0a7b0;
  --border: #2d3238;
  --accent: #71b7fb;
  --accent-hover: #a6d1fd;
  --accent-soft: #1c2b3b;
  --chip-bg: #262c33;
  --chip-text: #e8eaed;
  --shadow: 0 0 0 1px rgba(255,255,255,.06);
  --topbar: rgba(27,31,35,.92);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .6em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1128px; margin: 0 auto; padding: 0 16px;
  height: 56px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { border-radius: 6px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); font-weight: 500; font-size: 14px;
  padding: 8px 12px; border-radius: 6px;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--chip-bg); text-decoration: none; }
.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--chip-bg); color: var(--text); }
.menu-toggle { display: none; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1128px; margin: 24px auto; padding: 0 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px;
  align-items: start;
}
.main-col, .side-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side-col { position: sticky; top: 80px; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.card > h2 { font-size: 20px; font-weight: 600; margin-bottom: 14px; }
.side-card { padding: 18px 20px; }
.side-card > h2 { font-size: 16px; margin-bottom: 12px; }

/* ---------- Profile header ---------- */
.profile-card { padding: 0; overflow: hidden; }
.cover { aspect-ratio: 4 / 1; background: #0e2a47; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { padding: 0 24px 24px; position: relative; }
.avatar {
  width: 152px; height: 152px; border-radius: 50%;
  border: 4px solid var(--card); margin-top: -96px; object-fit: cover;
  background: var(--card);
}
.profile-top { display: flex; gap: 24px; justify-content: space-between; margin-top: 12px; }
.profile-info h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.headline { font-size: 16px; margin-bottom: 6px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 0; }
.quick-orgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 200px; }
.quick-orgs li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.quick-orgs img { width: 32px; height: 32px; border-radius: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0f1113; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f1113; } }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-ghost { border-color: var(--muted); color: var(--muted); }
.btn-ghost:hover { background: var(--chip-bg); color: var(--text); }
/* High-visibility Publications call-to-action: warm brown, white text. */
.btn-publications {
  background: #85512e; color: #fff; border-color: #85512e;
  font-weight: 700; padding: 9px 21px;
  box-shadow: 0 2px 7px rgba(65, 36, 17, .24);
}
.btn-publications:hover, .btn-publications:focus-visible {
  background: #65391e; color: #fff; border-color: #65391e;
  box-shadow: 0 3px 11px rgba(65, 36, 17, .34);
}
.btn-publications:focus-visible { outline: 3px solid #c59362; outline-offset: 3px; }


/* ---------- About stats ---------- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); }

/* ---------- Featured ---------- */
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.feature {
  margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.feature img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.feature figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.feature figcaption strong { font-size: 14px; }
.feature figcaption span { font-size: 13px; color: var(--muted); }

/* ---------- Timeline entries ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 16px 0; }
.item + .item { border-top: 1px solid var(--border); }
.item:first-child { padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.logo { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.logo.sm { width: 40px; height: 40px; }
.item h3, .award-list h3 { font-size: 16px; font-weight: 600; }
.org { font-size: 14px; margin: 2px 0 0; }
.date { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.project { font-style: italic; color: var(--muted); }
.sub { font-weight: 600; margin-top: 8px; }
.muted { color: var(--muted); }
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin-bottom: 4px; }
.bullets li::marker { color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 3px 10px; border-radius: 999px;
}

/* ---------- Education course groups ---------- */
.course-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-top: 6px; }
.course-groups h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  background: var(--chip-bg); color: var(--chip-text);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
}
.chips.small span { font-size: 12.5px; padding: 3px 10px; }
.skill-groups { display: flex; flex-direction: column; gap: 18px; }
.skill-groups h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Awards / certifications ---------- */
.award-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.award-list.two-col { grid-template-columns: 1fr 1fr; }
.award-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.award-list .org { color: var(--muted); font-size: 13px; }

/* ---------- Sidebar ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.contact-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); word-break: break-word; }
.contact-list svg { flex: none; }
.contact-logo { width: 18px; height: 18px; border-radius: 3px; flex: none; }
.highlight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.highlight-list li { position: relative; padding-left: 16px; }
.highlight-list li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  max-width: 1128px; margin: 8px auto 32px; padding: 0 16px;
  display: flex; justify-content: space-between; color: var(--muted); font-size: 13px;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; background: var(--card); border-bottom: 1px solid var(--border);
    padding: 8px 16px 12px;
  }
  .nav.open { display: flex; }
  .menu-toggle { display: grid; }
  .theme-toggle { margin-left: auto; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .layout { margin-top: 12px; gap: 12px; }
  .card { padding: 18px 16px; }
  .profile-body { padding: 0 16px 18px; }
  .avatar { width: 112px; height: 112px; margin-top: -64px; }
  .profile-top { flex-direction: column; gap: 12px; }
  .profile-info h1 { font-size: 22px; }
  .headline { font-size: 15px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .featured-grid, .course-groups, .award-list.two-col { grid-template-columns: 1fr; }
  .item { grid-template-columns: 40px 1fr; gap: 12px; }
  .logo { width: 40px; height: 40px; }
  .footer { flex-direction: column; gap: 6px; }
}

/* ---------- Photo gallery (inside an experience entry) ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; max-width: 520px; }
.g-item { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--chip-bg); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.g-item:hover img { transform: scale(1.05); }
.g-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden-thumb { display: none; }
.g-item .more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 22px; font-weight: 700;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: 82vh; max-width: 100%; width: auto; border-radius: 6px; }
.lightbox figcaption { color: #e8eaed; font-size: 14px; margin-top: 10px; display: flex; gap: 14px; }
.lb-count { color: #a0a7b0; }
.lb-btn {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1;
  display: grid; place-items: center;
}
.lb-btn:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .gallery { gap: 4px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); }
}

/* Thin outline so white logo tiles stay visible on white cards */
.logo, .quick-orgs img { border: 1px solid var(--border); background: #fff; }

/* Certifications subsection within About */
.about-certifications { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.about-certifications-title { font-size: 20px; font-weight: 600; margin: 0 0 14px; }
