:root {
  --bg: #0c0b0a;
  --fg: #f0ebe3;
  --card: #161412;
  --muted: #1c1916;
  --muted-fg: #9a948a;
  --border: #2a2622;
  --primary: #e8e2d6;
  --primary-fg: #0c0b0a;
  --accent: #24201c;
  --danger: #c45c4a;
  --overlay: #0c0b0a;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --r: 12px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { background: var(--bg); color: var(--fg); font-family: var(--font); min-height: 100dvh; margin: 0; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 0.95; }
h2 { font-size: 1.6rem; }
p { text-wrap: pretty; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
img { max-width: 100%; display: block; }
svg { width: 1.1em; height: 1.1em; }

.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgb(240 235 227 / 0.08); background: rgb(12 11 10 / 0.85); backdrop-filter: blur(12px); }
.top-inner { max-width: 72rem; margin: 0 auto; height: 4rem; display: flex; align-items: center; gap: 1rem; padding: 0 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-size: 1.25rem; }
.crumbs { display: none; align-items: center; gap: 0.5rem; color: var(--muted-fg); font-size: 0.9rem; min-width: 0; }
.crumbs i { color: var(--border); font-style: normal; }
.crumbs span { color: var(--fg); }
@media (min-width: 640px) { .crumbs { display: flex; } .top-inner { padding: 0 1.5rem; } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.nav-link { display: inline-flex; height: 2.75rem; align-items: center; gap: 0.5rem; padding: 0 0.75rem; border-radius: 8px; }
.nav-link:hover, .icon-btn:hover, .btn:hover { background: var(--accent); }
.logout button { background: none; border: 0; color: var(--muted-fg); font: inherit; font-size: 0.8rem; height: 2.75rem; padding: 0 0.5rem; }
.logout button:hover { color: var(--fg); }

.wrap { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
@media (min-width: 640px) { .wrap { padding: 2.5rem 1.5rem 4rem; } }
.page-head { max-width: 36rem; margin-bottom: 2.2rem; }
.page-head.split, .split { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: end; max-width: none; }
.kicker { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-fg); margin: 0 0 0.75rem; }
.lede { color: var(--muted-fg); font-size: 0.95rem; line-height: 1.55; margin: 0.8rem 0 0; }
.section { margin: 2.5rem 0 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 1rem; border: 0; border-radius: 8px; background: var(--muted); color: var(--fg); font: inherit; font-size: 0.9rem; }
.btn.primary { background: var(--primary); color: var(--primary-fg); }
.btn.ghost { background: transparent; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 8px; background: var(--muted); color: var(--fg); }
.icon-btn.danger { color: var(--danger); }
.row, .row-end { display: flex; gap: 0.5rem; }
.row-end { justify-content: flex-end; }

.grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { position: relative; overflow: hidden; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px rgb(240 235 227 / 0.08); transition: box-shadow 0.25s var(--ease); }
.card:hover { box-shadow: 0 0 0 1px rgb(240 235 227 / 0.16), 0 18px 40px -24px rgb(0 0 0 / 0.7); }
.card img, .card .ph { aspect-ratio: 3/2; object-fit: cover; width: 100%; background: var(--muted); }
.ph { display: flex; align-items: center; justify-content: center; color: var(--muted-fg); font-size: 0.85rem; }
.card-body { padding: 1rem; }
.card-body p { margin: 0.3rem 0 0; font-size: 0.75rem; color: var(--muted-fg); }
.card img { transition: transform 0.5s var(--ease); }
.card:hover img { transform: scale(1.03); }
.card-menu { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 2; display: flex; gap: 0.3rem; }
.card-menu .icon-btn { background: rgb(12 11 10 / 0.5); }
.lock-chip { position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: rgb(12 11 10 / 0.55); color: var(--fg); }
.icon-btn.is-on { background: var(--primary); color: var(--primary-fg); }

.masonry { columns: 1; gap: 0.75rem; }
@media (min-width: 640px) { .masonry { columns: 2; } }
@media (min-width: 960px) { .masonry { columns: 3; } }
.shot { width: 100%; break-inside: avoid; margin: 0 0 0.75rem; padding: 0; border: 0; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgb(240 235 227 / 0.08); }
.shot img { width: 100%; height: auto; }

.drop { border: 1px dashed var(--border); border-radius: 12px; padding: 2.2rem 1rem; text-align: center; background: rgb(22 20 18 / 0.4); margin-bottom: 2rem; }
.drop.over { border-color: rgb(232 226 214 / 0.5); background: var(--accent); }
.drop svg { margin: 0 auto 0.6rem; color: var(--muted-fg); }
.hint, .opt { font-size: 0.75rem; color: var(--muted-fg); }
.drop p { margin: 0; }

.surface { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px rgb(240 235 227 / 0.08); }
.pad { padding: 1.15rem 1.25rem; }
.empty { text-align: center; padding: 4rem 1.5rem; }
.empty h2 { font-size: 2.2rem; }
.empty .btn { margin-top: 1.4rem; }
.empty > svg { width: 1.8rem; height: 1.8rem; color: var(--muted-fg); margin-bottom: 0.8rem; }

.stack { display: grid; gap: 0.9rem; }
.stack.narrow { max-width: 24rem; }
label { display: grid; gap: 0.35rem; font-size: 0.9rem; }
input, textarea { width: 100%; min-height: 2.75rem; border: 0; border-radius: 8px; background: var(--muted); color: var(--fg); font: inherit; padding: 0.6rem 0.8rem; box-shadow: 0 0 0 1px rgb(240 235 227 / 0.08); }
textarea { min-height: 5rem; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid rgb(201 196 187 / 0.6); }
fieldset { border: 0; padding: 0; display: grid; gap: 0.5rem; }
legend { font-size: 0.9rem; margin-bottom: 0.3rem; }
.check { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem; border-radius: 8px; background: transparent; box-shadow: 0 0 0 1px rgb(240 235 227 / 0.08); }
.check:has(input:checked) { background: var(--accent); }
.error { color: var(--danger); font-size: 0.9rem; }

.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-visual { display: none; position: relative; background-size: cover; background-position: center; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), rgb(12 11 10 / 0.2)); }
.auth-visual p { position: absolute; z-index: 1; left: 3rem; bottom: 3rem; font-family: var(--display); font-size: 2.4rem; line-height: 1.1; margin: 0; }
@media (min-width: 960px) { .auth-visual { display: block; } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 3rem 1.5rem; max-width: 28rem; width: 100%; margin: 0 auto; }
.brand-word { font-family: var(--display); font-size: 1.8rem; margin: 0 0 1.4rem; }

