/* ==========================================================================
   Koharu — Pages
   Timeline, category tree, tag cloud, friends, 404, TOC, comments.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared page chrome
   -------------------------------------------------------------------------- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.section-heading > span {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.archive-desc {
  margin-bottom: 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  transition: color var(--duration-ui) var(--ease-out), background var(--duration-ui) var(--ease-out);
}

.breadcrumb a:hover {
  color: hsl(var(--shoka-blue));
}

.breadcrumb a.is-current {
  padding: 0.25rem 0.625rem;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.breadcrumb a.is-current:hover {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
}

.breadcrumb svg {
  height: 1rem;
  width: 1rem;
}

.min-w-0 {
  min-width: 0;
}

.page-cover {
  margin: 0;
}

.page-cover img {
  width: 100%;
  border-radius: 0.5rem;
}

/* --------------------------------------------------------------------------
   Timeline (Shoka dot-and-line)
   -------------------------------------------------------------------------- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-year {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.timeline-year span {
  margin-left: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.timeline-group {
  display: flex;
  flex-direction: column;
}

.timeline-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  line-height: 2.25rem;
  border-radius: 0.375rem;
  transition: background var(--duration-ui) var(--ease-out);
}

.timeline-row:hover {
  background: hsl(var(--primary) / 0.05);
}

.dark .timeline-row:hover {
  background: hsl(var(--primary) / 0.1);
}

/* The dot. */
.timeline-row::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 50%;
  height: 0.5rem;
  width: 0.5rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: hsl(var(--primary));
}

/* The connector line. */
.timeline-row::after {
  content: "";
  position: absolute;
  left: 0.3125rem;
  top: 1.75rem;
  height: 3.375rem;
  width: 2px;
  background: hsl(var(--primary) / 0.4);
}

.timeline-row:last-child::after {
  display: none;
}

.timeline-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.timeline-cat {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  transition: color var(--duration-ui) var(--ease-out);
}

.timeline-cat:hover {
  color: hsl(var(--shoka-blue));
}

.timeline-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: hsl(var(--primary));
  transition: color var(--duration-ui) var(--ease-out);
}

.timeline-title:hover {
  color: hsl(var(--shoka-blue));
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 0.35em;
}

/* --------------------------------------------------------------------------
   Category tree
   -------------------------------------------------------------------------- */
.category-tree {
  display: flex;
  flex-direction: column;
}

.category-node {
  margin-bottom: 1rem;
}

.category-title,
.category-subtitle,
.category-row {
  position: relative;
  margin: 0;
  padding: 0.5rem 1.75rem;
  border-radius: 0.375rem;
  font-weight: 700;
}

.category-title {
  font-size: 1.5rem;
  line-height: 2.25rem;
}

.category-subtitle {
  font-size: 1.125rem;
  line-height: 2.25rem;
}

.category-row {
  font-size: 1rem;
  font-weight: 400;
  line-height: 2.25rem;
  color: hsl(var(--primary));
}

.category-title a,
.category-subtitle a,
.category-row a {
  transition: color var(--duration-ui) var(--ease-out);
}

.category-title a:hover,
.category-subtitle a:hover,
.category-row a:hover {
  color: hsl(var(--shoka-blue));
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 0.35em;
}

.category-title span,
.category-subtitle span,
.category-row span {
  margin-left: 0.25rem;
  font-size: 0.8em;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

/* Hollow ring dot on headings. */
.category-title::before,
.category-subtitle::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 50%;
  height: 0.875rem;
  width: 0.875rem;
  transform: translateY(-50%);
  border: 2px solid hsl(var(--primary));
  border-radius: 50%;
  background: var(--gradient-bg-start);
}

/* Solid dot on rows. */
.category-row::before {
  content: "";
  position: absolute;
  left: 0.3125rem;
  top: 50%;
  height: 0.5rem;
  width: 0.5rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: hsl(var(--primary));
}

/* Dashed connector below headings that have children. */
.category-title.has-children::after,
.category-subtitle.has-children::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 2.75rem;
  height: 3.875rem;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    hsl(351 77% 62% / 0.7) 0,
    hsl(351 77% 62% / 0.7) 4px,
    transparent 4px,
    transparent 12px
  );
}

