/* ============================================================
   Sbtius — sbtius.com
   Soft violet palette, compact capsule UI, local-first card studio.
   ============================================================ */

:root {
  --bg: #f5f3fa;
  --bg-soft: #ece8f7;
  --surface: #fffdfb;
  --surface-2: #f8f5fd;
  --ink: #221f2e;
  --muted: #655f78;
  --faint: #968fa9;
  --line: rgba(34, 31, 46, 0.12);
  --line-soft: rgba(34, 31, 46, 0.07);
  --accent: #6b5bd6;
  --accent-deep: #5344bd;
  --accent-soft: rgba(107, 91, 214, 0.12);
  --green: #4f7d68;
  --green-soft: rgba(79, 125, 104, 0.14);
  --danger: #a6402f;
  --danger-soft: rgba(166, 64, 47, 0.12);
  --shadow-sm: 0 1px 2px rgba(38, 30, 80, 0.05);
  --shadow-md: 0 14px 40px rgba(38, 30, 80, 0.09);
  --shadow-note: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 14px 24px rgba(38, 30, 80, 0.13);
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Songti SC", "Hiragino Mincho ProN", serif;
  --radius: 20px;
  --wrap: 1160px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(107, 91, 214, 0.09), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(206, 122, 178, 0.06), transparent 55%);
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(107, 91, 214, 0.22); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 620px; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--surface); padding: 8px 14px;
  border-radius: 999px; font-size: 13px; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; color: var(--surface); }

