@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Serif+SC:wght@500;700;900&display=swap');

:root {
  --ink: #17263d;
  --accent: #f06b3f;
  --accent-dark: #c64a27;
  --paper: #f5f1e9;
  --line: rgba(23, 38, 61, .16);
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; color: var(--ink); background: var(--paper) var(--background-image) center/cover fixed; font-family: "Noto Serif SC", serif; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(245, 241, 233, .86); }
button { font: inherit; border: 0; cursor: pointer; }
button:focus-visible { outline: 4px solid #8ec2ff; outline-offset: 3px; }

#app { min-height: 100vh; }
.page { width: min(1120px, 100%); margin: auto; padding: 28px clamp(18px, 5vw, 72px); }
.hero { min-height: 390px; position: relative; padding: 18px 0 54px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.brand-mark, .kicker, .count, footer { font: 500 12px var(--mono); letter-spacing: 1px; }
.brand-mark { border: 1px solid var(--ink); padding: 7px 9px; }
.admin-link { background: none; color: var(--ink); padding: 8px 0; font: 500 12px var(--mono); border-bottom: 1px solid transparent; }
.admin-link:hover { border-color: var(--ink); }
.kicker { margin: 72px 0 14px; color: var(--accent-dark); }
h1 { margin: 0; font-size: clamp(48px, 9vw, 108px); line-height: .98; letter-spacing: -.04em; font-weight: 900; }
h1 em { color: var(--accent); font-style: normal; }
.hero-copy { max-width: 380px; margin: 23px 0 0; line-height: 1.8; }
.search { position: absolute; right: 0; bottom: 54px; display: flex; width: min(440px, 100%); border-bottom: 2px solid var(--ink); }
.search label { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; padding: 13px 0; color: var(--ink); font: 16px var(--mono); }
.search button, .submit, .download { border: 0; background: var(--accent); color: white; padding: 13px 18px; font: 500 12px var(--mono); text-decoration: none; }
.search button:hover, .submit:hover, .download:hover { background: var(--accent-dark); }
.count { margin: 0; color: #596576; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 18px; padding: 34px 0 80px; }
.result-card { min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; animation: rise .45s ease both; }
.preview { position: relative; display: block; width: 100%; aspect-ratio: 1.25; padding: 0; overflow: hidden; background: #d9d5ce; cursor: zoom-in; }
.preview img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.preview:hover img { transform: scale(1.04); }
.zoom { position: absolute; right: 10px; bottom: 10px; padding: 5px 7px; background: rgba(23,38,61,.85); color: white; font: 10px var(--mono); }
.result-info { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: end; padding-top: 12px; }
.result-info h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.result-info p { grid-column: 1; margin: 0; color: #707a88; font: 11px var(--mono); }
.download { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
.empty { grid-column: 1 / -1; padding: 80px 0; border-top: 1px solid var(--line); text-align: center; }.empty strong, .empty span { display: block; }.empty strong { font-size: 30px; }.empty span { margin-top: 12px; color: #707a88; }
footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 18px 0 10px; color: #707a88; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); padding: 13px 18px; background: var(--ink); color: white; font: 13px var(--mono); box-shadow: 0 10px 25px #17263d44; }
.modal-backdrop { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: #17263dcc; }.modal { position: relative; width: min(900px, 100%); max-height: 92vh; padding: 18px; background: var(--paper); }.modal > img { display: block; width: 100%; max-height: 75vh; object-fit: contain; }.close { position: absolute; right: 12px; top: 8px; z-index: 1; width: 34px; height: 34px; border: 0; background: var(--paper); color: var(--ink); font-size: 28px; line-height: 1; }.modal-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; }.admin-modal { width: min(430px, 100%); padding: 36px; }.admin-modal h2 { margin: 0 0 20px; font-size: 32px; }.admin-modal form { display: grid; gap: 10px; }.admin-modal input { border: 1px solid var(--line); padding: 13px; background: transparent; font: 14px var(--mono); }.notice { line-height: 1.8; color: #596576; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) { .hero { min-height: 520px; }.kicker { margin-top: 52px; }.search { left: 0; right: auto; bottom: 64px; width: 100%; }.results { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; } }
@media (max-width: 460px) { .page { padding: 18px 16px; }.hero { min-height: 500px; } h1 { font-size: 54px; }.results { grid-template-columns: 1fr; }.result-info h2 { font-size: 17px; } }