.category-children {
  margin-left: 1.5rem;
}

/* --------------------------------------------------------------------------
   Tag cloud
   -------------------------------------------------------------------------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.tag-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: transform var(--duration-ui) var(--ease-out), box-shadow var(--duration-ui) var(--ease-out);
}

.tag-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.tag-pill__count {
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.1);
  font-size: 0.75rem;
}

.tag-pill.tone-blue {
  background: linear-gradient(to right, rgb(96 165 250 / 0.1), rgb(147 197 253 / 0.1));
  color: rgb(96 165 250 / 0.7);
}

.tag-pill.tone-blue:hover {
  background: linear-gradient(to right, rgb(96 165 250 / 0.8), rgb(147 197 253 / 0.8));
  color: #eff6ff;
}

.tag-pill.tone-pink {
  background: linear-gradient(to right, rgb(249 168 212 / 0.1), rgb(254 205 211 / 0.1));
  color: rgb(244 114 182 / 0.7);
}

.tag-pill.tone-pink:hover {
  background: linear-gradient(to right, rgb(249 168 212 / 0.8), rgb(254 205 211 / 0.8));
  color: #fdf2f8;
}

.tag-pill.tone-violet {
  background: linear-gradient(to right, rgb(167 139 250 / 0.1), rgb(216 180 254 / 0.1));
  color: rgb(167 139 250 / 0.7);
}

.tag-pill.tone-violet:hover {
  background: linear-gradient(to right, rgb(167 139 250 / 0.8), rgb(216 180 254 / 0.8));
  color: #f5f3ff;
}

.tag-pill.tone-sky {
  background: linear-gradient(to right, rgb(56 189 248 / 0.1), rgb(147 197 253 / 0.1));
  color: rgb(56 189 248 / 0.7);
}

.tag-pill.tone-sky:hover {
  background: linear-gradient(to right, rgb(56 189 248 / 0.8), rgb(147 197 253 / 0.8));
  color: #f0f9ff;
}

.tag-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 1rem 0 0;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: none;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color var(--duration-ui) var(--ease-out);
}

.tag-toggle:hover {
  color: hsl(var(--shoka-blue));
}

.tag-toggle svg {
  height: 1rem;
  width: 1rem;
  transition: transform var(--duration-ui) var(--ease-out);
}

.tag-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Friends
   -------------------------------------------------------------------------- */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 1rem;
}

.friend-card {
  position: relative;
  display: block;
  height: 200px;
  overflow: hidden;
  border-radius: 1rem;
  background: hsl(var(--card));
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  transition: transform var(--duration-ui) var(--ease-out);
}

.friend-card:hover {
  transform: translateY(-4px);
}

.friend-card__band {
  position: absolute;
  inset-inline: 0;
  top: 0;
  display: block;
  height: 4rem;
  background: linear-gradient(to bottom right, var(--friend-color), color-mix(in srgb, var(--friend-color) 50%, transparent));
}

.friend-card__avatar {
  position: absolute;
  top: 2rem;
  left: 50%;
  display: flex;
  height: 3.5rem;
  width: 3.5rem;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  overflow: hidden;
  border: 4px solid hsl(var(--card));
  border-radius: 9999px;
  background: hsl(var(--card));
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  color: var(--friend-color);
}

.friend-card__avatar img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.friend-card__avatar svg {
  height: 1.5rem;
  width: 1.5rem;
}

.friend-card__body {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 6.5rem 0.5rem 0.75rem;
  text-align: center;
}

.friend-card__name {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 700;
}

.friend-card:hover .friend-card__name {
  color: var(--friend-color);
}

.friend-card__site {
  margin-bottom: 0.25rem;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.friend-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground));
}

.friends-apply {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 2px solid hsl(var(--border));
  border-radius: 1.5rem;
}

.friends-apply h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 900;
}

