/* finesse · cat observation notebook · HEYTEA-inspired neutral white / black ink / photo collage · fan + row · 2026-10-31 */
@font-face {
  font-family: "Cat Hand";
  src: url("assets/handwriting-headings.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --page: #f9f9f9;
  --paper: #f9f9f9;
  --ink: #222222;
  --muted: #6b6b6b;
  --accent: #222222;
  --accent-ink: #303030;
  --line: #d9d9d9;
  --border-subtle: #e3e3e3;
  --photo-white: #ffffff;
  --photo-line: #e8e8e8;
  --hover-surface: #eeeeee;
  --hover-warm: #eeeeee;
  --switch-active: #222222;
  --input-border: #e4e4e4;
  --close-surface: #f9f9f9f5;
  --backdrop: #22222273;
  --shadow-close: #0000000a;
  --shadow-far: #0000001a;
  --shadow-lift: #0000002e;
  --shadow-modal: #00000024;
  --intro-ink: #555555;
  --body-ink: #4c4c4c;
  --scroll-thumb: #c7c7c7;
  --note-paper: #efefef;
  --tape: #d6d6d673;
  --on-accent: #ffffff;
  --control-hover: #3a3a3a;
  --border-translucent: #ffffff80;
  --border-panel: #e7e7e7;
  --input-surface: #f0f0f0;
  --image-fallback: #d6d6d6;
  --photo-wash: #22222222;
  --photo-shade: #222222d9;
  --photo-shadow: #00000060;
  --switch-surface: #f3f3f3;
  --switch-border: #d3d3d3;
  --shadow-control: #0000000d;
  --empty-muted: #6b6b6b;
  --detail-fallback: #e4e4e4;
  --shadow-shell: #00000000;
  --hand: "Cat Hand", "KaiTi", "STKaiti", "Kaiti SC", cursive;
}
body { background: var(--paper); }
body::before { content: none; }
.gallery-shell { max-width: 1500px; width: 100%; min-height: 100svh; margin: 0 auto; padding: 22px 56px 18px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.topbar { width: 100%; height: 54px; margin: 0; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.brand { font-family: var(--hand); font-size: 32px; font-weight: 400; gap: 12px; letter-spacing: 0; }
.brand-mark { color: var(--ink); width: 30px; height: 30px; stroke-width: 1.2; }
.brand-dot { color: var(--ink); }
.topbar-note { font-size: 11px; letter-spacing: 1px; }
.intro { max-width: 740px; margin: 32px auto 30px; text-align: left; }
.intro-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.intro-copy { min-width: 0; }
.intro .intro-kicker { margin: 0 0 10px 4px; font-size: 11px; letter-spacing: 5px; color: var(--muted); }
h1 { font-family: var(--hand); font-size: clamp(45px, 5.3vw, 76px); line-height: 1.1; font-weight: 400; letter-spacing: -1px; white-space: normal; font-synthesis: none; }
h1 span { display: block; font-family: inherit; font-weight: inherit; margin-top: 6px; }
.intro-sketch { width: 188px; height: auto; flex: 0 0 auto; transform: rotate(3deg); margin: 34px 7px 0 0; }
.intro .intro-description { font-size: 12px; letter-spacing: 2px; line-height: 1.8; margin: 19px 0 0 5px; }
.browse-tools { justify-content: space-between; max-width: 1060px; margin: 0 auto; padding: 0; border-bottom: 1px solid var(--line); gap: 20px; }
.category-tabs { gap: 25px; }
.category-button { min-height: 48px; border-radius: 0; padding: 9px 2px; position: relative; }
.category-button:hover { background: transparent; color: var(--ink); }
.category-button.is-selected { color: var(--ink); background: transparent; }
.category-button.is-selected::after { content: ""; position: absolute; height: 1px; bottom: -1px; left: 0; right: 0; background: var(--ink); transform: rotate(-1.5deg); }
.category-button span { color: var(--muted); opacity: 1; font-size: 10px; }
.search-box { border: 1px solid var(--input-border); border-radius: 3px; width: 220px; padding: 8px 12px; background: var(--input-surface); margin-bottom: 7px; }
.search-box input { font-size: 12px; }
.gallery { max-width: 1280px; }
.stage { height: 455px; }
.cat-card { border-radius: 2px; }
.card-face { display: grid; grid-template-rows: minmax(0, 1fr) 78px; padding: 8px 8px 0; border: 1px solid var(--photo-line); border-radius: 2px; background: var(--photo-white); box-shadow: 0 2px 3px var(--shadow-close), 0 13px 21px -10px var(--shadow-far); }
.card-face::after { display: none; }
.card-face img { height: 100%; min-height: 0; object-position: center 38%; }
.card-copy { position: relative; inset: auto; display: flex; flex-direction: column; justify-content: center; padding: 4px 4px 3px; color: var(--ink); min-width: 0; }
.card-category { font-size: 8px; line-height: 1.4; letter-spacing: 2px; margin-bottom: 3px; color: var(--muted); opacity: 1; }
.card-title, .stage[data-layout="row"] .card-title { font-family: var(--hand); font-size: 25px; font-weight: 400; line-height: 1.05; text-shadow: none; padding-right: 9px; text-wrap: balance; }
.card-arrow { width: 13px; height: 13px; bottom: 13px; right: 0; color: var(--muted); }
.cat-card.is-active .card-face { box-shadow: 0 4px 8px var(--shadow-close), 0 22px 32px -15px var(--shadow-lift); }
.cat-card:focus-visible .card-face { outline-width: 2px; }
.below-deck { margin-top: 3px; }
.deck-caption { font-size: 11px; letter-spacing: 1px; }
.caption-dot { width: 3px; height: 3px; background: var(--muted); }
.round-button { border-color: var(--line); border-radius: 3px; }
.mode-switch { margin-top: 20px; border: 0; border-radius: 0; padding: 0; gap: 10px; background: transparent; }
.mode-switch button { border: 1px solid var(--line); border-radius: 2px; min-width: 92px; padding: 8px 14px; }
.mode-switch button.is-selected { background: var(--switch-active); border-color: var(--accent); color: var(--on-accent); box-shadow: none; }
.mode-switch button:hover:not(:disabled) { border-color: var(--accent); }
.mode-switch button.is-selected:hover:not(:disabled) { background: var(--control-hover); color: var(--on-accent); }
.mode-note { margin-top: 13px; font-size: 11px; letter-spacing: 1px; }
.page-footer { margin-top: 30px; padding-top: 8px; }
.page-footer > span { padding-top: 0; font-family: var(--hand); font-size: 23px; color: var(--ink); letter-spacing: 0; }
.empty-state h2 { font-family: var(--hand); font-size: 36px; }
.empty-cat { color: var(--ink); }
dialog { width: min(1050px, calc(100% - 64px)); max-height: min(900px, calc(100svh - 48px)); border: 1px solid var(--photo-line); border-radius: 3px; box-shadow: 0 20px 80px var(--shadow-modal); }
dialog::backdrop { backdrop-filter: blur(3px); }
.detail-close { top: 14px; margin: 14px 14px -58px 0; border-radius: 50%; }
.detail-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 43px; padding: 46px 38px 30px; }
.detail-visual { top: 34px; }
.detail-photo { position: relative; margin: 0; background: var(--photo-white); border: 1px solid var(--photo-line); padding: 12px 12px 8px; box-shadow: 0 4px 12px var(--shadow-close); transform: rotate(-1.5deg); }
.detail-photo::before { content: ""; position: absolute; z-index: 1; width: 92px; height: 28px; background: var(--tape); top: -15px; left: calc(50% - 46px); transform: rotate(5deg); }
.detail-photo > img { width: 100%; height: 390px; display: block; object-fit: cover; object-position: center; background: var(--detail-fallback); }
.detail-image-note { margin: 14px 2px 6px; font-size: 11px; line-height: 1.6; gap: 8px; }
#detail-category { color: var(--muted); }
.photo-handnote { font-family: var(--hand); font-size: 27px; line-height: 1.3; text-align: center; margin: 25px 0 0; transform: rotate(-3deg); }
.detail-visual > .detail-sketch { display: block; width: 120px; height: auto; margin: 8px auto 0; opacity: .8; background: transparent; border-radius: 0; object-fit: contain; }
.detail-copy { padding: 5px 0 6px; }
.detail-heading h2 { font-family: var(--hand); font-size: 52px; font-weight: 400; line-height: 1.12; margin: 0 24px 10px 0; }
#detail-subtitle { font-size: 13px; margin-bottom: 20px; }
.detail-intro { font-size: 14px; line-height: 1.95; border: 0; background: var(--note-paper); padding: 17px 19px; margin-bottom: 27px; border-radius: 1px 7px 2px 1px; }
.detail-section { margin-bottom: 23px; }
.detail-section h3 { font-family: var(--hand); font-size: 25px; font-weight: 400; line-height: 1.25; margin-bottom: 8px; color: var(--ink); }
.detail-section h3::before { width: 10px; height: 1px; border-radius: 0; background: var(--accent); transform: rotate(-9deg); }
.detail-section p { font-size: 14px; line-height: 1.95; }
.detail-sources { margin-top: 28px; padding-top: 17px; }
@media(min-width:1500px) { .stage { height: 470px; } }
@media(max-width:1100px) {
  .gallery-shell { padding-inline: 34px; }
  .intro { max-width: 670px; }
  .stage { height: 420px; }
  .detail-grid { gap: 28px; padding-inline: 28px; }
  .detail-photo > img { height: 350px; }
}
@media(max-width:760px) {
  .gallery-shell { padding: 16px 23px; }
  .topbar { padding-bottom: 10px; }
  .brand { font-size: 29px; }
  .intro { margin: 32px auto 24px; }
  .intro-sketch { width: 135px; margin-right: 0; }
  .intro .intro-kicker { font-size: 10px; letter-spacing: 4px; }
  .intro .intro-description { font-size: 11px; letter-spacing: 1px; }
  .stage { height: 395px; }
  .category-tabs { gap: 18px; }
  .category-button { font-size: 12px; }
  .search-box { width: 170px; }
  dialog { width: calc(100% - 32px); max-height: calc(100svh - 30px); border-radius: 3px; }
  .detail-grid { display: block; padding: 39px 25px 26px; }
  .detail-visual { position: static; }
  .detail-photo { max-width: 430px; margin: 0 auto; padding: 10px 10px 6px; }
  .detail-photo > img { height: 300px; }
  .detail-visual > .detail-sketch { display: none; }
  .photo-handnote { margin: 22px 0 24px; font-size: 25px; }
  .detail-copy { padding: 8px 0 0; }
  .detail-heading h2 { font-size: 46px; }
}
@media(max-width:600px) {
  .gallery-shell { padding: 15px 18px 12px; }
  .topbar { height: 49px; }
  .brand { font-size: 27px; gap: 8px; }
  .brand-mark { width: 25px; height: 25px; }
  .topbar-note { display: block; font-size: 9px; letter-spacing: 0; }
  .topbar-note span { margin: 0 3px; }
  .intro { margin-top: 29px; margin-bottom: 25px; }
  .intro-heading { gap: 0; position: relative; }
  .intro-copy { width: 100%; }
  h1 { font-size: clamp(34px, 10.2vw, 60px); letter-spacing: -1px; line-height: 1.15; }
  h1 span { margin-top: 6px; }
  .intro-sketch { position: absolute; top: -7px; right: -2px; width: 100px; margin: 0; }
  .intro .intro-kicker { margin-left: 2px; margin-bottom: 12px; letter-spacing: 3px; }
  .intro .intro-description { margin: 18px 0 0 2px; font-size: 11px; letter-spacing: .3px; }
  .browse-tools { display: flex; flex-direction: column; gap: 5px; align-items: stretch; padding: 0; border-bottom: 0; }
  .category-tabs { justify-content: flex-start; gap: 28px; border-bottom: 1px solid var(--line); }
  .category-button { font-size: 12px; min-height: 44px; padding: 8px 0; }
  .search-box { width: 100%; min-height: 44px; padding: 8px 11px; margin: 5px 0 0; border: 1px solid var(--input-border); border-radius: 3px; background: var(--input-surface); }
  .search-box input { font-size: 12px; }
  .gallery { margin-inline: -10px; }
  .stage { height: 350px; }
  .card-face { padding: 6px 6px 0; grid-template-rows: minmax(0, 1fr) 72px; border-width: 1px; }
  .card-title, .stage[data-layout="row"] .card-title { font-size: 24px; line-height: 1.08; }
  .card-copy { padding-left: 3px; }
  .stage[data-layout="fan"] .card-face { grid-template-rows: minmax(0, 1fr) 56px; padding: 4px 4px 0; }
  .stage[data-layout="fan"] .card-title { font-size: 18px; }
  .stage[data-layout="fan"] .card-copy { left: auto; right: auto; }
  .stage[data-layout="fan"] .card-category { font-size: 7px; letter-spacing: 1px; }
  .stage[data-layout="fan"] .card-arrow { display: none; }
  .below-deck { min-height: 44px; padding-right: 0; }
  .deck-caption { font-size: 10px; letter-spacing: 0; }
  .row-navigation { position: static; margin-left: 12px; gap: 4px; }
  .row-navigation .round-button { width: 44px; height: 44px; }
  .mode-switch { margin-top: 19px; gap: 8px; }
  .mode-switch button { min-width: 82px; padding-inline: 10px; font-size: 11px; }
  .mode-note { font-size: 10px; letter-spacing: .3px; }
  .page-footer { margin: 27px 0 0; padding-top: 12px; flex-wrap: wrap; gap: 0 12px; }
  .page-footer > span { font-size: 22px; }
  .page-footer a { font-size: 10px; }
  .detail-grid { padding: 38px 19px 24px; }
  .detail-photo > img { height: 270px; }
  .detail-close { top: 10px; margin: 10px 10px -54px 0; }
  .detail-heading h2 { font-size: 42px; }
  .detail-intro { padding: 15px; }
  .detail-section h3 { font-size: 25px; }
}
@media(prefers-reduced-motion:reduce) {
  .cat-card, .card-face, .card-face img { transition: none; }
}
