:root {
  color-scheme: light;
  --page-width: 1320px;
  --gap: 1rem;
  --page-bg: #f4f0e7;
  --surface: #fffdf7;
  --text: #171717;
  --border: #aaa59a;
  --muted: #6c6962;
  --accent: #5e54c7;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #151515;
  --surface: #1d1d1d;
  --text: #ededed;
  --border: #4f4f4f;
  --muted: #aaa;
  --accent: #948aff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background: var(--page-bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem max(1rem, calc((100vw - var(--page-width)) / 2));
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  background: var(--page-bg);
}

.site-title {
  font-weight: 760;
  text-decoration: none;
}

.site-nav,
.language-nav,
.tab-list,
.listing-actions,
.pagination,
.post-footer,
.post-header,
.platform-links {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.theme-toggle {
  padding: 0.42rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--border);
  background: var(--surface);
}

.site-nav a,
.language-nav a,
.tab-list a,
.listing-actions a,
.listing-actions button,
.pagination a,
.pagination span {
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  text-decoration: none;
}

.language-nav a.active,
.tab-list a.active,
.pagination a.active {
  background: var(--accent);
  color: white;
}

.pagination span {
    user-select: none;
}

main {
  width: min(var(--page-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
}

h2 {
  line-height: 1.2;
}

.lead {
  max-width: 76ch;
  font-size: 1.1rem;
}

.listing-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.listing-actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--gap);
  align-items: start;
}

.card,
.post-card,
.platform-card,
.artwork-media {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.card-media,
.post-media-item,
.artwork-media {
  position: relative;
}

.card-media .media-link img,
.card-media .media-link video,
.post-media-item .media-link img,
.post-media-item .media-link video,
.artwork-media > .media-link img,
.artwork-media > .media-link video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: color-mix(in srgb, var(--page-bg) 90%, currentColor 10%);
}

.card-body,
.post-body,
.platform-card,
.artwork-media details,
.linked-posts {
  padding: 0.9rem;
}

.card-body h2,
.post-body h2,
.platform-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.card-body p,
.post-body p {
  margin: 0.35rem 0;
}

.metadata {
  color: var(--muted);
  font-size: 0.9rem;
}

.platform-links {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-bg) 82%, transparent);
  opacity: 0;
  transition: opacity 120ms ease;
}

.card-media:hover .platform-links,
.artwork-media:hover > .platform-links,
.platform-links:focus-within {
  opacity: 1;
}

.platform-link img,
.post-platform img,
.platform-card h2 img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

.platform-link.is-deleted {
  opacity: 0.35;
}

.post-list {
  display: grid;
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.post-card {
  content-visibility: auto;
  contain-intrinsic-size: 650px;
}

/* Version evidence on a standalone post may open a small popover outside the
   card. Detail pages only render a handful of version cards, so they do not
   need the feed-only paint containment that would clip that popover. */
.post-detail-page .post-card {
  overflow: visible;
  content-visibility: visible;
}

.post-header,
.post-footer {
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.post-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-start;
}

.post-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  text-decoration: none;
}

.post-date {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
}

.post-date time {
  text-decoration: underline;
}

.status {
  padding: 0.18rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
}

.status-deleted {
  opacity: 0.55;
}

.post-original-link-icon,
.platform-source-link svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.post-original-link-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.8;
}

.platform-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  color: var(--muted);
  font-size: 0.82rem;
}

.platform-hero .platform-source-link {
  color: inherit;
  opacity: 0.72;
}

.platform-hero .platform-source-link:hover,
.platform-hero .platform-source-link:focus-visible {
  opacity: 1;
}

.post-text {
  white-space: normal;
  margin: 0.7rem 0;
}

.post-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.pagination {
  justify-content: space-between;
  margin-top: 2rem;
}

.pagination-pages {
  display: flex;
  gap: 0.3rem;
}

.platform-list {
  display: grid;
  gap: 2rem;
}

.platform-card h2 a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.platform-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0.8rem;
}

.platform-preview .post-card {
  font-size: 0.88rem;
}

.artwork-media {
  padding-bottom: 0.2rem;
}

.artwork-media > .platform-links {
  top: 0.55rem;
  right: 0.55rem;
}

.artwork-posts a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 1.75rem;
}

.artwork-posts {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0.9rem 0.9rem;
  padding-left: 0;
  list-style: none;
  font-size: 0.82rem;
  line-height: 1.35;
}

.artwork-version-date {
  margin: 0.75rem 0.9rem -0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.artwork-version-date + .artwork-posts {
  margin-top: 0.45rem;
}

.artwork-posts-empty {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.artwork-posts .platform-link img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.feed-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .listing-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-links {
    opacity: 1;
  }
}

.media-viewer-switcher {
  position: fixed;
  z-index: 5;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 0;
  height: clamp(260px, 70dvh, 640px);
  padding: 0.45rem;
  overflow: hidden;
  box-sizing: border-box;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: white;
  cursor: pointer;
  opacity: 1;
  transition: background 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.media-viewer-switcher-left {
  left: 0;
  justify-content: flex-end;
  background: linear-gradient(to right, rgb(255 255 255 / 0), rgb(255 255 255 / 0));
}

.media-viewer-switcher-right {
  right: 0;
  justify-content: flex-start;
  background: linear-gradient(to left, rgb(255 255 255 / 0), rgb(255 255 255 / 0));
}

.media-viewer-switcher-left:hover,
.media-viewer-switcher-left:focus-visible {
  background: linear-gradient(to right, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.025) 72%, transparent);
}

.media-viewer-switcher-right:hover,
.media-viewer-switcher-right:focus-visible {
  background: linear-gradient(to left, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.025) 72%, transparent);
}