.friends-apply__desc {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.friends-apply__example {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow: auto;
  border-radius: 0.75rem;
  background: hsl(var(--muted) / 0.6);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.error-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 3rem;
  text-align: center;
}

.error-404__code {
  margin: 0;
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.05em;
  background: var(--gradient-pink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-404__message {
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: #999;
}

.dark .error-404__message {
  color: #aaa;
}

.error-404__actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--duration-ui) var(--ease-in-out), box-shadow var(--duration-ui) var(--ease-out),
    background var(--duration-ui) var(--ease-out), color var(--duration-ui) var(--ease-out);
}

.action-btn svg {
  height: 1.1rem;
  width: 1.1rem;
}

.action-btn--primary {
  background: linear-gradient(135deg, #ed6ea0 0%, #ec8c69 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgb(237 110 160 / 0.25);
}

.action-btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgb(237 110 160 / 0.35);
}

.action-btn:not(.action-btn--primary) {
  background: rgb(237 110 160 / 0.06);
  border: 2px solid rgb(237 110 160 / 0.25);
  color: #ed6ea0;
}

.action-btn:not(.action-btn--primary):hover {
  transform: translateY(-2px);
  background: rgb(237 110 160 / 0.12);
}

.error-404__search {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 24rem;
}

/* --------------------------------------------------------------------------
   Search form (inline)
   -------------------------------------------------------------------------- */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form .search-field {
  flex: 1;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Table of contents
   -------------------------------------------------------------------------- */
.toc {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.25rem;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

.toc.has-toc,
.toc.is-empty {
  display: flex;
}

.toc-title {
  margin: 0 0 0.25rem;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.toc-list {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.toc-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.5rem;
  /* The active/hover marker is a left border in the source. Declared here as
     transparent so switching it on colours a line that already occupies space
     instead of nudging the text 2px sideways. */
  border-left: 2px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.625;
  transition: background var(--duration-tween, 200ms) var(--ease-out), color var(--duration-tween, 200ms) var(--ease-out),
    border-color var(--duration-tween, 200ms) var(--ease-out);
}

/* Indent by outline depth: 0.75rem at the top level, +1rem per level below it,
   matching the source's HeadingTreeItem. */
.toc-link[data-level="2"] {
  padding-left: 0.75rem;
}

.toc-link[data-level="3"] {
  padding-left: 1.75rem;
}

.toc-link[data-level="4"] {
  padding-left: 2.75rem;
}

.toc-link:hover {
  background: hsl(var(--foreground) / 0.05);
  border-left-color: currentColor;
}

.toc-link.is-active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-weight: 500;
  border-left-color: hsl(var(--primary));
}

.toc-link .toc-text {
  display: block;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-link.is-active .toc-text::after {
  content: "•";
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

/* CSS-counter numbering, hierarchical: 1. / 1.1. / 1.1.1.
   Driven by [data-level], which the TOC builder already writes on every link.
   The links are flat siblings rather than nested, but a counter reset on a
   parent scopes to the whole following-sibling run, so each level's reset
   lands on the next heading of that level without any nesting. */
.toc-numbering {
  counter-reset: koharu-h2;
}

.toc-numbering .toc-link[data-level="2"] {
  counter-increment: koharu-h2;
  counter-reset: koharu-h3;
}

.toc-numbering .toc-link[data-level="2"]::before {
  content: counter(koharu-h2) ". ";
}

.toc-numbering .toc-link[data-level="3"] {
  counter-increment: koharu-h3;
  counter-reset: koharu-h4;
}

.toc-numbering .toc-link[data-level="3"]::before {
  content: counter(koharu-h2) "." counter(koharu-h3) ". ";
}

.toc-numbering .toc-link[data-level="4"] {
  counter-increment: koharu-h4;
}

.toc-numbering .toc-link[data-level="4"]::before {
  content: counter(koharu-h2) "." counter(koharu-h3) "." counter(koharu-h4) ". ";
}

.toc-numbering .toc-link::before {
  display: inline-block;
  margin-right: 0.25rem;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground));
  transition: color var(--duration-tween, 200ms) var(--ease-out);
}

.toc-numbering .toc-link.is-active::before {
  color: hsl(var(--primary));
}

/* Plain <ul> TOC (no-JS fallback). */
.toc-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------------
   Sidebar blocks
   -------------------------------------------------------------------------- */
.sider-block {
  padding: 1rem 0.25rem;
  border-top: 1px solid hsl(var(--border));
}

.sider-block-title {
  margin: 0 0 0.5rem;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.sider-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sider-list li {
  position: relative;
  margin: 0;
  padding: 0.125rem 0.5rem 0.125rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition: background var(--duration-ui) var(--ease-out);
}

.sider-list li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.75em;
  height: 0.25rem;
  width: 0.25rem;
  border-radius: 50%;
  background: hsl(var(--primary));
  opacity: 0.7;
}

.sider-list li:hover {
  background: hsl(var(--foreground) / 0.05);
}

.sider-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sider-list li:hover a {
  color: hsl(var(--primary));
}

.sider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-inline: 0.5rem;
}

.sider-tags .badge {
  padding-inline: 0.5rem;
  font-size: 0.75rem;
  transition: color var(--duration-ui) var(--ease-out), border-color var(--duration-ui) var(--ease-out);
}

.sider-tags .badge:hover {
  color: hsl(var(--shoka-blue));
  border-color: hsl(var(--shoka-blue));
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */
.comments {
  width: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

.comments-prompt {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.comment-embed {
  min-height: 4rem;
}

.comment-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--background));
  font: inherit;
}

.comment-form input[type="submit"] {
  padding: 0.625rem 1.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--gradient-shoka-button);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--duration-ui) var(--ease-out);
}

