:root {
  --paper:      #FAF9F5;
  --card:       #FFFFFF;
  --ink:        #1B1A18;
  --muted:      #6E6B63;
  --faint:      #97938A;
  --line:       #E8E4DA;
  --line-soft:  #F0EDE5;
  --accent:     #1F49D8;
  --accent-ink: #163AAE;
  --accent-wash:#ECF0FE;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --shadow-card: 0 1px 2px rgba(27,26,24,.05), 0 8px 24px rgba(27,26,24,.06);
  --shadow-pop:  0 20px 60px rgba(27,26,24,.22);

  --maxw: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-wash); }

.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }

/* ---- topbar -------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.wordmark {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--accent); }

/* ---- hero ---------------------------------------------------------------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 92px) clamp(16px, 4vw, 40px) clamp(28px, 4vw, 44px);
  text-align: center;
}
.hero-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
}
.hero-sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  margin: 18px auto 0;
  max-width: 30ch;
}
.hero-count {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--faint);
  text-transform: uppercase;
  margin: 22px 0 0;
}

/* ---- the wall ------------------------------------------------------------ */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px clamp(12px, 4vw, 40px) 80px;
}

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 6px;
  gap: 16px;
  align-items: start;
}
@media (min-width: 640px) {
  .wall { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

.card {
  position: relative;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  transition: transform .16s ease, box-shadow .16s ease;
  opacity: 0;
  animation: rise .4s ease forwards;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.card img {
  width: 100%;
  height: auto;
  background: var(--line-soft);
}
.card-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 10px 13px 12px;
  border-top: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- empty state --------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 80px 20px;
}
.empty-line {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 28px;
  margin: 0;
}
.empty-sub { color: var(--muted); margin: 8px 0 22px; }

/* ---- footer -------------------------------------------------------------- */

.sitefoot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 48px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
  font-size: 13px;
  color: var(--faint);
  font-family: "Space Mono", monospace;
}
.foot-note { color: var(--faint); }

/* ---- lightbox ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(24, 22, 19, .62);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.lb-figure {
  display: flex;
  flex-direction: column;
  max-width: 920px;
  max-height: 92vh;
  margin: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}
@media (min-width: 760px) {
  .lb-figure { flex-direction: row; }
  .lb-figure img { max-width: 62%; }
}
.lb-figure img {
  object-fit: contain;
  background: #14130f;
  max-height: 92vh;
}
.lb-meta { padding: 26px 28px; overflow-y: auto; min-width: 240px; }
.lb-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
}
.lb-desc { color: var(--ink); margin: 12px 0 0; }
.lb-desc:empty { display: none; }
.lb-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.lb-date {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--faint);
  margin: 22px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.link-chip {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 6px 14px;
  transition: background .14s ease;
}
.link-chip:hover { background: #DEE5FD; }

.lb-close, .modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.lb-close:hover, .modal-close:hover { background: var(--line-soft); }

/* ---- modal --------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(12px, 5vh, 64px) 16px;
  overflow-y: auto;
  background: rgba(24, 22, 19, .55);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: rise .22s ease;
}
.modal-close { top: 16px; right: 16px; }
.modal-head { padding: 24px 28px 4px; }
.modal-head h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0;
}
.modal-body { padding: 16px 28px 28px; display: flex; flex-direction: column; gap: 18px; }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-wash); }
.dz-preview { width: 100%; max-height: 320px; object-fit: contain; }
.dz-prompt { text-align: center; color: var(--muted); display: grid; gap: 6px; padding: 20px; }
.dz-icon {
  font-size: 30px;
  font-weight: 300;
  color: var(--accent);
  width: 46px; height: 46px;
  line-height: 44px;
  margin: 0 auto;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
}
.dz-text { font-weight: 600; color: var(--ink); }
.dz-hint { font-size: 13px; color: var(--faint); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 14px; }
.optional { font-weight: 400; color: var(--faint); font-size: 13px; }

input[type="text"], input[type="url"], textarea {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .14s ease, background .14s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--card);
  outline: none;
}
textarea { resize: vertical; }
.counter { font-family: "Space Mono", monospace; font-size: 12px; color: var(--faint); align-self: flex-end; }

.link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.link-row .l-label { flex: 0 0 34%; }
.link-row .l-url { flex: 1; }
.link-row .l-remove {
  flex: 0 0 auto;
  width: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.link-row .l-remove:hover { border-color: var(--accent); color: var(--accent); }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
}
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }

.form-error {
  margin: 0;
  color: #B42318;
  font-size: 14px;
  font-weight: 500;
}

/* ---- toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  animation: rise .25s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

[hidden] { display: none !important; }

body.locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .card { opacity: 1; }
}

/* ============================================================
   Phase 2 — auth, userbar, dashboard
   ============================================================ */

.topbar-right { display: flex; align-items: center; gap: 12px; }
.userbar { display: flex; align-items: center; gap: 8px; }
.ub-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 4px;
}
.ub-name:hover { color: var(--accent); }

