/* Shop JK — NFC Profiles. Light by default, dark via [data-theme="dark"] on <html>. */
:root {
  --red: #e10600;
  --red-press: #b80500;
  --bg: #ffffff;
  --surface: #f5f5f4;
  --surface-2: #ececea;
  --border: #e4e4e2;
  --text: #0b0b0b;
  --muted: #6b6b68;
  --on-red: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #151515;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #f6f6f5;
  --muted: #9a9a96;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background .2s, color .2s;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Header ───────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 900; letter-spacing: -.02em;
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: block; } .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }

/* ───────── Buttons & forms ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); text-decoration: none; font-weight: 600; cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn-primary:hover { background: var(--red-press); border-color: var(--red-press); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { border-color: var(--text); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.textarea { resize: vertical; min-height: 84px; }
.hint { font-size: 12px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.prefix-input span { padding: 11px 0 11px 13px; color: var(--muted); white-space: nowrap; }
.prefix-input input { border: 0; padding-left: 2px; flex: 1; min-width: 0; outline: none; background: transparent; padding: 11px 13px 11px 1px; }
.prefix-input:focus-within { border-color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }

/* ───────── Layout pieces ───────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 48px 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 14px; letter-spacing: .01em; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); }
.notice.ok { border-color: #1f9d55; }
.notice.err { border-color: var(--red); }
.muted { color: var(--muted); }
.center { text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Landing ───────── */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-copy h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 18px; }
.hero-copy h1 em { font-style: normal; color: var(--red); }
.hero-copy p { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 0 28px; }
.hero-copy .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0 72px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-size: 13px; margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 40px; } .steps { grid-template-columns: 1fr; } }

/* ───────── Phone frame (previews) ───────── */
.phone {
  width: 100%; max-width: 360px; margin: 0 auto; border-radius: 40px; padding: 10px;
  background: #0b0b0b; box-shadow: var(--shadow);
}
.phone-screen { color: var(--text); border-radius: 31px; overflow: hidden; height: 680px; overflow-y: auto; background: var(--bg); }
.phone-screen::-webkit-scrollbar { width: 0; }

/* ───────── Editor page ───────── */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding: 28px 0 120px; align-items: start; }
.editor-preview { position: sticky; top: 84px; }
.editor-preview .label { display: block; text-align: center; margin-bottom: 10px; }
@media (max-width: 940px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
  .phone-screen { height: 560px; }
}
.page-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.page-link code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--bg); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-row img, .avatar-row .avatar-empty { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.avatar-empty { display: grid; place-items: center; color: var(--muted); font-size: 26px; }
.link-row { display: grid; grid-template-columns: 150px minmax(0,1fr) auto auto auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 560px) { .link-row { grid-template-columns: 1fr auto auto auto; } .link-row .link-label { grid-column: 1 / -1; } }
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 20px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}
.savebar .status { margin-right: auto; font-size: 14px; color: var(--muted); }
.card-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.card-list li { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }

/* ───────── Public profile ───────── */
.jk-profile { color: var(--text); background: var(--bg); max-width: 460px; margin: 0 auto; min-height: 100%; padding-bottom: 28px; }
.jk-cover { height: 132px; background: #0b0b0b; position: relative; overflow: hidden; }
.jk-cover::before { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 180%; background: radial-gradient(closest-side, rgba(225,6,0,.55), transparent); }
.jk-cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red); }
.jk-head { padding: 0 22px; text-align: center; }
.jk-avatar {
  width: 112px; height: 112px; border-radius: 50%; margin: -58px auto 14px; object-fit: cover;
  border: 4px solid var(--bg); background: var(--surface-2); position: relative;
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--muted);
}
img.jk-avatar, .avatar-row img { font-size: 0; color: transparent; }
.input[aria-invalid="true"] { border-color: var(--red); }
.jk-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.jk-role { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.jk-bio { margin: 14px auto 0; font-size: 15px; max-width: 360px; white-space: pre-line; }
.jk-actions { padding: 22px 22px 6px; display: grid; gap: 10px; }
.jk-save { padding: 15px 18px; font-size: 16px; }
.jk-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.jk-quick a { padding: 11px 8px; font-size: 14px; }
.jk-links { list-style: none; margin: 14px 0 0; padding: 0 22px; display: grid; gap: 10px; }
.jk-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 600;
  transition: border-color .15s, transform .06s;
}
.jk-link:hover { border-color: var(--text); }
.jk-link:active { transform: scale(.99); }
.jk-badge { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: 14px; }
.jk-link-text { flex: 1; min-width: 0; }
.jk-link-text small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jk-arrow { color: var(--muted); }
.jk-foot { text-align: center; margin-top: 30px; font-size: 12px; color: var(--muted); }
.jk-foot a { color: var(--text); font-weight: 700; text-decoration: none; }
.jk-foot a span { color: var(--red); }
.jk-empty-note { text-align: center; color: var(--muted); font-size: 14px; padding: 18px 22px 0; }
.profile-page .site-header { position: absolute; left: 0; right: 0; background: transparent; border: 0; justify-content: flex-end; backdrop-filter: none; }
.profile-page .theme-toggle { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