.comment-form input[type="submit"]:hover {
  transform: scale(1.03);
}

.comment-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.comment-list > li {
  padding: 1rem 0;
  border-top: 1px solid hsl(var(--border));
}

.comment-author img {
  float: left;
  margin-right: 0.75rem;
  border-radius: 9999px;
}

.comment-metadata {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.comment-content {
  overflow-wrap: anywhere;
}

.reply a {
  font-size: 0.75rem;
  color: hsl(var(--primary));
}

/* --------------------------------------------------------------------------
   Wave divider
   Ported 1:1 from styles/components/wave.css. Three copies of one path run
   `move-forever` at 12s / 7s / 4s with staggered negative delays, so the
   layers drift apart and re-join — that speed difference is the parallax.

   The animation sits on the `.wave-layer` divs, not on the SVG `<use>`
   elements the source targets. Blink cannot composite a transform on an SVG
   child, so animating the `<use>`s repainted the whole hero on the main thread
   every frame, for as long as the page was open — the mobile scroll stutter.
   The same keyframes on a plain div are composited. template-parts/wave.php
   builds the three boxes; the two files change together.

   Two declarations from the source are deliberately absent. It also sets
   `transform: translate(-160px, 0%)` and `translate(-75px, 0%)` on the first
   and third `<use>`, but a running CSS animation outranks a normal
   declaration, so neither ever applied while `move-forever` was running — and
   the wave only exists while it is running (`wave-off` hides the whole thing).
   Carried over to `.parallax`, where they would at last take effect, they
   would shift two layers by a visible 160px and 75px.
   -------------------------------------------------------------------------- */
.wave-wrap {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 15dvh;
  min-height: 3.125rem;
  max-height: 9.375rem;
}

.wave-layer {
  position: absolute;
  inset: 0;
  animation: move-forever 12s linear infinite;
}

.wave-layer.is-1 {
  animation-delay: -2s;
  opacity: 0.75;
  filter: brightness(1.1);
}

.wave-layer.is-2 {
  animation-delay: -3s;
  animation-duration: 7s;
  opacity: 0.6;
  filter: brightness(1.25);
}

.wave-layer.is-3 {
  animation-delay: -4s;
  animation-duration: 4s;
}

.wave {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  /* Load-bearing. An `<svg>` root clips its content to its own box, and that
     clip is what makes the source's version work: the path (351 units long
     against a 150-unit viewBox, so 2.3 windows wide) slides *under* a fixed
     window. Here the window is what slides, so without this the path would be
     cut off at the layer's right edge and the last third of the wave would
     empty out at the start of each cycle. With it, the path paints past the
     box and `.hero`'s `overflow: hidden` — the same edge the source ends up
     clipped by anyway — is the only thing that cuts it. */
  overflow: visible;
}

/* The source gives each `<use>` an inline `fill` *and* this declaration. CSS
   beats a presentation attribute, so `--gradient-bg-start` is what is drawn.
   The selector has to name the `<use>` for that same reason: on an ancestor it
   would only inherit, and inheritance loses to the inline attribute. */
.wave-layer .wave .parallax > use {
  fill: var(--gradient-bg-start);
}

/* Percentages, not the source's `-90px` / `85px`. On an SVG child a length in
   `transform` means that many *user units*, and the stretched viewBox turns one
   user unit into `width / 150` pixels — 2.5px on a phone, 8.4px on a wide
   desktop. The source's keyframes therefore travel `90 × width/150` px, which is
   60% of the wave's width; the same numbers on an HTML div travel a literal
   90px and the wave barely moves. Percentages resolve against the layer's own
   width, which is exactly the box the viewBox was stretched over, so these two
   lines reproduce the original motion at every viewport size. */
@keyframes move-forever {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(56.667%);
  }
}

