.home-cover { position: relative; display: block; width: 100%; height: clamp(260px, 46svh, 520px); padding: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); overflow: visible; color: inherit; cursor: pointer; }
.home-cover-frame { position: relative; min-width: 0; }
.home-cover-author { position: absolute; right: calc(100% + 18px); bottom: 48px; writing-mode: vertical-rl; max-height: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: 12px; border-block-start: 1px solid currentColor; color: var(--ink); font-family: var(--serif, 'Songti SC', SimSun, serif); font-size: 16px; font-weight: 500; letter-spacing: .12em; line-height: 24px; text-decoration: none; }
.home-cover-author[hidden] { display: none; }
.home-cover-author.is-sketch-pending { overflow: visible; border-color: transparent; }
.home-cover-author.is-sketch-pending.sketch-rule-top-ready { border-block-start-color: currentColor; }
.home-cover-author.is-sketch-pending .home-cover-author-name { opacity: 0; }
.home-cover-author:hover { color: var(--ink); }
.home-cover-author:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.home-cover:disabled { cursor: default; opacity: 1; }
.home-cover img, .home-cover-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); border-radius: 2px; }
.home-cover img[hidden] { display: none; }
.home-cover-canvas { z-index: 1; opacity: 0; pointer-events: none; }
.home-cover-canvas.is-ready { opacity: 1; }
.home-cover.is-sketch-pending .home-cover-canvas { visibility: hidden; }
.home-cover.is-sketch-pending img { visibility: hidden; }
.home-cover.is-sketch-pending:not(.sketch-frame-ready) { border-color: transparent; background: transparent; }
.home-title-space { min-height: 420px; height: 65vh; height: 65svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: center; padding: 40px var(--page-gutter); }
.home-title-space { position: relative; isolation: isolate; }
.home-title-space::before { content: ""; position: absolute; z-index: -1; inset: 0 var(--page-gutter); border-inline: 1px solid var(--grid-line); background: linear-gradient(90deg, transparent calc(100% - 1px), var(--grid-line) 0) 0 0 / var(--grid-columns) 100%; pointer-events: none; }
.home-title-space::after { content: ""; position: absolute; left: var(--page-gutter); right: var(--page-gutter); bottom: 24px; height: 9px; border-top: 1px solid var(--line); background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) left top / 73px 5px no-repeat; opacity: .55; pointer-events: none; }
.home-title-copy { position: relative; width: fit-content; max-width: 100%; padding: 12px 0; }
.home-title-copy::after { content: ""; position: absolute; left: 0; bottom: -32px; width: 80px; height: 8px; border-top: 1px solid var(--line); background: linear-gradient(var(--muted), var(--muted)) left top / 18px 1px no-repeat, repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 8px) left top / 100% 4px no-repeat; pointer-events: none; }
.home-cover::before, .home-cover::after { content: ""; position: absolute; z-index: -1; width: 52px; height: 52px; border: solid var(--line); pointer-events: none; }
.home-cover::before { top: -13px; right: -13px; border-width: 1px 1px 0 0; }
.home-cover::after { bottom: -13px; left: -13px; border-width: 0 0 1px 1px; }
@media (max-width: 760px) {
  .home-title-copy::after { bottom: -12px; width: 56px; }
  .home-title-space::after { bottom: 16px; }
  .home-cover::before, .home-cover::after { width: 32px; height: 32px; }
  .home-cover::before { top: -8px; right: -8px; }
  .home-cover::after { bottom: -8px; left: -8px; }
}
#home-title { font: 400 clamp(34px, 3.6vw, 80px)/1.55 var(--serif); letter-spacing: .04em; overflow-wrap: anywhere; text-wrap: balance; }
.home-title-line { display: block; text-wrap: balance; }
.home-title-line:first-child { max-width: 8.5em; }
.home-title-line + .home-title-line { max-width: 23em; margin-top: clamp(28px, 3vw, 48px); font-size: clamp(15px, 1.12vw, 20px); line-height: 1.9; letter-spacing: .09em; color: var(--muted); }
.home-title-copy.is-sketch-pending .home-title-block { opacity: 0; }
@media (max-width: 600px) {
  #home-title { font-size: clamp(30px, 8.2vw, 48px); }
  .home-title-line + .home-title-line { max-width: 21em; margin-top: 24px; font-size: 15px; letter-spacing: .04em; }
}
@media (prefers-reduced-motion: reduce) { .home-title-copy.is-sketch-pending .home-title-block { opacity: 1; } }
.image-wall-section {
  scroll-margin-top: var(--home-nav-height, 98px);
  position: relative;
  isolation: isolate;
  background: var(--paper);
  overflow: clip;
}
.image-wall-section::before {
  content: "";
  position: absolute;
  inset: 0 var(--page-gutter);
  border-inline: 1px solid var(--grid-line);
  background: linear-gradient(90deg, transparent calc(100% - 1px), var(--grid-line) 0) 0 0 / var(--grid-columns) 100%;
  pointer-events: none;
}
.wall-stage {
  position: relative;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  height: calc(100vh - var(--home-nav-height));
  height: calc(100svh - var(--home-nav-height));
  /* Clip without creating a scroll container that focused tiles can pan. */
  overflow: clip;
  touch-action: pan-y;
  background: transparent;
}
.wall-stage::before, .wall-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
/* Edge veils stay under the hover preview so focused cards remain readable. */
.wall-stage::before { top: 0; z-index: 2; height: 8%; background: linear-gradient(var(--paper) 0%, var(--paper) 20%, transparent 100%); }
.wall-stage::after { bottom: 0; z-index: 8; height: 12%; background: linear-gradient(transparent, var(--paper)); }
.wall-perspective { position: absolute; inset: 0; z-index: 1; perspective: 1400px; transform-style: preserve-3d; }
.wall-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--paper) 0%, transparent) 0%, color-mix(in srgb, var(--paper) 0%, transparent) 40%, color-mix(in srgb, var(--paper) 34.9%, transparent) 72%, color-mix(in srgb, var(--paper) 70.2%, transparent) 100%);
}
.wall-scene {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transition: opacity .55s;
  will-change: transform;
}
.wall-row { position: absolute; left: 0; width: 100%; contain: layout style; will-change: transform; }
.wall-tile {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--muted) 14.12%, transparent);
  border-radius: 2px;
  background: var(--surface, var(--surface-soft));
  overflow: hidden;
  cursor: pointer;
  transform-origin: center;
}
.wall-tile:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
/* Author display:block overrides the browser's default [hidden] rule. */
.wall-tile[hidden] { display: none; }
.image-wall-section[data-entrance="pending"] .wall-scene { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .image-wall-section[data-entrance="pending"] .wall-scene { visibility: visible; }
}
.wall-tile.is-moving { will-change: transform, opacity; }
.wall-surface { display: block; width: 100%; height: 100%; background: var(--surface, var(--surface-soft)); }
.wall-surface img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.wall-hover, .wall-zoom {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--muted) 18.82%, transparent);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: none;
  will-change: transform, width, height, opacity;
}
.wall-hover {
  z-index: 3;
  border-color: #8c857866;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 4.71%, transparent);
}
.wall-hover .wall-surface { filter: brightness(1.025); }
.wall-zoom { z-index: 6; transform-origin: 0 0; will-change: transform, opacity; }
.wall-fog {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 350px 500px at center, color-mix(in srgb, var(--paper) 98.04%, transparent) 15%, color-mix(in srgb, var(--paper) 78.04%, transparent) 48%, color-mix(in srgb, var(--paper) 1.96%, transparent) 100%);
  transition: opacity .6s;
}
.image-wall-section[data-open="true"] .wall-scene { opacity: .48; }
.image-wall-section[data-open="true"] .wall-fog { opacity: 1; }
.wall-detail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  color: var(--ink);
}
.wall-detail::backdrop { background: transparent; }
.wall-detail-panel {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--wall-detail-offset, 0px));
  width: min(360px, calc(100% - 56px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}
.wall-detail[open] .wall-photo-title, .wall-detail[open] .wall-photo-info {
  animation: wall-caption-in .6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes wall-caption-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.wall-photo-title {
  margin: 0 0 17px;
  font: 400 29px/1.15 "Times New Roman", "Songti SC", "SimSun", serif;
  overflow-wrap: anywhere;
  max-height: 15vh;
  overflow: auto;
  pointer-events: auto;
}
.wall-photo-frame {
  position: relative;
  flex: none;
  width: var(--photo-width);
  height: var(--photo-height);
  margin-bottom: 16px;
}
.wall-photo-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  width: 100%;
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font: 13px/1.7 system-ui, sans-serif;
  padding: 8px 12px;
  border-radius: 3px;
  max-height: 22vh;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
}
.wall-photo-info[hidden], .wall-photo-title[hidden] { display: none; }
.wall-photo-info > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 5px; min-width: 0; }
.wall-photo-info > .wall-info-wide { width: 100%; }
.wall-photo-info dt { color: var(--muted); }
.wall-photo-info dd { margin: 0; overflow-wrap: anywhere; }
.wall-close, .wall-photo-author {
  position: absolute;
  left: calc(100% + 6px);
  box-sizing: border-box;
  width: 44px;
  border: 1px solid color-mix(in srgb, var(--muted) 14.12%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-raised) 90.2%, transparent);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
}
.wall-close {
  top: 0;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}