.media-viewer-switcher:focus-visible {
  outline: 2px solid rgb(255 255 255 / 0.58);
  outline-offset: -4px;
}

.modal.editing .media-viewer-switcher {
  pointer-events: none;
  opacity: 0.1;
}

.media-viewer-switcher-preview {
  display: grid;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: min(11rem, calc(100% - 2.1rem));
  height: clamp(132px, 32dvh, 270px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.65rem;
  background: rgb(0 0 0 / 0.36);
  opacity: 0.56;
  transition: opacity 120ms ease, background 120ms ease, border-color 120ms ease;
}

.media-viewer-switcher-preview img,
.media-viewer-switcher-preview video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  opacity: 0.72;
  filter: saturate(0.75) brightness(0.82);
  transition: opacity 120ms ease, filter 120ms ease;
}

.media-viewer-switcher:hover .media-viewer-switcher-preview,
.media-viewer-switcher:focus-visible .media-viewer-switcher-preview {
  border-color: rgb(255 255 255 / 0.4);
  background: rgb(0 0 0 / 0.58);
  opacity: 1;
}

.media-viewer-switcher:hover .media-viewer-switcher-preview img,
.media-viewer-switcher:hover .media-viewer-switcher-preview video,
.media-viewer-switcher:focus-visible .media-viewer-switcher-preview img,
.media-viewer-switcher:focus-visible .media-viewer-switcher-preview video {
  opacity: 0.95;
  filter: none;
}

.media-viewer-switcher-chevron {
  flex: 0 0 auto;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1;
  opacity: 0.78;
  transition: opacity 120ms ease, transform 120ms ease;
}

.media-viewer-switcher:hover .media-viewer-switcher-chevron,
.media-viewer-switcher:focus-visible .media-viewer-switcher-chevron {
  opacity: 1;
}

.media-viewer-switcher-left:hover .media-viewer-switcher-chevron,
.media-viewer-switcher-left:focus-visible .media-viewer-switcher-chevron {
  transform: translateX(-0.18rem);
}

.media-viewer-switcher-right:hover .media-viewer-switcher-chevron,
.media-viewer-switcher-right:focus-visible .media-viewer-switcher-chevron {
  transform: translateX(0.18rem);
}

.hidden, [hidden] {
  display: none !important;
}

.clickable {
  cursor: pointer;
}

.pixelated {
  image-rendering: pixelated;
}

/* Full-screen overlay. The footer is a real grid row, so metadata never gets
   pushed below a tall portrait image. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: stretch;
  background: rgba(0, 0, 0, 0.88);
  overflow: hidden;
  overscroll-behavior: contain;
}

#mediaModal .modal-dialog {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: clamp(0.75rem, 3vh, 2rem) clamp(0.75rem, 5vw, 4rem) 0.75rem;
  box-sizing: border-box;
}

#mediaModalContent {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}

#mediaModalContent img,
#mediaModalContent video {
  display: block;
  width: auto;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

#mediaModalContent img {
  max-width: min(100%, var(--viewer-image-max-width, 960px));
  max-height: min(100%, var(--viewer-image-max-height, 100dvh));
}

#mediaModalContent video {
  max-width: min(100%, 1100px);
}

#mediaModalContent .media-viewer-current.is-artwork-aligned {
  position: absolute;
  max-width: none;
  max-height: none;
}

.media-viewer-close {
  position: fixed;
  z-index: 6;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.45);
  color: white;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.media-viewer-close:hover,
.media-viewer-close:focus-visible {
  background: rgb(0 0 0 / 0.72);
  border-color: rgb(255 255 255 / 0.62);
}

.media-viewer-play-button {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  display: grid;
  width: clamp(3.25rem, 8vw, 5rem);
  height: clamp(3.25rem, 8vw, 5rem);
  padding: 0 0 0 0.18em;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(255 255 255 / 0.48);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.58);
  color: white;
  font: inherit;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  cursor: pointer;
}

.media-viewer-play-button:hover,
.media-viewer-play-button:focus-visible {
  background: rgb(0 0 0 / 0.78);
}

.modal-subtext {
  position: relative;
  z-index: 2;
  width: min(72rem, calc(100vw - 2rem));
  max-height: min(24dvh, 12rem);
  margin: 0 auto;
  padding: 0.65rem 0.8rem max(0.75rem, env(safe-area-inset-bottom));
  overflow: auto;
  box-sizing: border-box;
  color: rgb(255 255 255 / 0.86);
  font-size: 0.86rem;
  line-height: 1.35;
  scrollbar-gutter: stable;
}

.modal-subtext:empty {
  display: none;
}

.modal-subtext a {
  color: inherit;
}

.media-viewer-context {
  margin-bottom: 0.45rem;
  color: rgb(255 255 255 / 0.96);
  font-weight: 600;
}

.media-viewer-post-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  height: 2rem;
  min-height: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.media-viewer-post-reference {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
}

.media-viewer-post-list::-webkit-scrollbar {
  display: none;
}

.media-viewer-post-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.07);
  text-decoration: none;
  white-space: nowrap;
}

.media-viewer-post-reference .media-viewer-post-link {
  border-radius: 999px 0 0 999px;
}

.media-viewer-post-reference .media-viewer-post-link:only-child {
  border-radius: 999px;
}

.media-viewer-post-original {
  display: grid;
  width: 2rem;
  min-height: 2rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: rgb(255 255 255 / 0.045);
  color: rgb(255 255 255 / 0.7);
  text-decoration: none;
}

.media-viewer-post-original:hover,
.media-viewer-post-original:focus-visible {
  background: rgb(255 255 255 / 0.14);
  color: white;
}

.media-viewer-post-link:hover,
.media-viewer-post-link:focus-visible {
  background: rgb(255 255 255 / 0.14);
}

.media-viewer-post-link.is-current {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.035);
  color: rgb(255 255 255 / 0.55);
}

.media-viewer-post-link.is-empty {
  border-color: transparent;
  background: transparent;
  color: rgb(255 255 255 / 0.56);
  cursor: default;
}

@media (max-width: 768px) {
  #mediaModal .modal-dialog {
    padding-inline: 0.45rem;
  }

  .media-viewer-switcher {
    position: fixed;
    top: 50%;
    bottom: auto;
    width: 52px;
    height: 128px;
    min-height: 0;
    padding: 0.2rem;
    transform: translateY(-50%);
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 0.8rem;
    background: rgb(0 0 0 / 0.36);
  }

  .media-viewer-switcher-left {
    left: max(0.5rem, env(safe-area-inset-left));
    justify-content: flex-end;
  }

  .media-viewer-switcher-right {
    right: max(0.5rem, env(safe-area-inset-right));
    justify-content: flex-start;
  }

  .media-viewer-switcher-preview {
    display: none;
  }

  .media-viewer-switcher-chevron {
    font-size: 1.25rem;
  }

  .modal-subtext {
    max-height: min(28dvh, 10rem);
    padding-inline: 0.8rem;
  }


  #mediaModalContent img {
    max-width: 100%;
  }
}

/* Platform pages */
.platform-hero {
  overflow: hidden;
  margin: 0 0 1.75rem;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  background: var(--surface);
}

