/* ---------- Homepage ---------- */

:root {
  --home-ink: #23272f;
  --home-muted: #68707c;
  --home-faint: #a3abb6;
  --home-paper: #fcfbf7;
  --home-accent: #3b6ef5;
  --home-accent-2: #14b8a6;
  --home-card: rgba(255, 255, 255, 0.62);
  --home-border: rgba(35, 39, 47, 0.12);
  --home-glow: rgba(59, 110, 245, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --home-ink: #e7e6e3;
    --home-muted: #9ba3ae;
    --home-faint: #68707c;
    --home-paper: #16181c;
    --home-accent: #7ea2ff;
    --home-accent-2: #4fd1c5;
    --home-card: rgba(255, 255, 255, 0.035);
    --home-border: rgba(255, 255, 255, 0.11);
    --home-glow: rgba(126, 162, 255, 0.16);
  }
}

body:has(.home) {
  margin: 0;
  background: var(--home-paper);
  color: var(--home-ink);
}

body:has(.home) #grid-wrapper {
  display: block;
  padding: 0 1.25rem;
}

body:has(.home) #grid-wrapper > article {
  max-width: 100%;
  font-size: 100%;
}

/* 鼠标悬停时不要给整篇文章容器着色 */
body:has(.home) article section.block:hover {
  background-color: transparent;
}

/* Hide the default article chrome on the landing page */
body:has(.home) article > section.block#index > details > summary,
body:has(.home) article > section.block + section.block,
body:has(.home) footer {
  display: none;
}

.home {
  max-width: 46rem;
  margin: 0 auto;
  padding: 9vh 0 5rem;
  font-family: "霞鹜文楷", "LXGW WenKai", "Noto Sans SC", serif;
  line-height: 1.9;
}

/* ---------- Hero ---------- */

.home .hero {
  position: relative;
  isolation: isolate;
  text-align: center;
  padding: 3vh 0 3.5rem;
  animation: home-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.home .hero::before {
  content: "";
  position: absolute;
  inset: -6% 6% auto 6%;
  height: 20rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, var(--home-glow), transparent 72%),
    radial-gradient(
      closest-side at 70% 42%,
      rgba(20, 184, 166, 0.12),
      transparent 72%
    );
  filter: blur(18px);
}

.home .hero-kicker {
  font-family: "Inria Sans", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--home-faint);
  margin-bottom: 1.3rem;
}

.home .hero-name {
  font-size: clamp(3.2rem, 11vw, 6.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(
    110deg,
    var(--home-ink) 8%,
    var(--home-accent) 55%,
    var(--home-accent-2) 96%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 32px var(--home-glow));
}

.home .hero-tagline {
  margin-top: 1.15rem;
  font-size: 1.05rem;
  letter-spacing: 0.32em;
  color: var(--home-muted);
}

.home .hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.6rem;
  padding: 0.32rem 0.9rem;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--home-muted);
  background: var(--home-card);
}

.home .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: home-pulse 2.4s ease-out infinite;
}

.home .hero::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 2.4rem auto 0;
  background: linear-gradient(90deg, transparent, var(--home-faint), transparent);
}

/* ---------- Intro ---------- */

.home .intro {
  max-width: 34rem;
  margin: 0 auto 4.5rem;
  text-align: center;
  font-size: 1.06rem;
  color: var(--home-muted);
  animation: home-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.08s both;
}

.home .intro p {
  margin: 0;
}

/* ---------- Sections ---------- */

.home .section {
  margin-bottom: 3.4rem;
  animation: home-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.home .section-label {
  padding-bottom: 0.55rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--home-border);
  font-family: "Inria Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--home-faint);
}

.home .prose {
  font-size: 1.05rem;
  line-height: 2.05;
  color: var(--home-ink);
}

.home .prose p {
  margin: 0 0 0.8em;
}

.home .prose p:last-child {
  margin-bottom: 0;
}

/* ---------- Link cards ---------- */

.home .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.9rem;
}

.home .card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--home-border);
  border-radius: 10px;
  background: var(--home-card);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, background 0.25s ease;
}

.home .card:hover {
  transform: translateY(-3px);
  border-color: var(--home-accent);
  box-shadow: 0 14px 34px var(--home-glow);
}

.home .card-kicker {
  font-family: "Inria Sans", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--home-faint);
}

.home .card-title {
  font-size: 1.16rem;
  font-weight: 700;
}

.home .card-desc {
  font-size: 0.86rem;
  color: var(--home-muted);
  overflow-wrap: anywhere;
}

/* ---------- Posts ---------- */

.home .posts {
  display: grid;
  gap: 0.8rem;
}

.home .post {
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--home-border);
  transition: border-color 0.25s ease, background 0.25s ease,
    padding-left 0.25s ease;
}

.home .post:hover {
  padding-left: 1.5rem;
  border-left-color: var(--home-accent);
  background: var(--home-card);
}

.home .post-title {
  font-size: 1.12rem;
  font-weight: 700;
}

.home .post-title .link.local,
.home .post-title a {
  color: inherit;
  text-decoration: none;
}

.home .post:hover .post-title a {
  color: var(--home-accent);
}

.home .post-desc {
  font-size: 0.9rem;
  color: var(--home-muted);
}

/* ---------- Friends ---------- */

.home .friends {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.home .friend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--home-border);
  border-radius: 10px;
  background: var(--home-card);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.home .friend:hover {
  transform: translateY(-2px);
  border-color: var(--home-accent);
  box-shadow: 0 10px 26px var(--home-glow);
}

.home .friend-name {
  font-size: 1rem;
  font-weight: 700;
}

.home .friend-desc {
  font-size: 0.78rem;
  color: var(--home-muted);
  white-space: nowrap;
}

/* ---------- End card ---------- */

.home .end-card {
  margin-top: 5rem;
  padding: 1.5rem 1.6rem 1.3rem;
  border: 1px solid var(--home-border);
  border-radius: 14px;
  background: var(--home-card);
  animation: home-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.home .end-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home .end-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--home-accent), var(--home-accent-2));
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 22px var(--home-glow);
}

.home .end-info {
  flex: 1;
  min-width: 0;
}

.home .end-name {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
}

.home .end-tag {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--home-muted);
}

.home .end-top {
  flex: none;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--home-muted);
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease,
    background 0.25s ease;
}

.home .end-top:hover {
  color: var(--home-accent);
  border-color: var(--home-accent);
  background: var(--home-card);
}

.home .end-rule {
  height: 1px;
  margin: 1.2rem 0 0.9rem;
  background: var(--home-border);
}

.home .end-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.76rem;
  color: var(--home-faint);
}

.home .end-meta a {
  color: var(--home-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Motion ---------- */

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home .hero,
  .home .intro,
  .home .section {
    animation: none;
  }
  .home .status-dot {
    animation: none;
  }
}

@media (max-width: 640px) {
  .home {
    padding: 3.5rem 0 4rem;
  }
  .home .hero {
    padding-bottom: 2.6rem;
  }
  .home .hero-tagline {
    font-size: 0.95rem;
    letter-spacing: 0.2em;
  }
  .home .intro {
    margin-bottom: 3.2rem;
  }
  .home .section {
    margin-bottom: 2.6rem;
  }
  .home .end-card {
    margin-top: 3.5rem;
    padding: 1.25rem 1.2rem 1.1rem;
  }
  .home .end-profile {
    flex-wrap: wrap;
  }
  .home .end-top {
    margin-left: auto;
  }
  .home .end-meta {
    font-size: 0.72rem;
  }
}
