:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #07142f;
  --muted: #5c6f91;
  --border: #c9d7e9;
  --border-strong: #aebfd7;
  --accent: #1185fe;
  --accent-dark: #0069d9;
  --surface-soft: #f7faff;
  --radius: 12px;
  --content-width: 1290px;
  --focus-ring: 0 0 0 4px rgb(17 133 254 / 18%);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.page-shell {
  width: min(100%, calc(var(--content-width) + 144px));
  margin: 0 auto;
  padding: 56px 72px 44px;
}

h1 {
  max-width: 1110px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.15rem, 5vw, 5.05rem);
  font-weight: 400;
  letter-spacing: -0.043em;
  line-height: 1.03;
  text-wrap: balance;
}

.profile-panel {
  overflow: hidden;
  margin-top: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.profile-header {
  display: flex;
  min-height: 208px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 40px;
  border-bottom: 1px solid var(--border);
}

.profile-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 34px;
}

.profile-copy {
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-soft);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-large {
  width: 142px;
  height: 142px;
  border: 3px solid var(--background);
  outline: 2px solid var(--border);
}

.avatar-small {
  width: 70px;
  height: 70px;
}

.profile-name {
  overflow: hidden;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle {
  overflow: hidden;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bluesky-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 1.43rem;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.butterfly {
  width: 38px;
  height: 32px;
  fill: currentColor;
}

.feed {
  padding: 0 40px;
}

.post-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 26px;
  padding: 24px 0;
  color: inherit;
  text-decoration: none;
}

.post-row + .post-row {
  border-top: 1px solid var(--border);
}

a.post-row {
  transition: background-color 160ms ease;
}

a.post-row:hover {
  background: var(--surface-soft);
}

a.post-row:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.post-content {
  min-width: 0;
  align-self: center;
}

.post-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 9px;
  line-height: 1.35;
}

.post-author {
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
}

.post-handle,
.post-date,
.post-separator {
  color: var(--muted);
  font-size: 0.98rem;
}

