/* Layout: LinkedIn-style profile — centered 1128px shell, main column + 300px sidebar, white cards on a warm-grey ground. */
:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --fg: #1d2226;
  --muted: #5e6670;
  --faint: #8c8c8c;
  --line: #e0dfdc;
  --accent: #0a66c2;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1fb;
  --accent-hover: #004182;
  --chip: #eef3f8;
  --banner-a: #0b2440;
  --banner-b: #13406f;
  --banner-node: #8fc3f2;
  --banner-line: rgba(143, 195, 242, 0.32);
  --ok: #057642;
  --warn: #915907;
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 3px rgba(0, 0, 0, 0.05);
  --font-body: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1b1f23; --fg: #e9e9e9; --muted: #a8adb3; --faint: #8a9096; --line: #38434f;
    --accent: #71b7fb; --accent-ink: #0b1a29; --accent-soft: #1f3247; --accent-hover: #a8d4ff; --chip: #26303a;
    --banner-a: #071729; --banner-b: #0f3156; --banner-node: #71b7fb; --banner-line: rgba(113, 183, 251, 0.28);
    --ok: #4fbf8a; --warn: #e3b25a; --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1b1f23; --fg: #e9e9e9; --muted: #a8adb3; --faint: #8a9096; --line: #38434f;
  --accent: #71b7fb; --accent-ink: #0b1a29; --accent-soft: #1f3247; --accent-hover: #a8d4ff; --chip: #26303a;
  --banner-a: #071729; --banner-b: #0f3156; --banner-node: #71b7fb; --banner-line: rgba(113, 183, 251, 0.28);
  --ok: #4fbf8a; --warn: #e3b25a; --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
[hidden] { display: none !important; }

.shell {
  max-width: 1128px;
  margin: 0 auto;
  padding-block: 24px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.main, .aside { display: grid; gap: 8px; min-width: 0; }
.aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  min-width: 0;
}
.card > h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* ---------- Profile header ---------- */
.profile { padding: 0; overflow: hidden; }
.banner {
  position: relative;
  height: 200px;
  background: linear-gradient(120deg, var(--banner-a), var(--banner-b));
}
.banner svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.banner-tag {
  position: absolute; right: 16px; bottom: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--banner-node); opacity: 0.85;
}
.profile-body { padding: 0 24px 24px; position: relative; }
.avatar {
  width: 152px; height: 152px; border-radius: 50%;
  margin-top: -112px;
  border: 4px solid var(--card);
  background: var(--accent-soft);
  object-fit: cover;
  display: block;
  position: relative;
}
.avatar-fallback {
  display: grid; place-items: center;
  font-size: 52px; font-weight: 600; color: var(--accent);
}
.ident { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; margin-top: 12px; }
.ident h1 { font-size: 26px; font-weight: 600; line-height: 1.25; }
.pronoun { font-size: 14px; color: var(--muted); font-weight: 400; }
.headline { font-size: 16px; margin: 4px 0 8px; }
.loc { color: var(--muted); font-size: 14px; margin: 0; }
.loc a { font-weight: 600; }
.orgs { display: grid; gap: 8px; align-content: start; font-size: 14px; font-weight: 600; min-width: 220px; }
.org { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.org .mono { width: 32px; height: 32px; font-size: 11px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  font-size: 15px; font-weight: 600; line-height: 1;
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: var(--muted); color: var(--muted); }
.btn.ghost:hover { background: var(--chip); box-shadow: inset 0 0 0 1px var(--muted); }
.btn svg { width: 18px; height: 18px; flex: none; }

.li-icon { fill: currentColor; }
.li-badge {
  width: 20px; height: 20px; flex: none; border-radius: 4px;
  background: #0a66c2; display: inline-grid; place-items: center;
}
.li-badge svg { width: 13px; height: 13px; fill: #ffffff; }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin-top: 20px; padding-top: 16px; gap: 16px;
}
.stat b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; line-height: 1.35; display: block; }

/* ---------- Monogram logos ---------- */
.mono {
  width: 48px; height: 48px; flex: none; border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
  background: var(--chip); color: var(--fg);
}
.mono.stc { background: #0b2440; color: #8fc3f2; }
.mono.sb { background: #2a3440; color: #e9e9e9; }

/* ---------- About ---------- */
.about p { margin: 0 0 12px; max-width: 68ch; }
.about p:last-child { margin-bottom: 0; }
.focus-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.focus-row .label { width: 100%; font-weight: 600; font-size: 14px; }

.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--chip); color: var(--fg); font-size: 13px; line-height: 1.5;
}

