/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; }

/* ── Design tokens — light ───────────────────────────────── */
/*
 * Same variable names as the Forge. Apply a single brand override in :root
 * to retheme both frontends in one pass. Accent colour intentionally left
 * neutral so Richard's identity can be applied without touching layout code.
 */
:root {
  --bg-0:     #ffffff;
  --bg-1:     #f6f7fb;
  --bg-2:     #eeeef5;
  --border:   #dddde8;
  --text-1:   #18181f;
  --text-2:   #55566a;
  --text-3:   #94949e;
  --accent:   #5a7ac4;
  --accent-bg:#edf1fa;
  --red:      #c43a3a;
  --red-bg:   #fef2f2;
  --r-sm:     4px;
  --r:        8px;
  --t:        150ms ease;
  --font:     system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Content column — generous on desktop, full-bleed on mobile */
  --col:      640px;
  --gutter:   20px;
}

/* ── Dark — system preference ────────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg-0:     #0e1019;
    --bg-1:     #161923;
    --bg-2:     #1e2130;
    --border:   #2d3248;
    --text-1:   #e4e6f0;
    --text-2:   #9090a8;
    --text-3:   #60607a;
    --accent:   #7a97d4;
    --accent-bg:#19213e;
    --red:      #e05050;
    --red-bg:   #2a1616;
  }
}

/* ── Dark — manual override ──────────────────────────────── */
html[data-theme="dark"] {
  --bg-0:     #0e1019;
  --bg-1:     #161923;
  --bg-2:     #1e2130;
  --border:   #2d3248;
  --text-1:   #e4e6f0;
  --text-2:   #9090a8;
  --text-3:   #60607a;
  --accent:   #7a97d4;
  --accent-bg:#19213e;
  --red:      #e05050;
  --red-bg:   #2a1616;
}

/* ── Base ────────────────────────────────────────────────── */
body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ── Page column ─────────────────────────────────────────── */
/* Everything lives inside a single centred column. */
.page-col {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Loading / error states ──────────────────────────────── */
.state-loading,
.state-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 48px var(--gutter);
  text-align: center;
  flex-direction: column;
  gap: 12px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-error p { color: var(--text-2); font-size: 15px; }
.error-slug { color: var(--text-3); font-size: 13px; }

/* ── Creator header ──────────────────────────────────────── */
.creator-header {
  padding: 48px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.creator-avatar-wrap { line-height: 0; }

/* Circular avatar image */
.creator-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  /* No border — the image speaks for itself */
}

/* Fallback initials avatar when no image is set */
.creator-avatar-init {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.creator-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--text-1);
}

.creator-bio {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 8px;
  max-width: 520px;
}

/* ── Section separators ──────────────────────────────────── */
.vault-section {
  padding-top: 8px;
  padding-bottom: 48px;
}
.vault-section + .vault-section {
  border-top: 1px solid var(--border);
  padding-top: 40px;
}

/* Section label — small, quiet, uppercase. The content matters, not the label. */
.section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}

/* ── Content list ────────────────────────────────────────── */
.content-list {
  display: flex;
  flex-direction: column;
}

/* Each content item is a button to allow keyboard access and proper semantics. */
.content-item {
  all: unset;
  display: block;
  cursor: pointer;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity var(--t);
  /* Reset for keyboard focus */
  -webkit-tap-highlight-color: transparent;
}
.content-item:first-child { border-top: 1px solid var(--border); }
.content-item:hover { opacity: .78; }
.content-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.content-item:active { opacity: .6; }

/* Item layout: title + meta in a natural text flow */
.item-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-1);
  margin-bottom: 5px;
}

.item-preview {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  /* Clamp to 2 lines so long previews don't dominate */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-medium {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.item-sep {
  color: var(--border);
  font-size: 11px;
}

.item-date {
  font-size: 12px;
  color: var(--text-3);
}

/* ── Collections ─────────────────────────────────────────── */
.collections-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.collection-block { /* no extra style needed — gap handles spacing */ }

.collection-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.collection-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.collection-count {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

/* The "See all" link sits below the preview list */
.see-all-wrap {
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
}
.see-all-btn {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--t);
}
.see-all-btn:hover { color: var(--text-1); }
.see-all-btn:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: var(--r-sm);
}

/* Inline spinner for "See all" loading */
.see-all-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0 0;
}
.see-all-loading .spinner { width: 14px; height: 14px; }

/* ── Load more pagination ────────────────────────────────── */
.load-more-wrap {
  padding-top: 12px;
  text-align: center;
}
.load-more-btn {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 20px;
  transition: border-color var(--t), color var(--t), background var(--t);
  display: inline-block;
}
.load-more-btn:hover {
  border-color: var(--text-2);
  color: var(--text-1);
  background: var(--bg-1);
}
.load-more-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────── */
.vault-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* The only Zayvay chrome on the page — small and quiet. */
.footer-mark {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  user-select: none;
}

.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 7px;
  transition: border-color var(--t), color var(--t);
  margin-left: auto; /* push to right edge of footer */
}
.theme-btn:hover { border-color: var(--text-2); color: var(--text-2); }
.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Locked content overlay ──────────────────────────────── */
.locked-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;   /* bottom-sheet on mobile */
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in .15s ease;
}

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

.locked-panel {
  background: var(--bg-0);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 28px var(--gutter) 40px;
  width: 100%;
  max-width: 640px;
  position: relative;
  animation: slide-up .2s cubic-bezier(.16, 1, .3, 1);
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.locked-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-2);
  border: none;
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
}
.locked-close:hover { background: var(--bg-2); color: var(--text-1); }

.locked-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 20px;
  padding-right: 36px; /* clear the close button */
  line-height: 1.4;
}

.locked-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.locked-icon {
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 1px;
}

.locked-message {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── Desktop refinements (≥ 768px) ─────────────────────────
   Mobile-first: all base styles target 390px.
   These adjustments add breathing room and scale up typography
   without changing the editorial one-column structure.
──────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  :root {
    --gutter: 40px;
  }

  .creator-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    padding-top: 64px;
  }

  .creator-avatar,
  .creator-avatar-init {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
  }
  .creator-avatar-init { font-size: 32px; }

  .creator-name { font-size: 34px; }

  .item-title { font-size: 17px; }

  /* Bottom-sheet becomes a centred card on desktop */
  .locked-overlay {
    align-items: center;
  }
  .locked-panel {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 32px 36px 36px;
    margin: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .15);
    animation: scale-in .18s cubic-bezier(.16, 1, .3, 1);
  }

  @keyframes scale-in {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
  }
}

@media (min-width: 1280px) {
  :root { --gutter: 48px; }

  .creator-header { padding-top: 80px; }
}
