:root {
  color-scheme: dark;
  --bg: #12171c;
  --deep: #0d1115;
  --card: #1b2329;
  --line: #3b4248;
  --text: #f5ead6;
  --muted: #c6bcaa;
  --accent: #ecc291;
  --rust: #c88460;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.05; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #ffe1b0; outline-offset: 4px; }
a:hover { color: #ffdbab; }
.wrap { width: min(74rem, calc(100% - 4rem)); margin-inline: auto; }
.skip { position: fixed; top: .7rem; left: .7rem; z-index: 3; background: var(--accent); color: var(--deep); padding: .75rem; transform: translateY(-160%); }
.skip:focus { transform: none; }
.masthead { background: var(--deep); border-bottom: 1px solid #3e3833; }
.sitebar { display: flex; align-items: center; min-height: 4.3rem; gap: 1.4rem; }
.wordmark { font: bold 1.05rem/1.2 var(--serif); margin-right: auto; display: inline-flex; align-items: center; gap: .7rem; min-height: 2.75rem; }
.wordmark::before { content: ""; display: block; width: 1.35rem; height: .22rem; flex-shrink: 0; background: var(--rust); }
.sitebar nav { display: flex; gap: 1.2rem; }
.sitebar nav a { min-height: 2.75rem; display: inline-flex; align-items: center; color: var(--muted); font-size: .91rem; }
.sitebar nav a[aria-current="page"], .sitebar nav a:hover { color: var(--accent); }
.sitebar nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--rust); }
.site-label, .count { color: var(--muted); font-size: .85rem; }
.signout { color: var(--accent); font-size: .88rem; padding: .52rem .67rem; border: 1px solid #62564b; background: none; border-radius: .2rem; }
.signout:hover { background: var(--card); }
.edition { color: var(--accent); font-weight: bold; font-size: .8rem; letter-spacing: .095em; }
.button { display: inline-flex; gap: .6rem; justify-content: center; align-items: center; min-height: 2.85rem; padding: .65rem .95rem; border: 1px solid transparent; border-radius: .2rem; font-size: .93rem; font-weight: bold; }
.button.primary { background: var(--accent); color: var(--deep); }
.button.primary:hover { background: #f4d0a5; }
.button.secondary { border-color: #8e7963; background: #15191cde; color: var(--text); }
.button.secondary:hover { color: var(--accent); background: var(--card); }
.arrow { font-weight: normal; font-size: 1.17em; line-height: 1; }
.text-link { color: var(--accent); font-size: .93rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: .22em; }
.hero { position: relative; isolation: isolate; background: var(--deep); overflow: hidden; }
.hero picture { position: absolute; z-index: -2; inset: 0 0 0 17%; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 61%; }
.hero::after { position: absolute; content: ""; z-index: -1; inset: 0;
  background: linear-gradient(0deg, var(--bg), transparent 38%), linear-gradient(90deg, #0d1115 15%, #0d1115df 33%, #0d111562 65%, #0d11150c);
}
.hero-content { padding-block: clamp(4.75rem, 12vw, 10rem) clamp(4rem, 10vw, 7rem); }
.hero h1 { margin: .44rem 0 1.25rem; font-size: clamp(3rem, 8vw, 6.45rem); letter-spacing: -.057em; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.section { padding-block: 2rem 3rem; }
.section h1 { font-size: clamp(2.35rem, 6vw, 4.05rem); letter-spacing: -.048em; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.section h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.022em; }
.collections { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: .75rem; margin-top: 1rem; }
.collection { position: relative; padding: 1.15rem 2rem 1.25rem 1.08rem; border: 1px solid var(--line); background: var(--card); border-radius: .2rem; }
.collection:hover, .file-card:hover { border-color: #ae8a69; }
.collection h3 { margin: .38rem 0 .47rem; font-size: 1.4rem; }
.collection p { color: var(--muted); font-size: .9rem; }
.collection .arrow { position: absolute; right: .75rem; top: 1.25rem; color: var(--accent); }
.login-layout { min-height: 76vh; display: grid; align-items: center; grid-template-columns: minmax(0,1fr) minmax(280px,26rem); gap: clamp(2rem,9vw,9rem); padding-block: 4rem; }
.login-intro h1 { font-size: clamp(3rem,7.35vw,6rem); letter-spacing: -.057em; margin: .55rem 0 1rem; }
.login-intro p:last-child { font: 1.18rem/1.55 var(--serif); color: var(--muted); max-width: 21rem; }
.login-form { display: grid; gap: .55rem; padding: clamp(1rem,4vw,1.8rem); border: 1px solid #51504c; border-top: 3px solid var(--rust); background: var(--card); border-radius: .15rem; }
.login-form h2 { font-size: 1.95rem; margin-bottom: .75rem; }
.login-form label { margin-top: .3rem; font-size: .92rem; }
.login-form button { justify-content: space-between; margin-top: .6rem; }
input, select { width: 100%; min-height: 2.8rem; border: 1px solid #626363; background: var(--deep); color: var(--text); padding: .52rem .66rem; border-radius: .2rem; }
.notice { border-left: 3px solid #de946e; background: #292521; padding: .65rem .8rem; color: #ffdfcb; }
.filters { display: grid; grid-template-columns: minmax(10rem,1fr) minmax(13rem,1.4fr) auto; align-items: end; gap: .75rem; margin-block: 1.15rem 1.95rem; max-width: 50rem; }
.filters label { font-size: .9rem; display: grid; gap: .35rem; }
.filters input, .filters select { font-size: 1rem; }
.empty { margin-block: 1rem; color: var(--muted); }
.file-group + .file-group { margin-top: 2rem; }
.files { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: .9rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.file-card { display: flex; flex-direction: column; height: 100%; min-width: 0; border: 1px solid var(--line); border-radius: .2rem; overflow: hidden; background: var(--card); }
.image-preview { background: var(--deep); position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.image-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pdf-preview { min-height: 4rem; padding: .95rem 1rem .2rem; display: flex; align-items: center; font-weight: bold; color: var(--accent); letter-spacing: .08em; }
.file-details { padding: .8rem 1rem .95rem; flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.file-details strong { font: bold 1.13rem/1.24 var(--serif); overflow-wrap: anywhere; }
.file-details small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.file-action { margin-top: auto; padding-top: .6rem; color: var(--accent); font-size: .86rem; }
.viewer { max-width: 55rem; }
.viewer h1 { margin-block: .7rem 1rem; overflow-wrap: anywhere; }
.viewer figure { background: var(--deep); border: 1px solid var(--line); }
.viewer figure img { margin-inline: auto; max-height: 75vh; object-fit: contain; }
.viewer figcaption { padding: .75rem; border-top: 1px solid var(--line); }
.image-nav { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: space-between; margin-top: 1rem; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 2.2rem); }
  .sitebar { flex-wrap: wrap; gap: 0 1rem; min-height: 3.8rem; padding-top: .22rem; }
  .sitebar nav { flex: 1 0 100%; order: 2; gap: 1rem; }
  .sitebar nav a { font-size: .87rem; }
  .login-layout { grid-template-columns: 1fr; gap: 1.65rem; min-height: 0; padding-block: 2.5rem; }
  .hero picture { left: 0; }
  .hero::after { background: linear-gradient(0deg,var(--bg),#0d1115a6 48%,#0d11155e); }
  .hero-content { padding-block: 6.75rem 2.8rem; }
}
@media (max-width: 490px) {
  .wrap { width: calc(100% - 1.6rem); }
  .sitebar nav { justify-content: space-between; gap: .4rem; }
  .sitebar nav a, .signout { font-size: .81rem; }
  .wordmark { font-size: .85rem; gap: .4rem; min-width: 0; }
  .wordmark::before { width: .76rem; }
  .site-label { font-size: .77rem; }
  .hero h1 { font-size: clamp(2.65rem,11vw,3.6rem); }
  .login-intro h1 { font-size: clamp(2.45rem,10.5vw,3.4rem); }
  .section { padding-block: 1.3rem 2rem; }
  .collections { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; margin-bottom: 1.25rem; }
  .files { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .file-details { padding: .56rem; }
  .file-details strong { font-size: 1rem; }
}