/* ---------- Activity / posts ---------- */
.activity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.activity-head .sub { margin-bottom: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.tab {
  height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--muted); background: transparent; color: var(--muted);
  font: 600 14px/1 var(--font-body); cursor: pointer;
}
.tab:hover { background: var(--chip); }
.tab[aria-selected="true"] { background: var(--ok); border-color: var(--ok); color: #ffffff; }
.posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.post {
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.post-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.post-head img, .post-head .mono { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.post-head .mono.stc { border-radius: 4px; font-size: 11px; }
.post-who { min-width: 0; }
.post-who strong { display: block; font-size: 14px; line-height: 1.3; }
.post-who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-src { margin-left: auto; align-self: flex-start; }
.post-src .li-badge { width: 18px; height: 18px; }
.post-src .li-badge svg { width: 11px; height: 11px; }
.post-text { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.post-text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.post-text .tag { font-weight: 600; }
.more {
  align-self: flex-start; background: none; border: 0; padding: 0;
  color: var(--muted); font: 600 13px/1.4 var(--font-body); cursor: pointer;
}
.more:hover { color: var(--accent); text-decoration: underline; }
.post-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px;
}
.post-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.post-foot a svg { width: 14px; height: 14px; }
.post-foot time { color: var(--muted); font-variant-numeric: tabular-nums; }
.show-all { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.posts-empty { color: var(--muted); font-size: 14px; }

/* ---------- Experience timeline ---------- */
.xp { display: grid; gap: 0; }
.xp-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.xp-item:first-of-type { border-top: 0; padding-top: 8px; }
.xp-item h3 { font-size: 16px; font-weight: 600; }
.xp-meta { color: var(--muted); font-size: 14px; margin: 0; }
.xp-meta.org-line { color: var(--fg); }
.xp-item ul { margin: 8px 0 0; padding-left: 18px; max-width: 72ch; }
.xp-item li { margin-bottom: 4px; font-size: 14px; }
.xp-item p.desc { margin: 8px 0 0; font-size: 14px; max-width: 72ch; }
.roles { list-style: none; margin: 12px 0 0; padding: 0; }
.roles > li { position: relative; padding: 0 0 16px 22px; margin: 0; }
.roles > li::before {
  content: ""; position: absolute; left: 3px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint);
}
.roles > li::after {
  content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: var(--line);
}
.roles > li:last-child { padding-bottom: 0; }
.roles > li:last-child::after { display: none; }
.roles h4 { margin: 0; font-size: 15px; font-weight: 600; }
.roles ul { margin-top: 6px; }
.skills-line { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.skills-line b { color: var(--fg); font-weight: 600; }
.earlier { margin-top: 4px; }
.earlier summary {
  cursor: pointer; font-weight: 600; color: var(--muted); font-size: 15px;
  padding: 12px 0 4px; border-top: 1px solid var(--line); list-style: none;
}
.earlier summary::-webkit-details-marker { display: none; }
.earlier summary::after { content: " ▾"; }
.earlier[open] summary::after { content: " ▴"; }
.earlier summary:hover { color: var(--accent); }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 0; }
.project { padding: 16px 0; border-top: 1px solid var(--line); }
.project:first-child { border-top: 0; padding-top: 8px; }
.project h3 { font-size: 16px; font-weight: 600; }
.project .xp-meta { margin-top: 2px; }
.project p { margin: 8px 0 0; font-size: 14px; max-width: 72ch; }
.project .impact { color: var(--fg); }
.project .impact b { font-weight: 600; }
.tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tech .chip { font-family: var(--font-mono); font-size: 12px; padding: 2px 10px; }

/* ---------- Simple lists (certs, education, volunteering) ---------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 4px; }
.row h3 { font-size: 15px; font-weight: 600; }
.row p { margin: 2px 0 0; font-size: 14px; }
.status {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  vertical-align: 2px; border: 1px solid currentColor;
}
.status.prog { color: var(--warn); }
.status.held { color: var(--muted); }

/* ---------- Sidebar ---------- */
.aside .card { padding: 16px; }
.aside h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.connect { display: grid; gap: 10px; }
.connect-link {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--fg);
}
.connect-link:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.connect-link .logo {
  width: 40px; height: 40px; border-radius: 6px; background: #0a66c2;
  display: grid; place-items: center;
}
.connect-link .logo svg { width: 22px; height: 22px; fill: #ffffff; }
.connect-link .logo.web { background: var(--chip); }
.connect-link .logo.web svg { fill: none; stroke: var(--fg); stroke-width: 1.8; }
.connect-link strong { display: block; font-size: 14px; line-height: 1.3; }
.connect-link span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-groups { display: grid; gap: 14px; }
.skill-groups h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.skill-groups .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-groups .chip { font-size: 12px; padding: 3px 10px; }
.company { display: grid; gap: 10px; }
.company-top { display: flex; gap: 10px; align-items: center; }
.company-top > div strong { display: block; font-size: 15px; line-height: 1.3; }
.company-top > div span { display: block; font-size: 12px; color: var(--muted); }
.company p { margin: 0; font-size: 13px; color: var(--muted); }
.company .btn { justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  max-width: 1128px; margin: 0 auto;
  padding-block: 8px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; align-items: center;
  color: var(--muted); font-size: 13px;
}
.footer a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.footer a:hover { color: var(--accent); }
.footer .li-badge { width: 16px; height: 16px; border-radius: 3px; }
.footer .li-badge svg { width: 10px; height: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}
@media (max-width: 760px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .ident { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .shell { padding-block: 8px 24px; gap: 8px; }
  .card { padding: 16px; }
  .profile { padding: 0; }
  .profile-body { padding: 0 16px 20px; }
  .banner { height: 120px; }
  .avatar { width: 112px; height: 112px; margin-top: -72px; }
  .ident h1 { font-size: 22px; }
  .headline { font-size: 15px; }
  .btn { height: 34px; padding: 0 14px; font-size: 14px; }
  .xp-item, .row { grid-template-columns: 40px minmax(0, 1fr); }
  .mono { width: 40px; height: 40px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