.platform-hero-banner {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  height: clamp(130px, 20vw, 250px);
  isolation: isolate;
  background-position: center;
  background-size: cover;
}

.platform-hero-banner .platform-banner-image,
.platform-card-banner .platform-banner-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.platform-banner-backdrop {
  position: absolute;
  z-index: 0;
  inset: -1.25rem;
  width: calc(100% + 2.5rem);
  height: calc(100% + 2.5rem);
  object-fit: cover;
  object-position: center;
  opacity: 0.5;
  filter: blur(18px) saturate(0.75) brightness(0.72);
  transform: scale(1.05);
  pointer-events: none;
}

.platform-hero--pixiv .platform-hero-banner {
  background:
    radial-gradient(circle at 18% 35%, rgb(255 255 255 / 0.55) 0 5%, transparent 5.5%),
    radial-gradient(circle at 72% 25%, rgb(255 255 255 / 0.3) 0 10%, transparent 10.5%),
    linear-gradient(135deg, #8fd4ff, #0096fa 62%, #70c8ff);
}

.platform-hero--twitter .platform-hero-banner {
  background:
    linear-gradient(145deg, transparent 0 42%, rgb(255 255 255 / 0.52) 42.5% 44%, transparent 44.5% 100%),
    linear-gradient(35deg, #c9edf9, #eff8fb 52%, #b9dce8);
}

.platform-hero--tumblr .platform-hero-banner {
  background:
    radial-gradient(ellipse at 20% 90%, rgb(255 255 255 / 0.12) 0 12%, transparent 12.5%),
    radial-gradient(ellipse at 72% 35%, rgb(255 255 255 / 0.08) 0 16%, transparent 16.5%),
    linear-gradient(180deg, #27455f, #001935);
}

.platform-hero-profile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.platform-hero-icon {
  width: 5rem;
  height: 5rem;
  margin-top: -2.15rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid var(--page-bg);
  border-radius: 50%;
  background: var(--page-bg);
  font-size: 2rem;
  font-weight: 800;
}

.platform-hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.platform-hero-copy {
  display: grid;
  align-self: end;
  gap: 0.1rem;
}

.platform-hero-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.platform-hero-copy span {
  color: var(--muted);
}

.platform-view-tabs {
  display: flex;
  gap: 0.35rem;
  align-self: end;
}

.platform-view-tabs a {
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  text-decoration: none;
}

.platform-view-tabs a.active {
  background: var(--text);
  color: var(--page-bg);
}

.platform-profile-version[hidden] {
  display: none;
}

.platform-profile-version-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, var(--page-bg));
}

.platform-profile-version-toolbar label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.platform-profile-version-toolbar select {
  max-width: min(24rem, 58vw);
  padding: 0.36rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--page-bg);
  color: var(--text);
}

/* Platform-flavoured full post cards. Keep these scoped to platform pages so
   the cross-platform post index remains visually neutral. */
.platform-page .post-list {
  margin-top: 0;
}

.platform-page .post-card .post-media-item .media-link img,
.platform-page .post-card .post-media-item .media-link video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(62dvh, 680px);
  aspect-ratio: auto;
  object-fit: contain;
}

.platform-page .post-card .post-media-item .media-link {
  display: flex;
  justify-content: center;
}

.platform-page--pixiv .post-card--pixiv {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.platform-page--pixiv .post-card--pixiv .post-header {
  border: 0;
  padding-inline: 0;
}

.platform-page--pixiv .post-card--pixiv .post-body {
  padding-inline: 0;
}

.platform-page--pixiv .post-card--pixiv .post-media-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.platform-page--pixiv .post-card--pixiv .post-media-item {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--page-bg) 95%, currentColor 5%);
}

