/* shibari.vip shared design system — EMAKIMONO 画卷 visual language */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: oklch(0.13 0.008 55);
  --bg-raised: oklch(0.155 0.01 52);
  --surface: oklch(0.185 0.012 48);
  --surface-hover: oklch(0.22 0.015 48);
  --border: oklch(0.26 0.015 45);
  --border-active: oklch(0.42 0.10 25);

  --ink: oklch(0.87 0.012 75);
  --ink-sec: oklch(0.60 0.01 70);
  --ink-muted: oklch(0.43 0.008 65);

  --accent: oklch(0.50 0.17 25);
  --accent-bright: oklch(0.60 0.20 27);
  --accent-dim: oklch(0.34 0.09 25);

  --gold: oklch(0.74 0.13 85);
  --gold-dim: oklch(0.44 0.04 80);
  --ok: oklch(0.65 0.13 150);

  --font-d: "Hiragino Mincho ProN", "YuMincho", "Noto Serif JP", Georgia, serif;
  --font-b: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
  --font-m: "SF Mono", ui-monospace, "Menlo", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --topbar-h: 50px;
}

html { height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#noise {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.30;
  mix-blend-mode: overlay;
  background-repeat: repeat;
}

/* ---- Topbar ---- */
#topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1.25rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand {
  font-family: var(--font-d);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
@media (max-width: 719px) { .brand-sub { display: none; } }
.topnav { display: flex; align-items: center; gap: 0.15rem; margin-left: 0.75rem; }
.topnav a {
  color: var(--ink-sec); text-decoration: none;
  font-size: 0.8rem; padding: 5px 10px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.topnav a:hover { color: var(--ink); background: var(--surface); }
.topnav a.active { color: var(--ink); background: var(--surface); }
.tb-spacer { flex: 1; }
.tb-user { display: flex; align-items: center; gap: 0.5rem; }
.ptext { font-family: var(--font-m); font-size: 0.7rem; color: var(--ink-muted); white-space: nowrap; }

/* ---- Buttons / forms ---- */
.btn-ghost {
  border: 1px solid var(--border); color: var(--ink-sec);
  padding: 6px 14px; border-radius: 4px; font-size: 0.8rem;
  background: none; cursor: pointer; font-family: var(--font-b);
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  line-height: 1.4;
}
.btn-ghost:hover { border-color: var(--ink-sec); color: var(--ink); }
.btn-ghost:disabled { opacity: 0.4; cursor: default; }
.btn-primary {
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: var(--ink);
  padding: 8px 20px; border-radius: 4px; font-size: 0.85rem;
  cursor: pointer; font-family: var(--font-b);
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-danger { color: oklch(0.65 0.18 25); border-color: oklch(0.35 0.08 25); }
.btn-danger:hover { border-color: oklch(0.55 0.15 25); color: oklch(0.72 0.2 25); }

.field { margin-bottom: 0.9rem; }
.field label {
  display: block; font-size: 0.72rem; color: var(--ink-muted);
  letter-spacing: 0.05em; margin-bottom: 0.3rem;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px;
  background: oklch(0.10 0.006 50);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--ink); font-family: var(--font-b); font-size: 0.88rem;
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-dim);
}
.field input::placeholder { color: var(--ink-muted); }

.form-msg { font-size: 0.8rem; min-height: 1.2em; margin-top: 0.5rem; }
.form-msg.err { color: oklch(0.68 0.19 25); }
.form-msg.ok { color: var(--ok); }

/* ---- Cards / tags / misc ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-m); font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--ink-sec);
  white-space: nowrap;
}
.tag.gold { color: var(--gold); border-color: var(--gold-dim); }
.tag.red { color: var(--accent-bright); border-color: var(--accent-dim); }
.tag.ok { color: var(--ok); border-color: oklch(0.35 0.06 150); }
.tag.dim { color: var(--ink-muted); }

.pbar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pfill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s var(--ease); width: 0%; }

.section-title {
  font-family: var(--font-d);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 1rem;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.section-title .en {
  font-family: var(--font-m); font-size: 0.65rem;
  color: var(--ink-muted); letter-spacing: 0.1em; text-transform: uppercase;
}

.page-wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.1s !important;
  }
}