.post-handle {
  overflow: hidden;
  max-width: min(100%, 390px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.27rem;
  line-height: 1.5;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.feed-message {
  display: flex;
  min-height: 224px;
  align-items: center;
  justify-content: center;
  padding: 34px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.feed-message a {
  color: var(--accent-dark);
  font-weight: 680;
  text-underline-offset: 4px;
}

.bluesky-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 42px;
  padding: 20px 28px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 1.18rem;
  font-weight: 560;
  line-height: 1;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.bluesky-link svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bluesky-link:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.bluesky-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.wikipedia-panel {
  margin-top: 58px;
  padding-top: 42px;
  border-top: 1px solid var(--border);
}

.section-eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wikipedia-panel h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 3.4vw, 3.15rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.wikipedia-intro {
  max-width: 880px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.68;
}

.topic-links {
  display: flex;
  max-width: 1080px;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0 0;
  padding: 0;
  list-style: none;
}

.topic-links a {
  display: block;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.topic-links a:hover {
  border-color: var(--border-strong);
  background: #eef5ff;
  color: var(--accent-dark);
}

.topic-links a:focus-visible,
.wikipedia-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.wikipedia-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 27px;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.4;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.wikipedia-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 27px;
}

.wikipedia-actions .wikipedia-link {
  margin-top: 0;
}

.wikipedia-source-link {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.wikipedia-source-link:hover {
  color: var(--accent-dark);
}

.wikipedia-link svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.contributions-shell {
  width: min(100%, calc(var(--content-width) + 144px));
  margin: 0 auto;
  padding: 48px 72px 64px;
}

.back-link {
  display: inline-block;
  margin-bottom: 42px;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 680;
  text-underline-offset: 5px;
}

.contributions-shell h1 {
  max-width: 980px;
  font-size: clamp(3rem, 5vw, 4.75rem);
}

.contributions-lede {
  max-width: 940px;
  margin: 28px 0 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.72rem);
  line-height: 1.5;
}

.source-note {
  max-width: 900px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.source-note a,
.contributions-footer a {
  color: var(--accent-dark);
  text-underline-offset: 4px;
}

.article-groups {
  display: grid;
  gap: 46px;
  margin-top: 62px;
}

.contribution-group {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.contribution-group h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 2.7vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.027em;
  line-height: 1.15;
}

.article-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.article-index li {
  border-bottom: 1px solid #e5edf7;
}

.article-index a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.42;
  text-decoration: none;
}

.article-index a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-index a:focus-visible,
.back-link:focus-visible,
.wikipedia-source-link:focus-visible {
  border-radius: 3px;
  outline: none;
  box-shadow: var(--focus-ring);
}

.contributions-footer {
  margin-top: 66px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.6;
}

.contributions-footer p {
  margin: 0 0 8px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #edf3fa;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 72%), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

.skeleton-name {
  width: 190px;
  height: 34px;
  border-radius: 4px;
}

.skeleton-handle {
  width: 315px;
  max-width: 52vw;
  height: 22px;
  margin-top: 12px;
  border-radius: 4px;
}

.skeleton-line {
  width: 90%;
  height: 18px;
  margin: 11px 0;
  border-radius: 3px;
}

.skeleton-line-short {
  width: 48%;
}

.skeleton-line-medium {
  width: 68%;
}

.noscript-note {
  margin: 18px 0 0;
  color: var(--muted);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 850px) {
  .page-shell {
    padding: 42px 32px 38px;
  }

  h1 {
    font-size: clamp(2.7rem, 8vw, 4.4rem);
  }

  .profile-panel {
    margin-top: 40px;
  }

  .profile-header {
    min-height: 170px;
    padding: 24px 28px;
  }

  .profile-identity {
    gap: 24px;
  }

  .avatar-large {
    width: 112px;
    height: 112px;
  }

  .profile-name {
    font-size: 1.65rem;
  }

  .profile-handle {
    font-size: 1.05rem;
  }

  .bluesky-brand span {
    display: none;
  }

  .feed {
    padding: 0 28px;
  }

  .contributions-shell {
    padding: 42px 32px 52px;
  }

  .article-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 30px 18px 34px;
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
    letter-spacing: -0.04em;
    line-height: 1.04;
    text-wrap: pretty;
  }

  .profile-panel {
    margin-top: 32px;
  }

  .profile-header {
    min-height: 132px;
    gap: 16px;
    padding: 20px;
  }

  .profile-identity {
    gap: 16px;
  }

  .avatar-large {
    width: 78px;
    height: 78px;
    border-width: 2px;
    outline-width: 1px;
  }

  .profile-name {
    margin-bottom: 4px;
    font-size: 1.25rem;
  }

  .profile-handle {
    max-width: 45vw;
    font-size: 0.87rem;
  }

  .butterfly {
    width: 29px;
    height: 25px;
  }

  .feed {
    padding: 0 20px;
  }

  .post-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 0;
  }

  .avatar-small {
    width: 46px;
    height: 46px;
  }

  .post-meta {
    gap: 5px;
    margin-bottom: 6px;
  }

  .post-author,
  .post-handle,
  .post-date,
  .post-separator {
    font-size: 0.78rem;
  }

  .post-handle {
    max-width: 52vw;
  }

  .post-text {
    font-size: 1.05rem;
    line-height: 1.45;
  }

  .feed-message {
    min-height: 176px;
  }

  .bluesky-link {
    width: 100%;
    justify-content: center;
    margin-top: 28px;
    padding: 18px 24px;
  }

  .wikipedia-panel {
    margin-top: 44px;
    padding-top: 32px;
  }

  .wikipedia-intro {
    font-size: 1rem;
  }

  .topic-links {
    gap: 8px;
    margin-top: 21px;
  }

  .topic-links a {
    padding: 8px 11px;
    font-size: 0.82rem;
  }

  .wikipedia-link {
    align-items: flex-start;
  }

  .wikipedia-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .contributions-shell {
    padding: 30px 18px 44px;
  }

  .back-link {
    margin-bottom: 32px;
  }

  .contributions-shell h1 {
    font-size: clamp(2.45rem, 11vw, 3.4rem);
  }

  .contributions-lede {
    margin-top: 22px;
    font-size: 1.18rem;
  }

  .article-groups {
    gap: 38px;
    margin-top: 48px;
  }

  .contribution-group {
    padding-top: 26px;
  }

  .article-index {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .article-index a {
    padding: 11px 0;
    font-size: 0.91rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
