:root {
  color-scheme: light;
  --ink: #202622;
  --muted: #68716b;
  --line: #d9ded9;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --green: #18724a;
  --green-soft: #e8f3ed;
  --red: #a74436;
  --red-soft: #f8ece9;
  --gold: #80611d;
  --gold-soft: #f7f0dc;
  --blue: #315f7d;
  --blue-soft: #e9f1f6;
  --shadow: 0 6px 18px rgba(29, 42, 33, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
.secondary-action {
  min-height: 38px;
  border-radius: 6px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.nav-shell,
.page-shell,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-shell {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.main-nav a,
.account-nav a {
  padding: 20px 12px 17px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active,
.account-nav a:hover,
.account-nav a.active {
  border-color: var(--green);
  color: var(--ink);
}

.account-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.account-nav .nav-register {
  color: var(--green);
  font-weight: 700;
}

.page-shell {
  min-height: calc(100vh - 132px);
  padding: 34px 0 64px;
}

.page-heading,
.person-header,
.timeline-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.page-heading h1,
.person-header h1 {
  margin: 4px 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.page-heading p,
.timeline-heading p,
.person-subtitle {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--green) !important;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-form {
  display: flex;
  width: min(440px, 100%);
}

.search-form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: var(--surface);
  padding: 0 13px;
  color: var(--ink);
}

.search-form input:focus {
  outline: 2px solid rgba(24, 114, 74, 0.2);
  border-color: var(--green);
}

.search-form button,
.follow-button,
.secondary-action,
.primary-link,
.auth-form button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  padding: 0 15px;
  cursor: pointer;
  text-decoration: none;
}

.search-form button {
  border-radius: 0 6px 6px 0;
}

.follow-button.following {
  background: var(--surface);
  color: var(--green);
}

.follow-login-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.follow-button:hover,
.secondary-action:hover {
  filter: brightness(0.94);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.people-categories {
  display: grid;
  gap: 38px;
}

.people-category {
  min-width: 0;
  scroll-margin-top: 88px;
}

.category-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
}

.category-heading h2 {
  margin: 0;
  font-size: 21px;
}

.category-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.category-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.category-heading > a {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.search-results .category-heading {
  margin-bottom: 18px;
}

.person-card {
  min-width: 0;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.person-main {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.avatar,
.mini-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #c7d7cd;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 7px;
}

.avatar-large {
  width: 68px;
  height: 68px;
  font-size: 20px;
}

.person-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.person-copy strong {
  overflow-wrap: anywhere;
}

.person-copy span,
.person-role,
.alias-preview {
  color: var(--muted);
  font-size: 13px;
}

.person-role {
  min-height: 40px;
  margin: 15px 0 12px;
  line-height: 1.5;
}

.person-meta,
.event-footer,
.event-topline,
.person-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.person-meta {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
}

.person-card-footer {
  margin-top: auto;
  padding-top: 16px;
}

.alias-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 4px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.tag-project {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-asset {
  background: var(--gold-soft);
  color: var(--gold);
}

.person-header {
  align-items: center;
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--line);
}

.person-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.follow-button-large {
  min-width: 92px;
}

.profile-facts {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.profile-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-facts p {
  margin: 7px 0 0;
  line-height: 1.55;
}

.timeline-heading {
  margin: 30px 0 18px;
}

.timeline-heading h2,
.date-group > h2 {
  margin: 0;
  font-size: 18px;
}

.timeline {
  display: grid;
  gap: 26px;
}

.date-group {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.date-group > h2 {
  position: sticky;
  top: 88px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 14px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event-person_direct .event-rail {
  background: var(--green);
}

.event-person_news .event-rail {
  background: var(--red);
}

.event-org_project_related .event-rail {
  background: var(--gold);
}

.event-body {
  min-width: 0;
  padding: 16px 18px 15px;
}

.event-topline {
  color: var(--muted);
  font-size: 12px;
}

.event-labels {
  display: flex;
  align-items: center;
  gap: 9px;
}

.event-type {
  font-weight: 800;
}

.event-person {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.event-main-text {
  display: -webkit-box;
  margin: 11px 0 0;
  overflow: hidden;
  color: #3d4740;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.event-main-text.expanded {
  display: block;
}

.event-text-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 28px;
  margin-top: 5px;
}

.summary-toggle {
  min-height: 28px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  cursor: pointer;
  font-size: 12px;
}

.translation-toggle {
  min-height: 28px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.project-note {
  margin: 12px 0 0;
  border-left: 3px solid #c7a34a;
  background: var(--gold-soft);
  padding: 8px 10px;
  color: #654b14;
  font-size: 12px;
  line-height: 1.5;
}

.event-card .tag-row {
  margin-top: 12px;
}

.event-footer {
  margin-top: 14px;
  border-top: 1px solid #edf0ed;
  padding-top: 11px;
  color: var(--muted);
  font-size: 12px;
}

.event-footer a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.following-heading {
  align-items: center;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
}

.following-strip {
  display: flex;
  gap: 8px;
  margin: -5px 0 26px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.following-strip a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 7px 10px;
  text-decoration: none;
  font-size: 13px;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 10px;
}

.empty-state {
  border: 1px dashed #bcc5be;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
  padding: 42px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.empty-state a {
  color: var(--green);
  font-weight: 700;
}

.notice {
  margin-bottom: 20px;
  border-radius: 6px;
  padding: 11px 13px;
  font-size: 13px;
}

.notice-warning {
  border: 1px solid #e6cc87;
  background: var(--gold-soft);
  color: #664d16;
}

.notice-plan {
  border: 1px solid #b9d0c1;
  background: var(--green-soft);
  color: #28513a;
}

.empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.empty-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 15px;
  text-decoration: none;
}

.primary-link {
  color: #fff !important;
}

.auth-shell {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 44px;
  margin: 44px auto;
  align-items: start;
}

.auth-copy h1 {
  margin: 5px 0 10px;
  font-size: 32px;
}

.auth-copy p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-form label {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}

.auth-form input:focus {
  outline: 2px solid rgba(24, 114, 74, 0.2);
  border-color: var(--green);
}

.auth-form button {
  margin-top: 10px;
}

.auth-form > p,
.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.auth-form > p {
  margin: 7px 0 0;
}

.auth-form a {
  color: var(--green);
  font-weight: 700;
}

.form-error {
  border: 1px solid #e1b3aa;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.account-grid > div,
.account-note {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 18px;
}

.account-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.account-grid strong {
  font-size: 18px;
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.account-note {
  margin-top: 20px;
}

.account-note h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.account-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100% - 40px));
  transform: translateY(20px);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 11px 14px;
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-facts {
    grid-template-columns: 1fr 1fr;
  }

  .date-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .date-group > h2 {
    position: static;
  }
}

@media (max-width: 620px) {
  .nav-shell,
  .page-shell,
  .site-footer {
    width: min(100% - 22px, 1120px);
  }

  .nav-shell {
    min-height: 58px;
    gap: 10px;
  }

  .brand span:last-child {
    display: none;
  }

  .main-nav a {
    padding: 17px 8px 14px;
    font-size: 13px;
  }

  .account-nav a {
    padding: 17px 5px 14px;
    font-size: 12px;
  }

  .page-shell {
    padding-top: 24px;
  }

  .page-heading,
  .person-header,
  .timeline-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .page-heading h1,
  .person-header h1 {
    font-size: 27px;
  }

  .search-form {
    width: 100%;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 12px auto;
  }

  .account-grid {
    grid-template-columns: 1fr 1fr;
  }

  .person-card {
    min-height: 220px;
  }

  .person-header {
    position: relative;
  }

  .person-identity {
    align-items: flex-start;
  }

  .follow-button-large {
    width: 100%;
  }

  .profile-facts {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .event-body {
    padding: 14px;
  }

  .event-topline,
  .event-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
  }
}