.wall-close:hover, .wall-photo-author:hover { background: var(--surface-raised); }
.wall-jump { top: 48px; }
.wall-jump[hidden] { display: none; }
.wall-photo-author {
  top: 96px;
  max-height: max(44px, calc(100% - 96px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 4px 4px 8px;
  text-decoration: none;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.wall-photo-author[hidden] { display: none; }
.wall-photo-author img { box-sizing: border-box; width: 30px; height: 30px; flex: none; object-fit: cover; border: 1px solid color-mix(in srgb, var(--muted) 14.12%, transparent); border-radius: 2px; }
.wall-photo-author span { writing-mode: vertical-rl; flex: none; overflow-wrap: anywhere; }
.wall-author-id { font: 13px/1.6 var(--serif); letter-spacing: .04em; }
.wall-author-name { font: 12px/1.6 system-ui, sans-serif; color: var(--muted); letter-spacing: .06em; }
.wall-close:focus-visible, .wall-photo-author:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.wall-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.3; }
@supports (backdrop-filter: blur(16px)) {
  .wall-close, .wall-photo-author { background: color-mix(in srgb, var(--surface-raised) 80%, transparent); backdrop-filter: blur(16px); }
}
@media (max-width: 600px) {
  .wall-stage::before { height: 6%; }
  .wall-stage::after { height: 10%; }
}
@media (prefers-reduced-motion: reduce) {
  .wall-scene, .wall-fog { transition: none; }
  .wall-detail[open] .wall-photo-title, .wall-detail[open] .wall-photo-info { animation: none; }
}

@media (max-width: 760px) {
  .home-title-space { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 65svh; gap: 36px; padding-block: 48px; }
  .home-cover { height: auto; aspect-ratio: 4 / 3; }
  .home-cover-author { position: relative; inset: auto; display: block; width: fit-content; max-width: 100%; max-height: none; margin-top: 16px; writing-mode: horizontal-tb; }
}

@media (max-height: 500px) and (min-width: 601px) and (max-width: 1000px) {
  .home-title-space { grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; min-height: calc(100svh - var(--home-nav-height)); gap: 32px; padding-block: 32px 48px; }
  #home-title { font-size: clamp(24px, 3.8vw, 34px); }
  .home-title-line + .home-title-line { font-size: 14px; margin-top: 20px; }
  .home-cover { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .home-cover-author { position: relative; inset: auto; display: block; writing-mode: horizontal-tb; width: fit-content; max-width: 100%; max-height: none; margin-top: 8px; padding-block: 6px; font-size: 14px; }
}