.btn-danger {
  background: transparent;
  color: #B42318;
  border-color: var(--line);
}
.btn-danger:hover { background: #FDECEA; border-color: #F0C6C0; }

.modal-narrow { max-width: 400px; }

.linklike {
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.linklike:hover { text-decoration: underline; }
.auth-toggle { text-align: center; font-size: 14px; color: var(--muted); margin: 4px 0 0; }

/* ---- dashboard ----------------------------------------------------------- */

.dash {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 80px;
}
.dash-head { margin-bottom: 28px; }
.dash-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.03em;
  margin: 0;
}
.dash-count {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 8px 0 0;
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.manage-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.manage-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--line-soft);
}
.mc-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mc-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 16px;
}
.mc-desc {
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mc-links {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
}
.mc-actions { display: flex; gap: 8px; margin-top: 12px; }
.mc-actions .btn { flex: 1; }

.edit-photo { display: flex; justify-content: center; }
.edit-photo img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* ---- gate ---------------------------------------------------------------- */

.gate { text-align: center; padding: clamp(60px, 12vw, 120px) 20px; }
.gate-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: -0.03em;
  margin: 0;
}
.gate-sub { color: var(--muted); margin: 14px 0 26px; font-size: 18px; }

/* ---- style picker (Phase 3) ---------------------------------------------- */

.style-picker { display: flex; flex-direction: column; gap: 9px; }
.style-head { font-weight: 600; font-size: 14px; }
.style-options { display: flex; gap: 10px; }
.style-loading { font-size: 14px; color: var(--faint); padding: 6px 0; }

.style-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .12s ease;
}
.style-opt:hover { border-color: var(--accent); }
.style-opt.active { border-color: var(--accent); background: var(--accent-wash); }
.style-opt img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 7px;
  background: var(--line-soft);
}
.style-opt span { font-size: 12px; font-weight: 600; color: var(--ink); }

/* style badge */
.style-badge {
  align-self: flex-start;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ============================================================
   Phase 4 — search, reporting, moderation
   ============================================================ */

.searchbar { max-width: 520px; margin: 0 auto 22px; }
#search {
  font: inherit;
  width: 100%;
  padding: 12px 18px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transition: border-color .14s ease;
}
#search::placeholder { color: var(--faint); }
#search:focus { border-color: var(--accent); outline: none; }

select {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
select:focus { border-color: var(--accent); outline: none; background: var(--card); }

.lb-report {
  margin-top: 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lb-report:hover { color: #B42318; }

.review-badge {
  align-self: flex-start;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #B42318;
  background: #FDECEA;
  border-radius: 999px;
  padding: 2px 8px;
}
.manage-card.is-hidden img { opacity: 0.5; }

/* ---- admin queue --------------------------------------------------------- */

.queue { display: flex; flex-direction: column; gap: 14px; }
.q-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.q-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--line-soft);
  flex: 0 0 auto;
}
.q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.q-top { display: flex; align-items: center; gap: 10px; }
.q-name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 17px; }
.q-hidden {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #B42318;
  background: #FDECEA;
  border-radius: 999px;
  padding: 2px 8px;
}
.q-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.q-reason {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.q-reason.severe { color: #B42318; background: #FDECEA; }
.q-details { margin: 2px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.q-details li { margin: 2px 0; }
.q-actions { display: flex; gap: 8px; margin-top: 4px; }
