:root {
  --background: #0b0d10;
  --surface: #14181d;
  --surface-raised: #1b2027;
  --border: #2a313a;
  --text: #f5f7fa;
  --muted: #9da8b5;
  --accent: #8dd7c7;
  --danger: #ff8f8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% -10%, #19302e 0, transparent 32rem), var(--background); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }

.access-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.access-card { max-width: 38rem; padding: clamp(2rem, 7vw, 4.5rem); border: 1px solid var(--border); border-radius: 1.5rem; background: rgba(20, 24, 29, .92); box-shadow: 0 2rem 6rem rgba(0, 0, 0, .35); }
.access-card h1 { margin: .5rem 0 1rem; font-size: clamp(2rem, 6vw, 4rem); line-height: .98; letter-spacing: -.05em; }
.access-card p { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.access-card code { color: var(--accent); }
.alert-text { color: var(--danger) !important; }

.gallery-shell { width: min(100%, 112rem); margin: 0 auto; padding: clamp(1rem, 3vw, 3rem); }
.gallery-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.gallery-header h1 { margin: .35rem 0 0; font-size: clamp(2.4rem, 6vw, 5.5rem); line-height: .9; letter-spacing: -.055em; }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.quiet-button, .tab-button, .admin-button { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: .65rem 1rem; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.quiet-button:hover, .tab-button:hover, .admin-button:hover { border-color: #56616e; background: var(--surface-raised); }
.quiet-button:active, .tab-button:active, .admin-button:active { transform: translateY(1px); }

.gallery-tabs { position: sticky; top: .75rem; z-index: 4; display: inline-flex; gap: .35rem; margin-bottom: 1.5rem; padding: .35rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(11, 13, 16, .86); backdrop-filter: blur(16px); }
.tab-button { border-color: transparent; background: transparent; color: var(--muted); }
.tab-button.active { background: var(--text); color: #101317; }

.photo-grid { columns: 1; column-gap: 1rem; }
@media (min-width: 600px) { .photo-grid { columns: 2; } }
@media (min-width: 960px) { .photo-grid { columns: 3; } }
@media (min-width: 1380px) { .photo-grid { columns: 4; } }

.photo-card { position: relative; break-inside: avoid; margin: 0 0 1rem; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); animation: reveal .35s ease both; }
.photo-card img { display: block; width: 100%; height: auto; object-fit: cover; background: #08090b; cursor: zoom-in; }
.photo-details { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem .9rem 1rem; }
.photo-details strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-details span { color: var(--muted); font-size: .76rem; }
.photo-flags { position: absolute; top: .7rem; left: .7rem; display: flex; gap: .35rem; }
.photo-flag { padding: .3rem .55rem; border-radius: 999px; background: rgba(10, 12, 15, .82); color: #ffc2c2; font-size: .68rem; backdrop-filter: blur(8px); }
.admin-button { flex: 0 0 auto; padding: .45rem .7rem; font-size: .75rem; }
.admin-button.delete { color: var(--danger); }

.empty-state { margin: 8rem auto; max-width: 32rem; text-align: center; color: var(--muted); }
.error-state { color: var(--danger); }
.scroll-sentinel { height: 8rem; display: grid; place-items: center; }
.scroll-sentinel span { width: 1.6rem; height: 1.6rem; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.scroll-sentinel.done span { display: none; }

.photo-dialog { width: min(96vw, 96rem); height: min(94vh, 70rem); padding: 0; border: 1px solid var(--border); border-radius: 1rem; background: #060708; color: var(--text); overflow: hidden; }
.photo-dialog::backdrop { background: rgba(0, 0, 0, .88); backdrop-filter: blur(8px); }
.photo-dialog img { width: 100%; height: calc(100% - 4rem); object-fit: contain; }
.dialog-close { position: absolute; z-index: 2; top: .75rem; right: .75rem; width: 2.6rem; height: 2.6rem; border: 1px solid #ffffff33; border-radius: 50%; background: #000a; font-size: 1.6rem; cursor: pointer; }
.dialog-caption { height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.2rem; border-top: 1px solid var(--border); }
.dialog-caption span { color: var(--muted); font-size: .8rem; text-align: right; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