.platform-page--pixiv .post-card--pixiv .post-media-item .media-link {
  display: flex;
  width: 100%;
  justify-content: center;
}

.platform-page--pixiv .post-card--pixiv .post-media-item .media-link img,
.platform-page--pixiv .post-card--pixiv .post-media-item .media-link video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(62dvh, 680px);
  object-fit: contain;
}

.platform-page--twitter .post-card--twitter {
  max-width: 640px;
  margin-inline: auto;
  border-radius: 0;
  background: var(--page-bg);
}

.platform-page--twitter .post-card--twitter .post-media-grid {
  overflow: hidden;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 1rem;
}

/* X/Twitter currently shows a single image at its natural ratio when it is
   between 3:4 and 2:1. More extreme images are cropped to that supported
   range. */
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1 {
  display: block;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1 .media-link {
  display: block;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--natural img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--natural video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(62dvh, 680px);
  aspect-ratio: auto;
  object-fit: contain;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall {
  display: grid;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide {
  aspect-ratio: 2 / 1;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall {
  width: min(100%, 60dvh, 675px);
  margin-inline: auto;
  aspect-ratio: 3 / 4;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide .post-media-item,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide .media-link,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall .post-media-item,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall .media-link,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall video {
  width: 100%;
  height: 100%;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--wide video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-1.twitter-single-media--tall video {
  object-fit: cover;
  object-position: center;
}

/* Multiple images use Twitter's fixed collage: the whole media card is 16:9.
   That yields 8:9 tiles for two images, 8:9 + two 16:9 tiles for three, and
   four 16:9 tiles for the 2x2 layout. */
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 {
  aspect-ratio: 16 / 9;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 {
  grid-template-rows: 1fr;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 .post-media-item:first-child {
  grid-row: 1 / span 2;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 .post-media-item,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 .post-media-item,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 .post-media-item,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 .media-link,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 .media-link,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 .media-link,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 video {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 img,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-2 video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-3 video,
.platform-page--twitter .post-card--twitter .post-media-grid.post-media-count-4 video {
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.platform-page--tumblr .post-card--tumblr {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  border-radius: 0.35rem;
  background: var(--page-bg);
}

.platform-page--tumblr main {
  --page-width: 1180px;
}

.tumblr-media-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin-top: 1rem;
}

.tumblr-media-row {
  display: grid;
  grid-template-columns: repeat(var(--tumblr-row-columns), minmax(0, 1fr));
  gap: 2px;
  aspect-ratio: var(--tumblr-row-aspect, auto);
  overflow: hidden;
}

.platform-page--tumblr .post-card--tumblr .tumblr-media-row .post-media-item,
.platform-page--tumblr .post-card--tumblr .tumblr-media-row .media-link {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.platform-page--tumblr .post-card--tumblr .tumblr-media-row .post-media-item {
  overflow: hidden;
}

.platform-page--tumblr .post-card--tumblr .tumblr-media-row .media-link {
  display: block;
}

/* The generic platform-card rules above intentionally preserve natural image
   dimensions. Tumblr photosets are different: each block must fill the cell
   defined by the photoset row, with the image cropped inside that cell. Keep
   this selector at least as specific as the generic platform rule so tall
   photos cannot shrink to their intrinsic width and leave gaps in a row. */
.platform-page--tumblr .post-card--tumblr .tumblr-media-row .post-media-item .media-link img,
.platform-page--tumblr .post-card--tumblr .tumblr-media-row .post-media-item .media-link video {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.post-version-list {
  display: grid;
  gap: 2rem;
}

.post-version-label {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Compact platform archives. */
.compact-grid {
  display: grid;
  align-items: start;
}

.compact-grid--pixiv {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.6rem 1rem;
}

.compact-grid--twitter {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  max-width: 980px;
  margin-inline: auto;
}

.compact-grid--tumblr {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}

.compact-grid:not(.compact-grid--pixiv):not(.compact-grid--twitter):not(.compact-grid--tumblr) {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.compact-post {
  min-width: 0;
  display: grid;
  gap: 0.55rem;
  position: relative;
  color: inherit;
  text-decoration: none;
  border: 0;
  background: transparent;
}

.compact-post-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: color-mix(in srgb, var(--page-bg) 92%, currentColor 8%);
}

.compact-post-media img,
.compact-post-media video,
.compact-media-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.compact-post--pixiv .compact-post-media img,
.compact-post--pixiv .compact-post-media video {
  object-position: center top;
}

.compact-post--twitter .compact-post-media img,
.compact-post--twitter .compact-post-media video,
.compact-post--tumblr .compact-post-media img,
.compact-post--tumblr .compact-post-media video {
  object-position: center;
}

.compact-post-title {
  min-height: 1.35em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
}

.compact-media-count {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: rgb(0 0 0 / 0.66);
  pointer-events: none;
}

.compact-media-count svg {
  width: 1em;
  height: 1em;
}

.compact-media-count--pixiv {
  top: 0.45rem;
  right: 0.45rem;
  gap: 0.2rem;
  min-height: 1.65rem;
  padding: 0.2rem 0.42rem;
  border-radius: 0.35rem;
  font-size: 0.8rem;
}

.compact-media-count--twitter {
  right: 0.55rem;
  bottom: 0.55rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.55rem;
  background: rgb(0 0 0 / 0.48);
}

.tumblr-compact-archive {
  display: grid;
  gap: 2.4rem;
}

.tumblr-month-group > h2 {
  margin: 0 0 0.8rem;
  font-size: 1.2rem;
  font-weight: 750;
  text-transform: capitalize;
}

.compact-date-tooltip {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  color: white;
  background: rgb(0 0 0 / 0.7);
  text-align: center;
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 100ms ease, transform 100ms ease;
  pointer-events: none;
}

.compact-post--tumblr:hover .compact-date-tooltip,
.compact-post--tumblr:focus-visible .compact-date-tooltip {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .compact-grid--pixiv {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .platform-hero-profile {
    grid-template-columns: auto 1fr;
  }

  .platform-view-tabs {
    grid-column: 1 / -1;
  }
}

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

  .compact-grid--twitter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-grid--tumblr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }

  .platform-hero {
    border-radius: 0.75rem;
  }

  .platform-hero-icon {
    width: 4.2rem;
    height: 4.2rem;
  }

  .platform-view-tabs {
    width: 100%;
  }

  .platform-view-tabs a {
    flex: 1;
    text-align: center;
  }
}

/* Cross-platform post activity. The index is a calendar-like archive, not a
   mixed feed: one cell per month, intensity driven only by post count. */
.post-activity {
  display: grid;
  gap: 0.75rem;
}

.activity-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-legend-dot,
.activity-month-dot {
  --activity-fill: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: var(--activity-fill);
}

.activity-legend-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}

[data-activity-level="1"] { --activity-fill: color-mix(in srgb, var(--surface) 80%, var(--accent) 20%); }
[data-activity-level="2"] { --activity-fill: color-mix(in srgb, var(--surface) 63%, var(--accent) 37%); }
[data-activity-level="3"] { --activity-fill: color-mix(in srgb, var(--surface) 45%, var(--accent) 55%); }
[data-activity-level="4"] { --activity-fill: color-mix(in srgb, var(--surface) 25%, var(--accent) 75%); }
[data-activity-level="5"] { --activity-fill: color-mix(in srgb, var(--surface) 8%, var(--accent) 92%); color: white; }

.activity-year {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.activity-year > h2 {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.activity-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.2rem, 0.7vw, 0.65rem);
}

.activity-month {
  position: relative;
  min-width: 0;
  text-align: center;
}

.activity-month > summary,
.activity-month--empty {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  list-style: none;
}

.activity-month > summary {
  cursor: pointer;
}

.activity-month > summary::-webkit-details-marker {
  display: none;
}

.activity-month-dot {
  width: clamp(2rem, 3.4vw, 2.8rem);
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.activity-month-dot > span {
  opacity: 0.86;
}

.activity-month > summary:hover .activity-month-dot,
.activity-month > summary:focus-visible .activity-month-dot,
.activity-month[open] > summary .activity-month-dot {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.activity-month-label {
  min-width: 0;
  color: var(--muted);
  font-size: clamp(0.62rem, 1vw, 0.76rem);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-month--empty {
  opacity: 0.42;
}

.activity-popover {
  display: block;
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 0.55rem);
  width: min(360px, calc(100vw - 2rem));
  max-height: min(440px, 72vh);
  overflow: auto;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--page-bg);
  box-shadow: 0 1rem 2.8rem rgb(0 0 0 / 0.24);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transition: none;
}

.activity-month[open] .activity-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.activity-popover-title,
.activity-popover-count {
  display: block;
}

.activity-popover-count {
  margin: 0.1rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-post-list {
  display: grid;
  gap: 0.45rem;
}

.activity-post {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.3rem;
  border-radius: 0.55rem;
  color: inherit;
  text-decoration: none;
}

.activity-post:hover,
.activity-post:focus-visible {
  background: var(--surface);
}

.activity-post-thumbnail {
  position: relative;
  width: 3.4rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.45rem;
  background: var(--surface);
}

.activity-post-thumbnail > img,
.activity-post-thumbnail > video,
.activity-post-thumbnail > .compact-media-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-post-platform {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.14rem;
  border-radius: 50%;
  background: var(--page-bg);
  box-shadow: 0 0 0 1px var(--border);
}

.activity-post-platform img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.activity-post-copy {
  display: grid;
  min-width: 0;
}

.activity-post-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.activity-post-copy > span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
}

.activity-unknown {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.activity-unknown > h2 {
  font-size: 1rem;
}

.activity-unknown .activity-post-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Platform directory cards stay bounded regardless of post text/media count. */
.platform-index-page main {
  --page-width: 1320px;
}

.platform-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.platform-card {
  padding: 0;
}

.platform-card-banner {
  position: relative;
  display: grid;
  place-items: center;
  height: 140px;
  overflow: hidden;
  isolation: isolate;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  text-decoration: none;
}

.platform-card--pixiv .platform-card-banner {
  background:
    radial-gradient(circle at 18% 35%, rgb(255 255 255 / 0.55) 0 5%, transparent 5.5%),
    linear-gradient(135deg, #8fd4ff, #0096fa 62%, #70c8ff);
}

.platform-card--twitter .platform-card-banner {
  background:
    linear-gradient(145deg, transparent 0 42%, rgb(255 255 255 / 0.52) 42.5% 44%, transparent 44.5% 100%),
    linear-gradient(35deg, #c9edf9, #eff8fb 52%, #b9dce8);
}

.platform-card--tumblr .platform-card-banner {
  background: linear-gradient(180deg, #27455f, #001935);
}

.platform-card-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
  padding: 0 0.85rem;
}

.platform-card-avatar {
  position: relative;
  width: 4rem;
  height: 4rem;
  margin-top: -1.8rem;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 3px solid var(--page-bg);
  border-radius: 50%;
  background: var(--page-bg);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
}

.platform-card-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.platform-card-platform-icon,
.platform-hero-platform-icon {
  position: absolute;
  right: -0.15rem;
  bottom: -0.15rem;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0.18rem;
  border-radius: 50%;
  background: var(--page-bg);
  box-shadow: 0 0 0 1px var(--border);
}

.platform-card-platform-icon img,
.platform-hero-platform-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.platform-card-copy {
  min-width: 0;
  padding-top: 0.55rem;
}

.platform-card-copy h2 {
  margin: 0;
  font-size: 1.05rem;
}

.platform-card-copy h2 a {
  display: inline;
}

.platform-card-copy .metadata {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-card-count {
  display: grid;
  justify-items: end;
  padding-bottom: 0.2rem;
  line-height: 1.05;
}

.platform-card-count strong {
  font-size: 1.2rem;
}

.platform-card-count span {
  color: var(--muted);
  font-size: 0.72rem;
}

.platform-card-bio {
  display: -webkit-box;
  min-height: 0;
  margin: 0.75rem 0.85rem 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.88rem;
}

.platform-card-source {
  margin: 0.45rem 0.85rem 0;
}

.platform-card-dates {
  margin: 0.55rem 0.85rem;
}

.platform-preview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  margin-top: 0.7rem;
}

.platform-preview-post {
  display: block;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
}

.platform-preview-post img,
.platform-preview-post video,
.platform-preview-post .compact-media-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.platform-hero-icon {
  position: relative;
  overflow: visible;
}

.platform-hero-icon > img:first-child {
  overflow: hidden;
  border-radius: 50%;
  object-fit: cover;
}

.platform-hero-bio {
  max-width: 70ch;
  margin: 0.35rem 0 0;
  color: inherit;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .platform-list {
    grid-template-columns: 1fr;
  }

  .activity-year {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .activity-months {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: 0.8rem;
  }

}

@media (max-width: 560px) {
  .activity-year {
    grid-template-columns: 1fr;
  }

  .activity-year > h2 {
    margin: 0;
  }

  .activity-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }


  .activity-month-dot {
    width: 2.4rem;
  }

  .platform-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* A null profile asset is different from an unknown one. Explicitly absent
   banners are not replaced by the platform-flavoured fallback artwork. */
.platform-hero--no-banner .platform-hero-banner,
.platform-profile-version--no-banner .platform-hero-banner,
.platform-card--no-banner .platform-card-banner {
  display: none;
}

.platform-hero--no-banner .platform-hero-profile,
.platform-profile-version--no-banner .platform-hero-profile {
  padding-top: 1rem;
}

.platform-hero--no-banner .platform-hero-icon,
.platform-profile-version--no-banner .platform-hero-icon,
.platform-card--no-banner .platform-card-avatar {
  margin-top: 0;
}

.platform-card--no-banner .platform-card-profile {
  padding-top: 0.85rem;
}

.status-lost {
  opacity: 0.72;
}

.lost-post-note {
  margin: 0.7rem 0 0;
  padding: 0.7rem 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-lost-badge,
.platform-preview-lost {
  position: absolute;
  z-index: 2;
  left: 0.45rem;
  top: 0.45rem;
  padding: 0.22rem 0.42rem;
  border-radius: 0.35rem;
  color: white;
  background: rgb(0 0 0 / 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
}

.platform-preview-post {
  position: relative;
}

/* Tumblr version provenance on individual post pages. */
.post-version-evidence {
  position: relative;
  margin: 0.8rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.post-version-evidence-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  white-space: nowrap;
}

.post-version-evidence time {
  color: var(--text);
}

.post-version-evidence a {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.post-version-evidence a svg {
  width: 0.85em;
  height: 0.85em;
}

.post-reblog-details {
  display: inline-block;
  flex: 0 0 auto;
}

.post-reblog-details > summary {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem 0;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0.38rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.post-reblog-details > summary::-webkit-details-marker {
  display: none;
}

.post-reblog-details > summary:hover,
.post-reblog-details > summary:focus-visible,
.post-reblog-details[open] > summary {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface) 76%, var(--accent) 24%);
  color: var(--text);
}

.post-reblog-details > summary svg {
  width: 1rem;
  height: 1rem;
}

.post-reblog-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  box-shadow: 0 0.55rem 1.5rem rgb(0 0 0 / 0.18);
  white-space: normal;
}

.post-reblog-panel-label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-weight: 600;
}

.post-reblog-list {
  max-height: min(14rem, 42dvh);
  overflow: auto;
  line-height: 1.65;
}

.post-reblog-separator,
.post-reblog-empty {
  color: var(--muted);
}

.post-reblog-empty {
  margin-left: 0.15rem;
}

@media (max-width: 620px) {
  .post-version-evidence-row {
    flex-wrap: wrap;
    white-space: normal;
  }
}

/* Home: project summary plus the only cross-platform Activity view. */
.home-hero {
  max-width: 74ch;
  margin-bottom: 1.75rem;
}

.home-hero > p {
  margin: 0.65rem 0;
  font-size: 1.05rem;
  text-wrap: pretty;
}

.home-lead {
  text-wrap: balance;
}

.home-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.home-section-link {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0.35rem;
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface);
  text-decoration: none;
}

.home-section-link strong {
  font-size: 1.1rem;
}

.home-section-link span {
  color: var(--muted);
}

.home-section-link:hover,
.home-section-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
}

.home-activity > h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

/* Image-only gallery. Desktop keeps a dense fixed-height flow, but very wide
   images have an explicit width cap so panorama-like assets cannot dominate a
   row. On phones regular cells become two equal columns. */
.gallery-page main {
  --page-width: 1480px;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gallery-item {
  position: relative;
  flex: 0 0 auto;
  width: var(--gallery-width, 168px);
  height: var(--gallery-height, 168px);
  max-width: 100%;
  overflow: hidden;
  background: transparent;
}

.gallery-item--wide {
  width: min(var(--gallery-width, 300px), 300px);
  max-width: 300px;
}

.gallery-date-divider {
  flex: 0 0 100%;
  width: 100%;
  height: clamp(0.9rem, 2vw, 1.6rem);
  margin-top: clamp(0.45rem, 1vw, 0.9rem);
  border-top: 1px solid var(--border);
}

.gallery-video-indicator {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding-left: 0.12rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(255 255 255 / 0.58);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.5);
  color: white;
  font-size: 0.9rem;
  pointer-events: none;
}

.gallery-item .media-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.gallery-item .media-link img,
.gallery-item .media-link video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Revisions use the same aligned coordinate system for both preview frames.
   The shared visible area defines the comparison zoom, but it is not used as
   an inner polygon crop: only the rectangular card frame clips overflow. */
.revision-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--gap);
}

.revision-card {
  flex: 1 1 320px;
  width: min(100%, 420px);
  max-width: 420px;
}

.revision-card--single {
  flex: 0 1 190px;
  width: min(100%, 190px);
  max-width: 190px;
}

.revision-section-heading {
  flex: 0 0 100%;
  width: 100%;
  margin: 1.5rem 0 0.15rem;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.revision-preview-link {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 0;
  text-decoration: none;
  background: color-mix(in srgb, var(--page-bg) 88%, currentColor 12%);
}

.revision-preview-link--single {
  grid-template-columns: minmax(0, 1fr);
}

.revision-preview-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--page-bg);
}

.revision-preview-frame svg,
.revision-preview-frame img,
.revision-preview-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.revision-card-body {
  padding: 0.7rem 0.8rem;
}

.revision-card-body .metadata {
  margin: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The platform card itself is the primary link. Nested source/post links remain
   independently clickable above the invisible full-card hit target. */
.platform-card {
  position: relative;
}

.platform-card-hit-area {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  text-decoration: none;
}

.platform-card > :not(.platform-card-hit-area) {
  pointer-events: none;
}

.platform-card a:not(.platform-card-hit-area) {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.platform-card-hit-area:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.platform-card:has(.platform-card-hit-area:hover) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

/* Synthetic timeline entry marking the creation of a social profile/blog. */
.platform-created-event {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.25rem;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}

.platform-created-event-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
}

.platform-created-event-icon img {
  max-width: 1.4rem;
  max-height: 1.4rem;
  object-fit: contain;
}

.platform-created-event-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

.platform-created-event-copy strong {
  color: var(--text);
}

@media (max-width: 700px) {
  .home-sections {
    grid-template-columns: 1fr;
  }

  .home-section-link {
    min-height: 0;
  }

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

  .gallery-item {
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 1;
  }

  .gallery-item--wide {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 300px);
    max-width: 300px;
    aspect-ratio: var(--gallery-aspect, 3);
  }

  .revision-card--single {
    flex-basis: min(44vw, 190px);
    width: min(44vw, 190px);
  }

  .gallery-date-divider {
    grid-column: 1 / -1;
  }
}

/* Artwork-version viewer metadata must reserve the same vertical space for
   every version. Alignment is computed inside the remaining media stage, so a
   version with no posts / an approximate date must not resize that stage. */
.modal-subtext.media-viewer-footer--artwork-version {
  display: grid;
  grid-template-rows: 1.25rem 2rem;
  row-gap: 0.35rem;
  height: calc(5rem + env(safe-area-inset-bottom));
  max-height: calc(5rem + env(safe-area-inset-bottom));
  overflow: hidden;
}

.media-viewer-artwork-date {
  min-width: 0;
  min-height: 1.25rem;
  overflow: hidden;
  color: rgb(255 255 255 / 0.72);
  line-height: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Homepage introduction and manually curated featured artwork strip. */
.home-lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem) !important;
}

.home-featured {
  margin: 0 0 2.25rem;
}

.home-featured-heading,
.page-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.home-featured-heading h2,
.page-heading-row h1 {
  margin-top: 0;
}

.home-featured-grid {
  margin-top: 0.75rem;
}

.home-all-accounts {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}

.home-contact {
  margin-top: 1.5rem;
  color: var(--muted);
}

.activity-page .post-activity {
  margin-top: 0.5rem;
}

@media (max-width: 620px) {
  .page-heading-row,
  .home-featured-heading {
    align-items: flex-start;
  }
}

/* Homepage cards can contain previews and platform links beneath their descriptions. */
.home-section-title {
  color: inherit;
  text-decoration: none;
}

.home-section-title:hover,
.home-section-title:focus-visible {
  text-decoration: underline;
}

.home-social-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.home-social-icons a {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
}

.home-social-icons img {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
}

.home-featured-grid,
.home-revision-example {
  margin-top: 0.55rem;
}

.home-featured-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.home-featured-grid .gallery-item,
.home-revision-example .gallery-item {
  width: min(100%, 8.5rem);
  height: 8.5rem;
}

.home-revision-example {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.home-revision-example .gallery-item {
  width: 100%;
}

.home-section-card {
  display: grid;
  gap: 0.35rem;
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface);
}

.home-section-card > span {
  color: var(--muted);
}

.home-section-card > .home-section-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.home-section-card > .home-section-link:hover,
.home-section-card > .home-section-link:focus-visible { text-decoration: underline; }

/* Homepage section cards remain single navigation targets. Their previews are
   descriptive only, so clicking anywhere in the card follows the section link. */
.home-sections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-section-link[data-home-section="gallery"] {
  grid-column: 1 / -1;
}

.home-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.home-artwork-thumb {
  display: block;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0.45rem;
  background: var(--background);
}

.home-artwork-thumb img,
.home-artwork-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-platforms-preview {
  position: relative;
  display: block;
  min-height: 0;
  max-height: 15rem;
  margin-top: 0.85rem;
  overflow: hidden;
  border-radius: 0.65rem;
}

.home-platforms-preview::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  height: 5.5rem;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface) 88%);
}

.home-platforms-preview-inner {
  display: grid;
  gap: 0.55rem;
}

.home-social-platform {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 2.2fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--background) 38%, transparent);
}

.home-social-platform-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.home-social-platform-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--background);
  font-weight: 750;
}

.home-social-platform-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-social-platform-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text) !important;
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-social-posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  min-width: 0;
}

.home-social-post-thumb {
  display: block;
  min-width: 0;
  aspect-ratio: 1.35 / 1;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--background);
}