.tabs { display: flex; gap: 0.25rem; background: var(--muted); padding: 0.25rem; border-radius: 12px; margin-bottom: 2rem; }
.tabs a { flex: 1; text-align: center; height: 2.5rem; line-height: 2.5rem; border-radius: 8px; color: var(--muted-fg); }
.tabs a.is-on { background: var(--bg); color: var(--fg); }
.people, .log { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.person, .log-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.name { font-family: var(--display); font-size: 1.6rem; margin: 0; }
.meta { color: var(--muted-fg); font-size: 0.8rem; margin: 0.25rem 0 0; }

dialog.sheet { border: 0; border-radius: 18px; background: var(--card); color: var(--fg); padding: 1.4rem; width: min(32rem, calc(100vw - 2rem)); box-shadow: 0 0 0 1px rgb(240 235 227 / 0.1); }
dialog.sheet::backdrop { background: rgb(12 11 10 / 0.7); }
.hidden { display: none; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(12 11 10 / 0.95); display: flex; flex-direction: column; color: var(--fg); }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 1rem; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 1rem 1.5rem; min-height: 0; position: relative; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 8px; background: transparent; color: var(--fg); display: none; }
@media (min-width: 768px) { .lb-nav { display: flex; align-items: center; justify-content: center; } .lb-nav:hover { background: var(--accent); } }
.lb-nav.prev { left: 0.5rem; } .lb-nav.next { right: 0.5rem; }
.lb-cap { text-align: center; color: var(--muted-fg); padding: 0 1.5rem 1.5rem; font-size: 0.9rem; }
.lb-edit { max-width: 32rem; margin: 0 auto; padding: 0 1rem 1.5rem; width: 100%; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--fg); padding: 0.8rem 1.1rem; border-radius: 10px; box-shadow: 0 0 0 1px rgb(240 235 227 / 0.12); z-index: 80; font-size: 0.9rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
