/* peekpay — one dark theme, rounded system type, one accent used for the act of unlocking. */

:root {
  --bg: #141019;
  --surface: #1e1826;
  --surface-2: #2a2234;
  --line: #372d45;
  --text: #f6f1fb;
  --muted: #a89db8;
  --accent: #ff5c8a;
  --accent-ink: #2a0712;
  --ok: #7be0ad;
  --danger: #ff7a7a;
  --radius: 18px;
  --radius-s: 12px;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI Variable", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; margin: 0 0 0.35rem; font-weight: 650; }
p { margin: 0 0 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
small { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 0.3rem; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 0.86rem; margin-top: 1.2rem; }
[hidden] { display: none !important; }

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

/* ---------- shell ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top));
  max-width: 44rem; margin: 0 auto; width: 100%;
}
.nav nav { display: flex; align-items: center; gap: 18px; }
.nav nav a { text-decoration: none; font-weight: 600; color: var(--muted); }
.nav nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); background: var(--surface-2); padding: 7px 14px; border-radius: 999px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 750; letter-spacing: -0.02em; font-size: 1.15rem; }
.avatar-link { display: inline-flex; }
.wrap { width: 100%; max-width: 30rem; margin: 0 auto; padding: 8px 20px 40px; flex: 1; }
.wrap.wide { max-width: 44rem; }
.narrow { max-width: 30rem; }
.foot {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--muted); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer; width: 100%; transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { background: #342b40; }
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ff6f98; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.92rem; border-radius: 11px; width: auto; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 1.4rem 0; }
@media (min-width: 480px) { .actions { flex-direction: row; } .actions .btn { width: auto; min-width: 11rem; } }

.stack { display: flex; flex-direction: column; gap: 18px; }
.field > span:first-child { display: block; font-weight: 650; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit;
}
input:disabled { opacity: 0.6; }
.prefixed { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.prefixed > span { padding: 0 0 0 14px; color: var(--muted); font-weight: 650; }
.prefixed input { border: 0; background: transparent; padding-left: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.check span { font-weight: 600; }
.check small { font-weight: 400; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); margin: 0 0 1rem; }
.notice.err { background: #3a1d26; color: #ffd4dc; }
.notice.ok { background: #1c3a2d; color: #c9f2dc; }
#price-hint.err { color: var(--danger); }

/* ---------- avatar / chip ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; background: var(--surface-2); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: 0.9em; }
.chip { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.chip div { display: flex; flex-direction: column; line-height: 1.25; }
.chip strong { font-weight: 650; }
.chip .muted { font-size: 0.86rem; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.logout { margin-top: 2.5rem; }

/* ---------- landing ---------- */
.hero { padding: 36px 0 20px; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.4rem); margin-bottom: 1rem; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 32rem; }
.facts { display: grid; gap: 26px; padding: 26px 0 10px; border-top: 1px solid var(--line); margin-top: 20px; }
.facts p { color: var(--muted); margin: 0; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.dash-head .btn { width: auto; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .btn { width: auto; margin-top: 10px; }
.peek-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.peek-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border-radius: var(--radius); padding: 14px;
}
.peek-row.status-disabled { opacity: 0.7; }
.thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px) saturate(1.2); transform: scale(1.3); }
.thumb-kind { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #3a2f4b, #241c2f); }
.peek-body { min-width: 0; }
.peek-title { font-weight: 650; font-size: 1.05rem; }
.peek-meta { color: var(--muted); font-size: 0.88rem; display: flex; flex-direction: column; margin: 2px 0 8px; }
.peek-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.peek-link code { color: var(--muted); font-size: 0.85rem; word-break: break-all; }
.pill { font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.peek-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .peek-row { grid-template-columns: 64px 1fr auto; }
  .peek-actions { grid-column: auto; flex-direction: column; align-items: stretch; }
}

/* ---------- new peek ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 34px 20px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface);
}
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.selection { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sel-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.sel-item img { width: 100%; height: 100%; object-fit: cover; }
.sel-item span { position: absolute; left: 6px; bottom: 6px; font-size: 0.72rem; background: rgba(20, 16, 25, 0.8); padding: 2px 6px; border-radius: 6px; }
.sel-video::before, .sel-noimg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #3a2f4b, #241c2f); }
.sel-video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; color: var(--muted); }
.progress-box { padding: 28px 0; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 12px; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.done { padding-top: 10px; }
.linkbox { background: var(--surface); border-radius: var(--radius-s); padding: 14px; word-break: break-all; }

/* ---------- paywall & viewer ---------- */
.paywall, .viewer { padding-top: 6px; }
.teaser {
  position: relative; width: 100%; max-height: 62dvh; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); margin-bottom: 20px;
}
.teaser img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: blur(22px) saturate(1.25); transform: scale(1.25);
}
.teaser-blank { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, #3f2f52, #1e1826 70%); }
.teaser .lock {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--text);
}
.teaser .lock svg { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: rgba(20, 16, 25, 0.55); backdrop-filter: blur(8px); }
.peek-heading { font-size: 1.5rem; margin-bottom: 0.25rem; }
.price-line { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 16px; }
.price { font-size: 2.4rem; font-weight: 750; letter-spacing: -0.03em; }
#express { margin-bottom: 10px; }
#card-form { margin-top: 4px; }
#payment-element { margin-bottom: 4px; }
.media-stack { display: flex; flex-direction: column; gap: 12px; }
.media-stack img, .media-stack video { width: 100%; height: auto; border-radius: var(--radius); background: var(--surface); display: block; }
.message { padding-top: 40px; }
.message .btn { width: auto; }
.legal p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
