:root {
  color-scheme: dark;
  --font-ui: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif CJK SC", "Source Han Serif", "SongTi SC", Georgia, serif;
  --bg: #0c0d0d;
  --bg-soft: #111212;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-hover: rgba(255, 255, 255, 0.045);
  --ink: #eeeeee;
  --muted: #a5a5a5;
  --dim: #6f6f6f;
  --line: #343434;
  --line-strong: #626262;
  --chip: #696969;
  --chip-text: #f2f2f2;
  --accent: #ffffff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f9f8f5;
  --bg-soft: #ffffff;
  --panel: #f0efeb;
  --panel-hover: #f5f4f0;
  --ink: #1d1d1b;
  --muted: #5f625d;
  --dim: #8b8c86;
  --line: #a8a69f;
  --line-strong: #a8a69f;
  --name: #c56473;
  --chip: #e3ded4;
  --chip-text: #262622;
  --accent: #111111;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.045), transparent 24rem),
    var(--bg);
  font-family: var(--font-ui);
  font-size: 16px;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.8), transparent 24rem),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.landing-page {
  display: grid;
  place-content: center;
  min-height: 100vh;
}

.landing-shell {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(92vw, 440px);
  padding: 48px 24px;
}

.avatar-link,
.social-icon,
.site-card,
.repo-card {
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.avatar-link {
  border-radius: 50%;
}

.avatar-link:hover {
  transform: translateY(-4px);
}

.avatar {
  display: block;
  width: 168px;
  height: 168px;
  border: 0;
  border-radius: 0;
  background: #f5f5f5;
  object-fit: cover;
}

.avatar-large {
  width: clamp(150px, 22vw, 190px);
  height: clamp(150px, 22vw, 190px);
}

.nickname {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 8vw, 3.8rem);
  font-weight: 760;
  letter-spacing: 0;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

.social-row.compact {
  max-width: 220px;
}

.social-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  opacity: 0.9;
  border-radius: 8px;
  background-color: var(--card);
  transition: all 0.2s ease;
}

.social-icon:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.social-icon i {
  font-size: 18px;
  line-height: 1;
}

.social-icon.github {
  background-color: #24292e;
  color: #ffffff;
}

.social-icon.mastodon {
  background-color: #6364ff;
  color: #ffffff;
}

.social-icon.mail {
  background-color: #ea4335;
  color: #ffffff;
}

.social-icon.rss {
  background-color: #f26522;
  color: #ffffff;
}

.profile-shell {
  display: grid;
  gap: 48px;
  width: min(1080px, calc(100% - 120px));
  margin: 0 auto;
  padding: 48px 0 40px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

.identity-panel,
.intro-panel,
.section-band {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.identity-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.identity-name {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.2;
}

.intro-panel {
  display: grid;
  align-content: center;
  max-width: 860px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.intro-panel .eyebrow {
  display: none;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.intro-panel p:last-child {
  max-width: 74ch;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  font-weight: 650;
  line-height: 1.5;
}

.intro-panel p:last-child::after {
  content: "// Building quietly, shipping thoughtfully...";
  display: block;
  margin-top: 16px;
  color: var(--dim);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 650;
}

.section-band {
  padding: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.section-heading h2 {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 780;
  text-transform: uppercase;
}

.text-link {
  color: var(--dim);
  font-size: 0.9rem;
  font-weight: 700;
}

.text-link:hover {
  color: var(--ink);
}

.memos-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.memo-card,
.repo-card {
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.jump-section {
  cursor: pointer;
}

.jump-section:hover .memo-card,
.jump-section:hover .repo-card {
  border-left-color: var(--ink);
}

.memo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: start;
  min-height: 37px;
  padding: 0 0 0 8px;
}

.memo-card p {
  display: block;
  min-height: 0;
  margin: 0;
  overflow: visible;
  max-width: 120ch;
  color: var(--muted);
  font-family: "SongTi SC", var(--font-serif);
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.55;
  word-wrap: break-word;
  word-break: break-all;
}

.memo-card time {
  justify-self: end;
  color: var(--dim);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
  white-space: nowrap;
}

.site-grid,
.repo-grid {
  display: grid;
  gap: 20px 48px;
}

.site-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  outline: none;
}

.site-card {
  display: grid;
  align-content: start;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.site-card:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  transform: translateY(-2px);
}

.repo-card:hover {
  border-color: var(--ink);
  transform: translateX(3px);
}

.site-card span,
.repo-card strong {
  overflow-wrap: anywhere;
  color: var(--name, var(--ink));
  font-size: 1.08rem;
  font-weight: 780;
  line-height: 1.35;
}

.site-card p,
.repo-card p {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 620;
  line-height: 1.55;
}

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

.repo-card {
  display: grid;
  min-height: 122px;
  padding: 2px 0 2px 20px;
}

.repo-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  align-self: end;
  gap: 8px;
  margin-top: 14px;
  color: transparent;
  font-size: 0;
}

.repo-meta::first-letter {
  color: transparent;
}

.repo-meta {
  color: var(--chip-text);
}

.repo-meta {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--chip);
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  background: linear-gradient(90deg, #151515, #222222, #151515);
  background-size: 240% 100%;
  animation: loading 1.3s ease-in-out infinite;
}

.link-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.link-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
  opacity: 0.48;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.link-dot:hover,
.link-dot.is-active {
  background: var(--ink);
  opacity: 1;
  transform: scale(1.25);
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(1080px, calc(100% - 120px));
  margin: 0 auto;
  padding: 12px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.site-footer p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.7;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--muted);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.progress-with-labels {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-container {
  width: 300px;
  height: 12px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--dim);
  text-align: center;
}

.progress-top-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.progress-bottom-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.progress-start-date,
.progress-end-date {
  font-size: 0.72rem;
  color: var(--dim);
  white-space: nowrap;
}

.site-age-inline {
  font-size: 0.78rem;
  color: var(--dim);
  margin: 4px 0 0;
}

.site-footer .footer-left p:first-child .title-hint {
  cursor: default;
  user-select: none;
}

@keyframes loading {
  to {
    background-position: -240% 0;
  }
}

@media (max-width: 900px) {
  .profile-shell {
    width: min(100% - 44px, 680px);
    gap: 56px;
    padding: 54px 0 64px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    justify-items: start;
  }

  .identity-panel {
    justify-items: start;
  }

  .social-row {
    justify-content: flex-start;
  }

  .memos-list,
  .site-grid,
  .repo-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer {
    width: min(100% - 44px, 680px);
  }
}

@media (max-width: 520px) {
  .profile-shell {
    width: min(100% - 28px, 460px);
    padding-top: 38px;
  }

  .avatar {
    width: 132px;
    height: 132px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 28px, 460px);
    padding-bottom: 34px;
  }
}