.home-social-post-thumb img,
.home-social-post-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-revision-example {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

@media (max-width: 700px) {
  .home-sections {
    grid-template-columns: 1fr;
  }

  .home-section-link[data-home-section="gallery"] {
    grid-column: auto;
  }

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

  .home-social-platform {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

}


/* Square editorial theme ----------------------------------------------------
   Keep the archive visually quiet and image-led: hard edges, simple rules and
   flat surfaces. Profile avatars and activity dots stay circular because their
   shape is part of the content/data, not card chrome. */

.site-nav a,
.language-nav a,
.tab-list a,
.listing-actions a,
.listing-actions button,
.pagination a,
.pagination span,
.platform-view-tabs a,
.theme-toggle {
  border: 1px solid transparent;
  border-radius: 0;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.language-nav a:hover,
.language-nav a:focus-visible,
.tab-list a:hover,
.tab-list a:focus-visible,
.listing-actions a:hover,
.listing-actions a:focus-visible,
.listing-actions button:hover,
.listing-actions button:focus-visible,
.pagination a:hover,
.pagination a:focus-visible,
.platform-view-tabs a:hover,
.platform-view-tabs a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--border);
  background: var(--surface);
}

.language-nav a.active,
.tab-list a.active,
.pagination a.active,
.platform-view-tabs a.active {
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.card,
.post-card,
.platform-card,
.artwork-media,
.platform-hero,
.platform-page--twitter .post-card--twitter .post-media-grid,
.platform-page--tumblr .post-card--tumblr,
.platform-links,
.status,
.media-viewer-switcher,
.media-viewer-switcher-preview,
.media-viewer-close,
.media-viewer-play-button,
.media-viewer-post-link,
.media-viewer-post-reference .media-viewer-post-link,
.media-viewer-post-reference .media-viewer-post-link:only-child,
.media-viewer-post-original,
.compact-media-count--pixiv,
.compact-date-tooltip,
.activity-popover,
.activity-post,
.activity-post-thumbnail,
.lost-post-note,
.compact-lost-badge,
.platform-preview-lost,
.post-version-evidence,
.post-reblog-details > summary,
.post-reblog-panel,
.gallery-video-indicator,
.home-all-accounts,
.home-social-icons a,
.home-section-link,
.home-section-card,
.home-artwork-thumb,
.home-platforms-preview,
.home-social-platform,
.home-social-post-thumb {
  border-radius: 0;
}

/* Floating information should read like a bordered inset rather than a modern
   elevated card. */
.activity-popover,
.post-reblog-panel {
  box-shadow: none;
}

.activity-month-dot {
  transition: none;
}

.activity-month > summary:hover .activity-month-dot,
.activity-month > summary:focus-visible .activity-month-dot,
.activity-month[open] > summary .activity-month-dot {
  transform: none;
  box-shadow: none;
  border-color: currentColor;
}

/* Home cards are large navigation blocks; a firm rule is enough feedback. */
.home-section-link:hover,
.home-section-link:focus-visible,
.platform-card:has(.platform-card-hit-area:hover) {
  border-color: currentColor;
}

/* Keep keyboard focus obvious without re-introducing rounded/glowing chrome. */
.home-section-link:focus-visible,
.platform-card-hit-area:focus-visible,
.site-nav a:focus-visible,
.language-nav a:focus-visible,
.tab-list a:focus-visible,
.listing-actions a:focus-visible,
.listing-actions button:focus-visible,
.pagination a:focus-visible,
.platform-view-tabs a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Unknown is represented by a generic question-mark asset rather than a
   platform/profile avatar. Keep the glyph comfortably inside the avatar
   circle instead of cropping it like a photographic profile image. */
.platform-card--Unknown .platform-card-avatar {
  overflow: hidden;
}

.platform-card--Unknown .platform-card-avatar > img {
  width: 68%;
  height: 68%;
  border-radius: 0;
  object-fit: contain;
}
