/* ── Theme ──────────────────────────────── */
:root {
  --bg: #f6f4f1;
  --text: #36363d;
  --heading: #2b2b30;
  --link: #111114;
  --muted: #7e7e87;
  --rule: color-mix(in srgb, var(--muted) 30%, transparent);
  --dot: #b8b8be;
  --font: 'Space Grotesk', system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #141416;
  --text: #b9b9c2;
  --heading: #ececf1;
  --link: #ffffff;
  --muted: #6f6f78;
  --dot: #55555c;
}

/* ── Base ───────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

a {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

a:hover { text-decoration: underline; text-underline-offset: 2.5px; }

/* Interactive dot field canvas (drawn by field.js) */
#field { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 450px);
  gap: 65px;
  max-width: 1404px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 32.5px 57.5px;
}

/* ── Header ─────────────────────────────── */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12.5px;
  padding-bottom: 25px;
}

.avatar {
  width: 48.5px;
  height: 48.5px;
  border-radius: 7px;
  object-fit: cover;
}

h1 {
  font-size: 45px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--heading);
}

/* ── Labeled rows ───────────────────────── */
.row {
  display: grid;
  grid-template-columns: 117px 1fr;
  gap: 32.5px;
  padding: 29px 0;
  border-top: 1px solid var(--rule);
}

.row-label {
  color: var(--muted);
  font-size: 14px;
  padding-top: 2.5px;
}

/* ── About ──────────────────────────────── */
.intro p + p { margin-top: 16px; }

/* ── Experience ─────────────────────────── */
.entries { list-style: none; }

.entry {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: start;
}

.entry + .entry { margin-top: 12.5px; }

.entry p { line-height: 1.6; }

.entry-title { color: var(--heading); font-weight: 600; }

.role {
  margin-left: 3.5px;
  color: var(--muted);
  font-size: 13px;
}

.logo {
  width: 34px;
  height: 34px;
  margin-top: 3.5px;
  border-radius: 6.5px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ── Social icons (next to name) ────────── */
.links {
  display: flex;
  align-items: center;
  gap: 14.5px;
  margin-left: 12.5px;
  padding-top: 5.5px;
}

.links .icon {
  display: inline-flex;
  color: var(--muted);
  transition: color 0.15s, transform 0.15s;
}

.links .icon:hover {
  color: var(--heading);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ── Recent Activity feed ───────────────── */
.activity {
  position: sticky;
  top: 32.5px;
  align-self: start;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  border-left: 1px solid var(--rule);
}

.activity h2 {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  padding: 0 21.5px 12.5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
}

.post {
  padding: 16px 21.5px 20px;
  border-bottom: 1px solid var(--rule);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
}

.post-avatar { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; }

.post-author { color: var(--heading); font-weight: 600; }

.post-sep, .post-date { color: var(--muted); }

.post-text {
  margin-top: 9px;
  white-space: pre-line;
  color: var(--text);
}

.post-image {
  display: block;
  width: 100%;
  margin-top: 12.5px;
  border-radius: 12.5px;
  border: 1px solid var(--rule);
}

.post-link {
  display: inline-block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}

.post-link::before { content: '↗ '; }

.post-link:hover { color: var(--heading); }

.feed-message { padding: 16px 21.5px; color: var(--muted); }

/* ── Theme toggle dot ───────────────────── */
.theme-dot {
  position: fixed;
  top: 36px;
  right: 36px;
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--dot);
  cursor: pointer;
}

.theme-dot:focus-visible { outline: 2px solid var(--heading); outline-offset: 2.5px; }

/* ── Small screens ──────────────────────── */
@media (max-width: 1100px) {
  .page { grid-template-columns: 1fr; gap: 0; max-width: 810px; min-height: 0; padding: 32.5px 21.5px 57.5px; }
  .activity { position: static; max-height: none; overflow: visible; padding-top: 29px; border-left: none; border-top: 1px solid var(--rule); }
  .activity h2 { position: static; }
  .activity h2, .post, .feed-message { padding-left: 0; padding-right: 0; }
}

@media (max-width: 700px) {
  .page { padding: 18px 14.5px 43px; }
  .header { padding-right: 21.5px; }
  .avatar { width: 36px; height: 36px; }
  h1 { font-size: 32.5px; }
  .links { flex-basis: 100%; margin-left: 0; padding-top: 0; }
  .row { grid-template-columns: 1fr; gap: 9px; padding: 21.5px 0; }
  .theme-dot { top: 18px; right: 14.5px; }
}
