:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --ink: #161925;
  --muted: #565a69;
  --line: #dcdad3;
  --card: #fffcf8;
  --blue: #294ac8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 20px; font-weight: 750; text-decoration: none; }
.brand-mark { display: block; position: relative; width: 28px; height: 28px; border-radius: 10px; background: var(--blue); }
.brand-mark::before, .brand-mark::after { position: absolute; content: ""; background: #fff; }
.brand-mark::before { width: 8px; height: 8px; top: 5px; left: 10px; border-radius: 50%; }
.brand-mark::after { width: 14px; height: 7px; top: 15px; left: 7px; border-radius: 8px 8px 4px 4px; }
.header-link, .site-footer a { font-size: 14px; color: var(--muted); text-decoration: none; }
.header-link:hover, .site-footer a:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  min-height: 440px;
  padding-block: 50px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { margin: 0; font-size: clamp(48px, 6.2vw, 91px); letter-spacing: -.07em; line-height: 1.08; font-weight: 800; }
.hero p { margin: 24px 0 29px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.primary-link {
  display: inline-flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 10px 18px;
  color: #fff;
  background: var(--blue);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.primary-link:hover { background: #203aa4; }
.hero-images {
  display: grid;
  grid-template-columns: 1.18fr .85fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  height: clamp(245px, 26vw, 365px);
  min-width: 0;
}
.hero-tile { display: block; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 15px; overflow: hidden; background: #e7e4dc; }
.hero-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.hero-tile:hover img { transform: scale(1.035); }
.hero-tile-cat { grid-row: 1 / 3; }
.hero-tile-drawing img { object-position: 50% 36%; }
.hero-tile-landscape img { object-position: 50% 54%; }

.gallery { padding: 45px 0 63px; min-height: 460px; }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 21px; }
.gallery h2 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.04em; }
.gallery-heading p { margin: 0; font-size: 14px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 11px; width: min(320px, 100%); padding: 0 14px; border: 1px solid #cdcac1; border-radius: 8px; background: var(--card); }
.search-icon { width: 14px; height: 14px; flex-shrink: 0; border: 1.5px solid var(--muted); border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: var(--muted); right: -5px; bottom: -2px; transform: rotate(45deg); }
.search input { min-width: 0; width: 100%; height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.filters button, .more { background: transparent; color: var(--ink); border: 1px solid #d4d1ca; border-radius: 6px; font-size: 14px; padding: 8px 15px; }
.filters button:hover, .more:hover { background: #e8e5dc; }
.filters button[aria-pressed="true"] { background: var(--ink); color: white; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }

.card {
  display: block;
  min-width: 0;
  text-align: start;
  padding: 0;
  color: var(--ink);
  border: 1px solid #dfdcd4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.card:hover { border-color: #8f9ed9; box-shadow: 0 5px 20px #1b275d17; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #e7e4dc; }
.card-meta { display: grid; gap: 4px; padding: 11px 10px 12px; }
.card strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-details { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 7px; color: var(--muted); font-size: 12px; }
.card-details time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.more { display: block; margin: 32px auto 0; min-height: 44px; }
.empty { margin-block: 45px; text-align: center; color: var(--muted); }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 70px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

dialog { position: fixed; width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 24px 100px #11132650; }
dialog::backdrop { background: #101429b3; }
dialog img { display: block; width: 100%; height: auto; max-height: min(68dvh, 540px); object-fit: contain; background: #e7e4dc; }
.close { position: absolute; top: 10px; right: 10px; width: 39px; height: 39px; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); font-size: 27px; line-height: 1; }
.preview-body { padding: 17px 20px 22px; }
.preview-body h2 { margin: 0; font-size: 23px; }
.preview-body p { margin: 7px 0 16px; color: var(--muted); font-size: 13px; }
.preview-body .preview-date { margin-bottom: 4px; }
.preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
.source-link { font-size: 13px; }

.credits-page { max-width: 820px; padding-block: 38px; line-height: 1.8; }
.credits-page h1 { line-height: 1.25; }
.credits-page li { margin-bottom: 8px; overflow-wrap: anywhere; }
.credits-page a { text-underline-offset: .18em; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 52px); }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .site-header { min-height: 60px; }
  .hero { grid-template-columns: 1fr; gap: 23px; padding-block: 30px; }
  .hero h1 { font-size: clamp(45px, 12vw, 64px); }
  .hero p { margin: 13px 0 17px; }
  .hero-images { height: clamp(195px, 64vw, 300px); gap: 8px; }
  .hero-tile { border-radius: 10px; }
  .gallery { padding-top: 30px; }
  .gallery-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .gallery h2 { font-size: 28px; }
  .search { width: 100%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .card-meta { padding: 8px 7px; }
  .card strong { font-size: 12px; }
  .card-details { font-size: 11px; }
  .filters button { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
