:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657087;
  --paper: #f6f8fc;
  --surface: #ffffff;
  --line: #dce2ec;
  --blue: #1759c7;
  --blue-deep: #103b84;
  --shadow: 0 14px 38px rgba(23, 32, 51, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.category-background { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.category-background::after { position: absolute; inset: 0; content: ""; background: rgba(246, 248, 252, .34); }
.category-background img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .18; filter: saturate(.82) contrast(.9); }
.has-category-background .site-header,
.has-category-background .gallery-main,
.has-category-background .site-footer { position: relative; }
.has-category-background .gallery-main,
.has-category-background .site-footer { z-index: 1; }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(220, 226, 236, .85); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.site-header .shell { min-height: 72px; display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-size: 1.05rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--blue), var(--blue-deep)); box-shadow: 0 8px 18px rgba(23,89,199,.25); }
.home-main, .gallery-main { min-height: calc(100vh - 140px); padding-block: clamp(2.5rem, 7vw, 6rem); }
.intro { max-width: 650px; margin-bottom: 2.5rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 4.7rem); line-height: .98; letter-spacing: -.055em; }
.intro > p:last-child, .gallery-heading > p { margin: 1rem 0 0; color: var(--muted); font-size: 1.05rem; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 1rem; }
.album-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; min-height: 118px; padding: 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 1px 1px rgba(23,32,51,.03); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.album-card:hover, .album-card:focus-visible { transform: translateY(-3px); border-color: #afc5e8; box-shadow: var(--shadow); outline: none; }
.album-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: var(--blue); background: #eaf1ff; }
.album-icon svg { width: 28px; fill: currentColor; }
.album-copy { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.album-copy strong { overflow-wrap: anywhere; font-size: 1.08rem; }
.album-copy small { color: var(--muted); font-size: .86rem; }
.arrow { color: var(--blue); font-size: 1.4rem; }
.protected-album .arrow { font-size: 1.05rem; }
.locked-label { color: var(--blue) !important; font-weight: 700; }
.locked-label span { font-size: .52rem; vertical-align: .15rem; }
.back-link { display: inline-flex; margin-bottom: 2rem; color: var(--blue); font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.gallery-heading h1 { font-size: clamp(2rem, 6vw, 4rem); overflow-wrap: anywhere; }
.gallery-meta { display: flex; align-items: flex-end; flex-direction: column; gap: .35rem; }
.gallery-meta p { margin: 0; color: var(--muted); }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; }
.photo-card { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 14px; background: #dfe5ee; box-shadow: 0 1px 2px rgba(23,32,51,.08); }
.photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease, filter .25s ease; }
.photo-card:hover img, .photo-card:focus-visible img { transform: scale(1.025); filter: brightness(.92); }
.photo-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.empty-state { padding: clamp(2rem, 8vw, 5rem); border: 1px dashed #b8c2d1; border-radius: 20px; background: var(--surface); text-align: center; }
.empty-state h2 { margin-top: 0; }
.empty-state p { margin-bottom: 0; color: var(--muted); }
.empty-state code { padding: .15rem .35rem; border-radius: 5px; background: #eaf0f8; }
.login-card, .utility-card { width: min(100%, 560px); margin-inline: auto; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.login-card { text-align: center; }
.login-card h2, .utility-card h1 { margin: .35rem 0 .65rem; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.08; letter-spacing: -.035em; }
.login-card > p:not(.eyebrow):not(.form-error), .utility-card > p { color: var(--muted); }
.login-lock { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 1rem; border-radius: 18px; background: #eaf1ff; font-size: 1.5rem; }
.password-form { display: grid; gap: .7rem; margin-top: 1.5rem; text-align: left; }
.password-form label, .hash-result label { font-weight: 750; }
.password-form input, .hash-result textarea { width: 100%; min-height: 48px; padding: .75rem .9rem; border: 1px solid #b9c4d4; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; }
.password-form input:focus, .hash-result textarea:focus { outline: 3px solid rgba(23,89,199,.22); border-color: var(--blue); }
.password-form button { min-height: 48px; padding: .7rem 1rem; border: 0; border-radius: 10px; color: #fff; background: var(--blue); font: inherit; font-weight: 800; cursor: pointer; }
.password-form button:hover { background: var(--blue-deep); }
.form-error { padding: .7rem .9rem; border-radius: 9px; color: #8d1820; background: #fff0f1; font-weight: 700; }
.utility-main { min-height: 100vh; display: grid; place-items: center; padding-block: 2rem; }
.utility-card code { padding: .12rem .3rem; border-radius: 5px; background: #eaf0f8; }
.hash-result { display: grid; gap: .5rem; margin-top: 1.5rem; }
.hash-result textarea { min-height: 86px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .83rem; }
.utility-warning { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.site-footer { min-height: 68px; display: flex; align-items: center; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); background: rgba(246,248,252,.76); }
.lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: rgba(7,10,16,.98); }
.lightbox::backdrop { background: #070a10; }
.lightbox[open] { display: grid; grid-template: auto 1fr / 1fr; }
.lightbox-bar { z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; padding: .75rem clamp(1rem, 3vw, 2rem); background: rgba(7,10,16,.75); }
#lightbox-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-actions { display: flex; align-items: center; gap: .75rem; flex: 0 0 auto; }
.download-link { display: inline-flex; min-height: 42px; align-items: center; padding: .55rem .9rem; border-radius: 9px; color: #fff; background: #1759c7; font-size: .9rem; font-weight: 750; text-decoration: none; }
#close-lightbox, .nav-button { border: 0; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; }
#close-lightbox { width: 42px; height: 42px; border-radius: 50%; font-size: 1.8rem; line-height: 1; }
#lightbox-image { grid-area: 2 / 1; place-self: center; display: block; max-width: 100vw; max-height: calc(100vh - 68px); width: auto; height: auto; object-fit: contain; }
.nav-button { position: fixed; z-index: 3; top: 50%; transform: translateY(-50%); width: 48px; height: 62px; border-radius: 12px; font-size: 2.4rem; }
.nav-button.previous { left: .75rem; }
.nav-button.next { right: .75rem; }
.nav-button:hover, #close-lightbox:hover { background: rgba(255,255,255,.22); }
.viewer-open { overflow: hidden; }

@media (max-width: 640px) {
  .shell { width: min(100% - 1.25rem, 1180px); }
  .site-header .shell { min-height: 62px; }
  .home-main, .gallery-main { padding-block: 2.25rem; }
  .gallery-heading { align-items: start; flex-direction: column; gap: .3rem; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .photo-card { border-radius: 8px; }
  .lightbox-bar { align-items: flex-start; min-height: 64px; }
  #lightbox-name { display: none; }
  .lightbox-actions { width: 100%; justify-content: flex-end; }
  .nav-button { top: auto; bottom: 1rem; transform: none; width: 46px; height: 46px; border-radius: 50%; }
  #lightbox-image { max-height: calc(100vh - 64px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
