:root {
  --bg: #0c0c0e;
  --surface: #16161a;
  --surface-2: #1f1f25;
  --border: #2a2a32;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #c4b5fd;
  --accent-strong: #8b5cf6;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.brand span { color: var(--accent); }

.lede { color: var(--muted); max-width: 60ch; }

h1 { font-weight: 680; letter-spacing: -0.02em; margin: 0 0 0.4rem; }
h2 { font-weight: 620; letter-spacing: -0.01em; }

.gallery-head { padding: 2.5rem 0 1.5rem; }
.gallery-head .meta { color: var(--muted); font-size: 0.95rem; }

/* Landing feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding: 0.5rem 0 2.5rem;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}
.feature h3 { margin: 0 0 0.4rem; font-size: 1.02rem; font-weight: 600; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* Photo grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.55rem;
  padding-bottom: 4rem;
}
.tile {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile:hover img { transform: scale(1.04); }

/* Gallery cards (studio home) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 0 4rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card .cover { aspect-ratio: 3 / 2; background: var(--surface-2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 0.85rem 1rem 1.1rem; }
.card .body h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.card .body p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
}
.lightbox .lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox .lb-btn:hover { background: rgba(255, 255, 255, 0.16); }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-close { right: 1.25rem; top: 1.25rem; }
.lb-bar {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Forms + buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-strong);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 560;
  cursor: pointer;
}
.btn:hover { background: #7c4ff0; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border: 1px solid var(--border); color: var(--danger); }
.btn.small { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.25rem; }
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-strong); outline-offset: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.auth-card { max-width: 380px; margin: 8vh auto; }

.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; }
.badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.live { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); }
.badge.pending { color: var(--accent); }

.empty { color: var(--muted); padding: 2rem 0; }

footer.site { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
footer.site .wrap { padding: 1.5rem 1.25rem; }

/* Admin layout */
.admin { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; padding: 1.25rem 0 4rem; }
.admin aside { display: flex; flex-direction: column; gap: 0.4rem; }
.gallery-item {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  cursor: pointer;
  width: 100%;
}
.gallery-item.active { border-color: var(--accent-strong); }
.gallery-item small { color: var(--muted); }

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent-strong); color: var(--text); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 0;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
}
.list code { font-size: 0.82rem; color: var(--accent); word-break: break-all; }

.dns { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0.75rem; font-size: 0.85rem; }
.dns table { width: 100%; border-collapse: collapse; }
.dns td { padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--border); }
.dns td:first-child { color: var(--muted); white-space: nowrap; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.6rem 1rem;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 60;
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--danger); color: var(--danger); }

@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
}