/* Hides the divider when the "cover wave" preference is switched off.
   Source: `html.wave-off .wave-wrap { display: none }` in wave.css. */
.wave-off .wave-wrap {
  display: none;
}

/* 减弱动画 keeps the wave's shape and stops its scrolling — the source's own
   split, written as `html.motion-off .wave .parallax > use { animation: none }`
   at the bottom of its wave.css. Measured on the source: flipping that switch
   leaves the layers at `animation-name: none`, transform frozen.

   `.wave-layer` is one class and nothing else in this file animates it, so the
   extra `html.motion-off` element is not out-ranking anything — it is simply
   the only rule that would turn it off, and it is spelled the same way as the
   other master-motion rules so the set can be read in one place. */
html.motion-off .wave-layer {
  animation: none;
}

/* No `prefers-reduced-motion` rule here, on purpose, matching the reference
   site: the wave keeps scrolling for visitors whose OS asks for reduced
   motion. This used to be a rule that looked like it honoured the preference
   and did not — an out-specified `.wave .parallax > use` the animation rule
   always beat. The markup above is what makes that honest now: the animation
   target is an HTML div with no competing rule at all, so the choice is plain
   in the code rather than hidden in a specificity trick. `wave-off` above
   removes the divider outright and `html.motion-off` freezes it — both are
   switches the reader chose. */

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgb(0 0 0 / 0.85);
  cursor: zoom-out;
  /*
   * The source's viewer arrives rather than appearing: the overlay fades in at
   * `{ duration: 0.2, delay: 0.1 }` and the frame around the image scales up
   * from 0.95 over 0.2s (`ImageLightbox.tsx:132-169`). This opens on a hard cut
   * instead, which is the same jolt the floating toolbar had.
   *
   * Always in the layer, `visibility` rather than `display` being what takes it
   * out — a `display: none` has nothing to transition from. `visibility` also
   * drops it off the accessibility tree and stops it taking clicks, and its
   * delayed step is what keeps it painted until the fade has run.
   *
   * The close fades too. The source leaves the overlay without an `exit`, so its
   * close is instant; a fade back out costs one transition and removes the last
   * hard cut in the reader's path.
   */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-tween) var(--ease-out),
    visibility 0s linear var(--duration-tween);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--duration-tween) var(--ease-out), visibility 0s linear 0s;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  transform: scale(0.95);
  transition: transform var(--duration-tween) var(--ease-out);
}

.lightbox.is-open img {
  transform: none;
}

/* Movement goes, the fade stays — the split `.settings-panel` and the search
   dialog already use. */
@media (prefers-reduced-motion: reduce) {
  .lightbox img {
    transform: none;
  }
}

html.motion-off .lightbox img {
  transform: none;
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  height: 2.5rem;
  width: 2.5rem;
  border: 0;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.15);
  cursor: pointer;
}

.lightbox button::before,
.lightbox button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  height: 2px;
  width: 1.1rem;
  background: #fff;
}

.lightbox button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

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

  .section-heading {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timeline-row {
    min-height: 4.375rem;
    line-height: 1.75;
  }

  .timeline-row::after {
    top: 1.625rem;
    height: calc(100% - 1.5rem);
  }

  .timeline-title {
    flex-basis: 100%;
  }

  .category-children {
    margin-left: 0.75rem;
  }
}

@media (max-width: 480px) {
  .friends-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