/* ---------- Buttons & pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-primary:hover { background: #171426; color: var(--surface); box-shadow: var(--shadow-sm); }
.btn-accent { background: var(--accent); color: #f8f6ff; }
.btn-accent:hover { background: var(--accent-deep); color: #f8f6ff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.btn-quiet { color: var(--muted); }
.btn-quiet:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff6f2; }
.btn-danger:hover { background: #8c3425; color: #fff6f2; }

.pill, .badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.65);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 10px; z-index: 60; padding-inline: 16px; }
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  background: rgba(255, 253, 251, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(38, 30, 80, 0.07);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav-link { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background 0.15s ease, color 0.15s ease; }
.nav-link:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-deep); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-nav { display: none; }

.lang { position: relative; }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { background: rgba(38, 33, 23, 0.04); color: var(--ink); }
.lang[open] summary { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 148px; padding: 6px;
  display: grid; gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(38, 33, 23, 0.14);
  z-index: 80;
}
.lang-item { padding: 8px 11px; border-radius: 10px; font-size: 13.5px; color: var(--ink); }
.lang-item:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.lang-item.is-active { background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- Hero ---------- */
.hero { padding: 58px 0 30px; overflow: hidden; }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); line-height: 1.02; letter-spacing: -0.03em; max-width: 15ch; margin-bottom: 18px; }
.hero .lede { max-width: 520px; font-size: 16.5px; }
.hero-art { position: relative; height: 260px; }
.hero-note {
  position: absolute;
  width: 190px;
  padding: 16px 16px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #3a3223;
  box-shadow: var(--shadow-note);
  rotate: 2deg;
}
.hero-note--a { top: 6px; right: 12px; background: #fdf1b8; rotate: 3deg; }
.hero-note--b { top: 92px; right: 178px; background: #d9e8d2; rotate: -4deg; width: 176px; }
.hero-note--c { top: 178px; right: 40px; background: #ffd9c7; rotate: -1.5deg; width: 150px; padding-block: 12px; }
.hero-note-mark { display: inline-block; margin-top: 8px; font-size: 11.5px; color: #6d7d5d; }
.hero-note-small { display: inline-block; margin-top: 8px; font-size: 11px; color: #6f6657; }

/* ---------- Wall ---------- */
.wall-wrap { padding-bottom: 8px; }
.wall-shell {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.wall-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.9), rgba(251, 246, 236, 0.65));
}
.wall-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.count-pill {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(38, 33, 23, 0.05);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.count-pill strong { color: var(--ink); font-weight: 700; }
.saved-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.saved-pill.is-saving { color: var(--accent); }
.saved-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.saved-pill.is-saving .saved-dot { background: var(--accent); }
.wall-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wall {
  position: relative;
  height: clamp(400px, 58svh, 560px);
  overflow: hidden;
  background-color: #faf5e9;
  background-image:
    radial-gradient(circle, rgba(38, 33, 23, 0.13) 1px, transparent 1.3px),
    linear-gradient(180deg, rgba(255, 253, 248, 0.5), rgba(240, 233, 219, 0.35));
  background-size: 22px 22px, 100% 100%;
  outline: none;
}
.wall:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wall-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  margin: 0; padding: 24px;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}
.wall-empty[hidden] { display: none; }
.wall-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--faint);
  background: rgba(251, 246, 236, 0.5);
}
.wall-lock { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* ---------- Notes ---------- */
.note {
  --note: #fdf1b8;
  position: absolute;
  width: 216px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--note);
  box-shadow: var(--shadow-note);
  transform: rotate(var(--rot, 0deg));
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  will-change: left, top;
}
.note[data-color="butter"] { --note: #fdf1b8; }
.note[data-color="peach"]  { --note: #ffd9c7; }
.note[data-color="mint"]   { --note: #d9e8d2; }
.note[data-color="sky"]    { --note: #d6e4ff; }
.note[data-color="lilac"]  { --note: #eeddff; }
.note[data-color="white"]  { --note: #fffdf8; }
.note:hover { box-shadow: 0 2px 0 rgba(255, 255, 255, 0.55) inset, 0 20px 36px rgba(38, 33, 23, 0.18); }
.note.is-dragging { transition: box-shadow 0.12s ease; transform: rotate(0deg) scale(1.015); box-shadow: 0 26px 48px rgba(38, 33, 23, 0.24); z-index: 9999 !important; }
.note.is-pinned { box-shadow: 0 2px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 32px rgba(38, 33, 23, 0.2); }
.note.is-pinned::after {
  content: "";
  position: absolute; top: 9px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.note-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.note-head:active { cursor: grabbing; }
.note-grip {
  width: 16px; height: 12px;
  background-image: radial-gradient(circle, rgba(38, 33, 23, 0.34) 1.1px, transparent 1.2px);
  background-size: 5px 5px;
  background-position: 1px 1px;
  opacity: 0.75;
}
.note-grip:focus-visible { outline-offset: 1px; }
.note-body {
  flex: 1;
  padding: 6px 14px 10px;
  min-height: 82px;
  font-size: 15px;
  line-height: 1.5;
  color: #332c1f;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
  cursor: text;
}
.note-body:empty::before { content: attr(data-placeholder); color: rgba(51, 44, 31, 0.42); }
.note-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 8px 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.note:hover .note-foot,
.note:focus-within .note-foot { opacity: 1; }
@media (hover: none) { .note-foot { opacity: 1; } }
.color-dots { display: flex; gap: 4px; }
.color-dot {
  width: 13px; height: 13px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(38, 33, 23, 0.18);
  background: var(--swatch);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.color-dot:hover { transform: scale(1.12); }
.color-dot.is-active { box-shadow: 0 0 0 2px var(--note), 0 0 0 3.5px rgba(38, 33, 23, 0.55); }
.note-tools { display: flex; gap: 1px; }
.icon-btn {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: rgba(38, 33, 23, 0.55);
  transition: background 0.12s ease, color 0.12s ease;
}
.icon-btn:hover { background: rgba(38, 33, 23, 0.08); color: var(--ink); }
.icon-btn.is-active { color: var(--accent-deep); background: rgba(194, 97, 52, 0.14); }

/* ---------- Sections ---------- */
.section { padding: 78px 24px; }
.section--tint { background: var(--bg-soft); border-block: 1px solid var(--line-soft); }
.section-head { margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 12px; max-width: 660px; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.section-head--row h2 { margin-bottom: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { border-top: 1px solid var(--line); padding-top: 18px; }
.step-num { display: block; font-family: var(--serif); font-size: 15px; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 34px; }
.step h3 { font-family: var(--sans); font-size: 16px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.split-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 14px; }
.pwa-chip {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 24px; padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.6);
  max-width: 480px;
}
.pwa-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); }
.pwa-chip strong { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.pwa-chip small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.why-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 26px; }
.why-list li { display: flex; gap: 14px; align-items: flex-start; }
.why-check {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin-top: 2px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px; font-weight: 700;
}
.why-list h3 { font-family: var(--sans); font-size: 15.5px; font-weight: 700; margin: 0 0 4px; }
.why-list p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; }

.faq-list { max-width: 780px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 17px 2px;
  font-size: 15.5px; font-weight: 600;
  transition: color 0.15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--sans); font-size: 18px; font-weight: 400; color: var(--faint); line-height: 1; transition: rotate 0.2s ease; }
.faq-item[open] summary::after { content: "–"; color: var(--accent); }
.faq-item summary:hover { color: var(--accent-deep); }
.faq-item p { color: var(--muted); font-size: 14px; line-height: 1.7; padding: 0 40px 20px 2px; margin: 0; }

/* ---------- Blog teaser & rows ---------- */
.band-blog { padding-block: 64px; }
.post-rows { display: grid; }
.post-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 20px;
  gap: 18px;
  align-items: center;
  padding: 20px 4px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-row:hover { color: var(--ink); }
.post-row:hover .post-title { color: var(--accent-deep); }
.post-emoji {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.post-main { min-width: 0; display: grid; gap: 3px; }
.post-meta { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--faint); }
.post-title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.3; transition: color 0.15s ease; }
.post-excerpt { font-size: 13.5px; color: var(--muted); line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-arrow { color: var(--faint); font-size: 16px; transition: transform 0.16s ease, color 0.16s ease; }
.post-row:hover .post-arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- CTA ---------- */
.cta { text-align: center; padding-block: 96px; }
.cta-inner { display: grid; justify-items: center; }
.cta h2 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin-bottom: 12px; }
.cta .lede { max-width: 480px; }
.cta-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.cta-note { font-size: 12px; color: var(--faint); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-top: 40px; margin-top: 8px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding-bottom: 28px; }
.footer-tagline { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 320px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.footer-nav a { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.footer-nav a:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.footer-ai-note { font-size: 11.5px; color: var(--faint); padding-bottom: 10px; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 16px 26px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--faint);
}

/* ---------- Dialogs & notices ---------- */
.dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
.dialog::backdrop { background: rgba(24, 20, 40, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-card {
  width: min(430px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(20, 16, 10, 0.3);
}
.dialog-card h3 { font-size: 22px; margin-bottom: 8px; }
.dialog-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { margin: 14px 0; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 200;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--surface);
  font-size: 12.5px; font-weight: 600;
  box-shadow: 0 14px 34px rgba(20, 16, 40, 0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Inner page head ---------- */
.page-head { padding: 58px 0 30px; }
.page-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.4rem); margin-bottom: 12px; max-width: 800px; }
.page-head .lede { max-width: 640px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { color: var(--line); }

/* ---------- Blog list ---------- */
.blog-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0 22px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill {
  padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.14s ease, color 0.14s ease;
}
.filter-pill:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.filter-pill.is-active { background: var(--accent-soft); color: var(--accent-deep); border-color: rgba(107, 91, 214, 0.18); }
.blog-count { font-size: 12px; color: var(--faint); }
.blog-list { padding-bottom: 26px; }
.blog-list .post-row { grid-template-columns: 68px minmax(0, 1fr) 20px; padding: 24px 4px; }
.blog-list .post-emoji { width: 68px; height: 68px; font-size: 26px; border-radius: 16px; }
.blog-list .post-title { font-size: 22px; }
.blog-list .post-excerpt { font-size: 14px; -webkit-line-clamp: 2; }
.pagination { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 26px 0 8px; }
.page-link { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.page-link:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.page-link.is-disabled { opacity: 0.4; pointer-events: none; }
.page-status { font-size: 12px; color: var(--faint); padding-inline: 4px; }
.empty-state { padding: 60px 0 80px; text-align: center; color: var(--muted); }
.empty-state p { max-width: 480px; margin-inline: auto; }

/* ---------- Article ---------- */
.article-hero { padding: 46px 0 8px; }
.article-cover {
  height: 180px;
  border-radius: 20px;
  margin-bottom: 26px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 18px 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.article-cover .cover-emoji { font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(38, 33, 23, 0.18)); }
.article-cover .cover-cat {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(255, 253, 251, 0.75); color: #403a52;
  padding: 5px 12px; border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.article-head { max-width: 780px; }
.article-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.1; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--faint); }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 56px; align-items: start; padding: 26px 0 60px; }
.article-body { max-width: 720px; font-size: 16.5px; line-height: 1.78; color: #2f2a3d; }
.article-body > p:first-of-type { font-size: 18px; color: #403a52; }
.article-body h2 { font-size: 26px; margin: 44px 0 12px; }
.article-body h3 { font-family: var(--sans); font-size: 17.5px; font-weight: 700; margin: 30px 0 8px; letter-spacing: -0.005em; }
.article-body ul, .article-body ol { padding-left: 1.35em; margin-bottom: 1.2em; }
.article-body li { margin-bottom: 0.4em; }
.article-body blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(107, 91, 214, 0.42); }
.article-body code { background: rgba(38, 33, 23, 0.07); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; }
.article-body pre { background: #241f36; color: #f2eefe; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: 13px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.article-side { position: sticky; top: 92px; display: grid; gap: 18px; }
.side-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--surface); }
.side-card h4 { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.side-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 4px 10px; border-radius: 999px; background: rgba(38, 33, 23, 0.05); font-size: 11.5px; color: var(--muted); }
.share-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.share-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.article-cta {
  margin: 44px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
}
.article-cta h3 { font-size: 19px; margin-bottom: 4px; }
.article-cta p { font-size: 13px; color: var(--muted); margin: 0; max-width: 420px; }
.related { padding: 20px 0 70px; }
.related h2 { font-size: 26px; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.related-item { display: flex; gap: 14px; align-items: flex-start; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink); }
.related-item:hover { color: var(--ink); }
.related-item:hover .related-title { color: var(--accent-deep); }
.related-item .post-emoji { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; flex: none; }
.related-title { font-family: var(--serif); font-size: 16.5px; font-weight: 600; line-height: 1.35; transition: color 0.15s ease; }
.related-meta { font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- Privacy / prose page ---------- */
.prose { max-width: 720px; padding-bottom: 70px; font-size: 15.5px; line-height: 1.75; color: #363043; }
.prose h1 { font-size: clamp(2.2rem, 4vw, 3rem); margin-bottom: 16px; }
.prose .lead { font-size: 18px; color: #403a52; }
.prose h2 { font-size: 23px; margin-top: 36px; }
.prose p { margin-bottom: 1.1em; }
.prose .muted { color: var(--muted); font-size: 13.5px; }

/* ---------- Admin ---------- */
.admin-body { background: #f1eef9; }
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0 22px; flex-wrap: wrap; }
.admin-top .brand { font-size: 17px; }
.admin-badge { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-deep); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; background: rgba(255, 253, 248, 0.8); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 22px; width: fit-content; }
.admin-tabs a { padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.admin-tabs a:hover { background: rgba(38, 33, 23, 0.05); color: var(--ink); }
.admin-tabs a.is-active { background: var(--accent-soft); color: var(--accent-deep); }
.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; margin-bottom: 20px; }
.admin-panel h2 { font-size: 21px; margin-bottom: 6px; }
.admin-panel .hint { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.stat b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; margin-bottom: 3px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 14px; background: var(--green-soft); color: #3e5c40; font-size: 13px; margin-bottom: 18px; }
.flash.is-error { background: var(--danger-soft); color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfb;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: rgba(107, 91, 214, 0.55); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.6; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.code-box {
  background: #241f36; color: #efeafc;
  padding: 14px 16px; border-radius: 14px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px; line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.code-box .dim { color: #a79ec4; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .title-cell { max-width: 420px; font-weight: 600; line-height: 1.4; }
.lang-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(38, 33, 23, 0.06); font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.lang-tag.is-en { background: var(--accent-soft); color: var(--accent-deep); }
.status-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: #3e5c40; }
.status-tag.is-draft { background: rgba(38, 33, 23, 0.07); color: var(--muted); }
.mini-form { display: inline; }
.table-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.table-actions button, .table-actions a { font-size: 11.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-soft); background: #fffdf8; color: var(--muted); font-weight: 600; }
.table-actions button:hover, .table-actions a:hover { background: rgba(38, 33, 23, 0.06); color: var(--ink); }
.table-actions .danger:hover { background: var(--danger-soft); color: var(--danger); }
.run-log { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; line-height: 1.65; color: var(--muted); white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; max-height: 240px; overflow: auto; }
.login-wrap { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-md); }
.login-card h1 { font-size: 26px; margin-bottom: 4px; }
.login-card .hint { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.login-foot { margin-top: 16px; font-size: 11px; color: var(--faint); text-align: center; }
.warn-box { border: 1px solid rgba(107, 91, 214, 0.3); background: var(--accent-soft); color: #4d3aa0; border-radius: 14px; padding: 11px 14px; font-size: 12.5px; line-height: 1.6; margin-bottom: 16px; }
.admin-article-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.admin-article-title:hover { color: var(--accent); }
.lang-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Hero mini cards ---------- */
.hero-art { height: 300px; }
.hero-mini {
  position: absolute;
  width: 200px;
  padding: 16px;
  border-radius: 16px;
  display: grid;
  gap: 9px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 24px 48px rgba(40, 32, 80, 0.16);
}
.hero-mini--a { top: 6px; right: 18px; rotate: 4deg; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.hero-mini--b { top: 118px; right: 172px; rotate: -5deg; background: #241f42; color: #efecff; border: 1px solid rgba(255, 255, 255, 0.08); }
.hero-mini-label { font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero-mini--b .hero-mini-label { color: #b3a7ff; }
.hero-mini strong { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.hero-mini small { font-size: 10.5px; opacity: 0.68; }
.hero-mini-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hero-mini-chips i { font-style: normal; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-size: 9.5px; font-weight: 600; }
.hero-mini--b .hero-mini-chips i { background: rgba(255, 255, 255, 0.12); color: #d9d2ff; }
.hero-mini-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 8.5px; opacity: 0.5; }
.hero-spark { position: absolute; top: 68%; right: 6px; color: var(--accent); opacity: 0.65; }

/* ---------- Card studio ---------- */
.studio { padding-block: 10px 12px; }
.studio-shell { border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.studio-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 253, 251, 0.9), rgba(248, 245, 253, 0.6));
}
.studio-title { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); }
.studio-title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.studio-hint { font-size: 12px; color: var(--faint); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); }
.studio-form { padding: 22px 24px 20px; display: grid; gap: 14px; align-content: start; }
.field { display: grid; gap: 6px; }
.field label, .field-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.field-hint { font-size: 11.5px; color: var(--faint); }
.field textarea.input { min-height: 76px; }
.seg-row, .swatch-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg, .swatch { position: relative; display: inline-flex; }
.seg input, .swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 253, 251, 0.6); font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.seg input:checked + span { background: var(--accent-soft); border-color: rgba(107, 91, 214, 0.28); color: var(--accent-deep); }
.seg input:focus-visible + span, .swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 253, 251, 0.6); font-size: 12px; font-weight: 600; color: var(--muted); transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.swatch i { width: 16px; height: 16px; border-radius: 50%; background: var(--chip, #ece8f7); box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.12); }
.swatch input:checked + span { border-color: rgba(107, 91, 214, 0.32); background: var(--accent-soft); color: var(--accent-deep); }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.studio-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--faint); }
.preview-pane {
  padding: 22px 24px;
  border-left: 1px solid var(--line-soft);
  background: radial-gradient(circle at 32% 0%, rgba(107, 91, 214, 0.09), transparent 55%), var(--surface-2);
  display: grid; gap: 10px; justify-items: center; align-content: start;
}
.preview-frame { width: min(100%, 340px); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 24px 54px rgba(36, 28, 74, 0.18), 0 0 0 1px var(--line-soft); }
#cardCanvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.preview-meta { display: flex; justify-content: space-between; gap: 12px; width: min(100%, 340px); font-size: 11px; color: var(--faint); }
.preview-note { margin: 0; max-width: 300px; text-align: center; font-size: 11px; line-height: 1.5; color: var(--faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; }
  .article-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .mobile-nav { display: block; }
  .topbar-inner { justify-content: space-between; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .step { padding-top: 14px; }
  .step-num { margin-bottom: 10px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .preview-pane { order: -1; border-left: 0; border-bottom: 1px solid var(--line-soft); }
  .preview-frame { width: min(300px, 74vw); }
  .preview-meta { width: min(300px, 74vw); }
  .footer-inner { flex-direction: column; gap: 18px; }
  .section { padding-block: 58px; }
  .hero { padding-top: 38px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .studio-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  .studio-form { padding: 18px 16px; }
  .preview-pane { padding: 18px 16px; }
  .studio-actions .btn { flex: 1 1 auto; }
  .topbar { padding-inline: 8px; top: 6px; }
  .topbar-inner { padding: 6px 6px 6px 12px; gap: 8px; }
  .brand { font-size: 17px; }
  .topbar-actions .btn { padding: 7px 12px; font-size: 12px; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .hero .lede { font-size: 15px; }
  .badges { gap: 6px; }
  .badge { font-size: 11px; padding: 4px 9px; }
  .wall-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .wall-meta { justify-content: space-between; }
  .wall-actions { justify-content: flex-start; }
  .wall { height: clamp(360px, 58svh, 480px); }
  .wall-foot { font-size: 10.5px; flex-direction: column; gap: 4px; align-items: flex-start; }
  .note { width: 176px; min-height: 132px; }
  .note-body { font-size: 14px; min-height: 68px; }
  .post-row { grid-template-columns: 46px minmax(0, 1fr) 14px; gap: 12px; }
  .post-emoji { width: 46px; height: 46px; font-size: 18px; border-radius: 12px; }
  .blog-list .post-row { grid-template-columns: 56px minmax(0, 1fr) 14px; }
  .blog-list .post-emoji { width: 56px; height: 56px; font-size: 22px; }
  .blog-list .post-title { font-size: 18px; }
  .post-title { font-size: 17px; }
  .article-cover { height: 140px; padding: 14px 16px; }
  .article-cover .cover-emoji { font-size: 36px; }
  .article-body { font-size: 15.5px; }
  .article-body h2 { font-size: 22px; margin-top: 32px; }
  .article-side { grid-template-columns: 1fr; }
  .article-cta { padding: 18px; }
  .admin-tabs { width: 100%; justify-content: flex-start; }
  .admin-panel { padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
