/* ==========================================================================
   VAMP Script Hub — theme, layout, components
   Palette: #0B0B11 base · #8B5CF6 violet · #06B6D4 cyan · #10B981 mint
   No external assets, no build step.
   ========================================================================== */

:root {
  --bg: #0b0b11;
  --bg-soft: #101019;
  --bg-panel: rgba(19, 19, 30, 0.72);
  --bg-panel-solid: #14141f;
  --bg-code: #0a0a12;
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --cyan: #06b6d4;
  --mint: #10b981;
  --rose: #f472b6;
  --amber: #fbbf24;
  --text: #ececf6;
  --text-dim: #b6b6cb;
  --muted: #8b8ba6;
  --line: rgba(139, 92, 246, 0.16);
  --line-strong: rgba(139, 92, 246, 0.32);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
  --font: "Inter", "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "D2Coding", Consolas,
    "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: var(--violet-soft); text-decoration: none; }
a:hover { color: #c4b5fd; }
button { font-family: inherit; }
code, pre, kbd { font-family: var(--mono); }

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.icon.mint { color: var(--mint); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--violet);
  color: #fff;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

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

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; overflow: clip; }
.backdrop .grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.orb-violet { width: 620px; height: 620px; top: -260px; left: -140px; background: rgba(139, 92, 246, 0.5); }
.orb-cyan { width: 520px; height: 520px; top: -180px; right: -120px; background: rgba(6, 182, 212, 0.34); }
.orb-mint { width: 460px; height: 460px; bottom: -320px; left: 35%; background: rgba(16, 185, 129, 0.22); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(11, 11, 17, 0.78);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.55), rgba(6, 182, 212, 0.45), transparent);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-bat { filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.55)); }
.brand-text { font-size: 1.02rem; letter-spacing: 0.01em; }
.brand-text strong { font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 6px; margin-left: 12px; flex: 1 1 auto; }
.site-nav a,
.site-nav .linkish {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.site-nav a:hover,
.site-nav .linkish:hover { color: var(--text); background: rgba(139, 92, 246, 0.1); }

.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-label { display: inline-flex; color: var(--muted); }
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.07);
}
.lang-btn {
  min-width: 42px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.85));
  color: #08080d;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn .icon { width: 18px; height: 18px; }

/* ---------- shared ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d5df6 45%, #06b6d4 100%);
  color: #08080e;
  box-shadow: 0 12px 34px -14px rgba(139, 92, 246, 0.9);
}
.btn.primary:hover { box-shadow: 0 16px 40px -14px rgba(6, 182, 212, 0.75); color: #06060a; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.5); }
.btn.small { padding: 9px 14px; font-size: 0.86rem; }
.btn .icon { width: 18px; height: 18px; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--violet-soft);
  font-size: inherit;
  cursor: pointer;
}
.linkish:hover { color: #c4b5fd; text-decoration: underline; text-underline-offset: 3px; }

.section-head { margin: 0 0 24px; }
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.section-head p { margin: 0; color: var(--text-dim); max-width: 68ch; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 40px;
  align-items: center;
  padding: 76px 0 64px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.6rem, 6vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.grad {
  background: linear-gradient(115deg, #a78bfa 0%, #8b5cf6 30%, #06b6d4 68%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.slogan {
  margin: 0 0 16px;
  color: #ddd8f5;
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.lede { margin: 0 0 28px; color: var(--text-dim); max-width: 56ch; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero-facts .icon { width: 15px; height: 15px; color: var(--violet-soft); }

.hero-art { position: relative; min-height: 380px; display: grid; place-items: center; }
.art-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.42), rgba(6, 182, 212, 0.16) 55%, transparent 72%);
  filter: blur(18px);
}
.art-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.ring-1 { width: 300px; height: 300px; animation: spin 26s linear infinite; border-style: dashed; }
.ring-2 { width: 396px; height: 396px; border-color: rgba(6, 182, 212, 0.16); animation: spin 38s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-bat {
  position: relative;
  width: min(320px, 62vw);
  filter: drop-shadow(0 20px 50px rgba(139, 92, 246, 0.45));
  animation: hover 7s ease-in-out infinite;
}
@keyframes hover {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(13, 13, 22, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}
.chip-k { color: var(--cyan); }
.chip-v { color: var(--mint); }
.chip-a { top: 8%; left: -2%; animation: hover 8s ease-in-out infinite; }
.chip-b { bottom: 13%; right: -3%; animation: hover 9s ease-in-out infinite 0.6s; }
.chip-c { bottom: 4%; left: 2%; color: var(--text-dim); animation: hover 7.5s ease-in-out infinite 1.2s; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  margin-bottom: 68px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(20, 20, 32, 0.95), rgba(14, 14, 22, 0.95));
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(120deg, #c4b5fd, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-size: 0.9rem; font-weight: 600; }
.stat-sub { font-size: 0.76rem; color: var(--muted); }

/* ---------- how ---------- */
.how { margin-bottom: 76px; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how-card {
  position: relative;
  padding: 26px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 21, 33, 0.8), rgba(13, 13, 21, 0.82));
  overflow: hidden;
}
.how-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.6), transparent);
  opacity: 0.6;
}
.step-index {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(139, 92, 246, 0.55);
}
.how-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--violet-soft);
}
.how-icon .icon { width: 20px; height: 20px; }
.how-card h3 { margin: 0 0 8px; font-size: 1.02rem; }
.how-card p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.how-card code { font-size: 0.84em; color: var(--cyan); background: rgba(6, 182, 212, 0.08); padding: 1px 5px; border-radius: 5px; }

/* ---------- catalog ---------- */
.catalog { margin-bottom: 76px; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.updated-pill {
  display: inline-flex;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--mono);
  white-space: nowrap;
}

.toolbar {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 16, 26, 0.72);
  backdrop-filter: blur(8px);
  margin-bottom: 16px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(8, 8, 14, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-field:focus-within {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}
.search-field > .icon { color: var(--muted); width: 18px; height: 18px; }
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
}
.search-field input::placeholder { color: #6f6f8a; }
.search-field input:focus { outline: none; }
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  cursor: pointer;
}
.search-clear .icon { width: 13px; height: 13px; }

.filters { margin-top: 16px; display: grid; gap: 10px; }
.filter-row { display: flex; align-items: center; gap: 12px; }
.filter-label {
  flex: 0 0 92px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.9));
  color: #07070c;
  font-weight: 650;
}
.chip .chip-count { font-family: var(--mono); font-size: 0.72rem; opacity: 0.6; }
.chip[aria-pressed="true"] .chip-count { opacity: 0.75; }

.result-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0 2px 14px;
  color: var(--muted);
  font-size: 0.84rem;
}
.result-line #result-summary strong { color: var(--text); font-family: var(--mono); font-weight: 600; }
.reset { margin-left: auto; font-size: 0.82rem; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.card {
  --accent: var(--violet);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(20, 20, 32, 0.9), rgba(13, 13, 21, 0.94));
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.26s ease;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 75%);
  opacity: 0.55;
  transition: opacity 0.22s ease;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--accent) 70%, black);
}
.card:hover::after { opacity: 1; }
.card[data-cat="web"] { --accent: #8b5cf6; }
.card[data-cat="data"] { --accent: #06b6d4; }
.card[data-cat="devops"] { --accent: #10b981; }
.card[data-cat="productivity"] { --accent: #a78bfa; }
.card[data-cat="enterprise"] { --accent: #22d3ee; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 82%, white);
}
.card-cat::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(16, 185, 129, 0.36);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verified-badge .icon { width: 11px; height: 11px; stroke-width: 2.6; }

.card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.875rem; flex: 1 1 auto; }
.card-id {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: color-mix(in srgb, var(--accent) 70%, #9a9ab5);
  word-break: break-all;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-family: var(--mono);
  white-space: nowrap;
}
.badge .icon { width: 11px; height: 11px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(139, 92, 246, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
}
.card-foot .open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: color-mix(in srgb, var(--accent) 78%, white);
  font-weight: 600;
}
.card-foot .open .icon { width: 14px; height: 14px; transition: transform 0.2s ease; }
.card:hover .card-foot .open .icon { transform: translateX(3px); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  color: var(--violet-soft);
}
.empty h3 { margin: 4px 0 0; font-size: 1.02rem; }
.empty p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- CTA / footer ---------- */
.cta { margin-bottom: 16px; }
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 30px 32px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(70% 120% at 100% 100%, rgba(6, 182, 212, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(19, 19, 30, 0.92), rgba(12, 12, 19, 0.94));
}
.cta h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.015em; }
.cta p { margin: 0; color: var(--text-dim); font-size: 0.92rem; max-width: 60ch; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.site-footer { border-top: 1px solid var(--line); background: rgba(9, 9, 15, 0.6); }
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { font-size: 0.94rem; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.84rem; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }
.footer-note { grid-column: 1 / -1; margin: 8px 0 0; color: #6f6f8a; font-size: 0.76rem; }

/* ---------- modal ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(4, 4, 9, 0.72); backdrop-filter: blur(6px); }
.modal {
  position: relative;
  width: min(1000px, 100%);
  max-height: min(90vh, 100%);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #15151f, #0e0e17 60%);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(6, 182, 212, 0.06);
  overflow: hidden;
  animation: modal-in 0.22s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), transparent);
}
.modal-heading { flex: 1 1 auto; min-width: 0; }
.modal-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-transform: uppercase;
}
.modal-heading h2 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.3; letter-spacing: -0.02em; }
.modal-close { flex: 0 0 auto; }
.modal-body { padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.28); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.detail-summary { margin: 0 0 22px; color: #d8d8e8; font-size: 1rem; }

.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}
.panel h4 { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-soft); }
.panel p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.panel.wide { grid-column: 1 / -1; }

.block { margin-bottom: 26px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.block-head h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}
.block-head h3 .icon { width: 16px; height: 16px; color: var(--violet-soft); }
.block-head .push { margin-left: auto; }

.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
table.inputs { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
table.inputs th,
table.inputs td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(139, 92, 246, 0.1); }
table.inputs th {
  background: rgba(139, 92, 246, 0.07);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
table.inputs tr:last-child td { border-bottom: 0; }
table.inputs code { color: var(--cyan); font-size: 0.84em; }
.input-type { color: var(--muted); font-family: var(--mono); font-size: 0.76rem; }
.req-yes { color: #6ee7b7; }
.req-no { color: var(--muted); }
.input-desc { color: var(--text-dim); font-size: 0.82rem; }

.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.check-list li { display: flex; gap: 9px; color: var(--text-dim); font-size: 0.88rem; }
.check-list .icon { width: 15px; height: 15px; color: var(--mint); margin-top: 3px; }

.callout {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(6, 182, 212, 0.24);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.06);
  color: var(--text-dim);
  font-size: 0.87rem;
}
.callout.warn { border-color: rgba(251, 191, 36, 0.28); border-left-color: var(--amber); background: rgba(251, 191, 36, 0.06); }
.callout .icon { width: 16px; height: 16px; color: var(--cyan); margin-top: 3px; }
.callout.warn .icon { color: var(--amber); }
.callout strong { color: var(--text); }

.code-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-code);
}
.code-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(139, 92, 246, 0.06);
}
.code-file { font-family: var(--mono); font-size: 0.76rem; color: var(--text-dim); }
.code-file .lang { color: var(--muted); }
.code-actions { margin-left: auto; display: flex; gap: 6px; }
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.16s ease;
}
.mini-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(139, 92, 246, 0.12); }
.mini-btn .icon { width: 12px; height: 12px; }
.mini-btn.copied { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }

.code-scroll { max-height: 420px; overflow: auto; }
.code-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.code-scroll::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 99px; }

ol.code-list {
  margin: 0;
  padding: 12px 16px 12px 0;
  list-style: none;
  counter-reset: line;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.75;
  min-width: max-content;
}
ol.code-list li {
  counter-increment: line;
  display: flex;
  gap: 14px;
  white-space: pre;
  padding: 0 8px 0 0;
}
ol.code-list li::before {
  content: counter(line);
  flex: 0 0 40px;
  text-align: right;
  color: #4a4a63;
  user-select: none;
}
ol.code-list li:hover { background: rgba(139, 92, 246, 0.06); }
ol.code-list .ln { flex: 1 1 auto; }

.tok-com { color: #6b7280; font-style: italic; }
.tok-str { color: #86efac; }
.tok-num { color: #fca5a5; }
.tok-kw { color: #c4b5fd; }
.tok-bi { color: #67e8f9; }
.tok-fn { color: #93c5fd; }
.tok-key { color: #a5b4fc; }
.tok-bool { color: #fbbf24; }
.tok-punc { color: #8b8ba6; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 9px; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 11px;
  color: var(--text-dim);
  font-size: 0.89rem;
}
.steps li::before {
  content: counter(step);
  flex: 0 0 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
}
.steps code, .callout code, .panel code, .submit-guide code { font-size: 0.86em; color: var(--cyan); background: rgba(6, 182, 212, 0.08); padding: 1px 5px; border-radius: 5px; }
.detail-summary code,
.check-list code,
table.inputs td code,
.panel code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.09);
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
}
.steps kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82em;
}

.detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}
.detail-foot a { color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; }
.detail-foot a:hover { color: var(--text); }
.detail-foot .icon { width: 13px; height: 13px; }

/* ---------- submit modal ---------- */
.tabs { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(139, 92, 246, 0.06); margin-bottom: 20px; width: fit-content; }
.tab {
  padding: 7px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: rgba(139, 92, 246, 0.22); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.submit-guide h3 { margin: 0 0 8px; font-size: 1rem; }
.submit-guide p { margin: 0 0 8px; color: var(--text-dim); font-size: 0.9rem; }
.submit-guide .block { margin-bottom: 22px; }

.folder-tree {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-code);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  overflow: auto;
  line-height: 1.7;
  white-space: pre;
}
.folder-tree .dim { color: #5b5b76; }
.folder-tree .hot { color: var(--cyan); }

.gen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.field label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: #66667f; margin-left: 6px; }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 8, 14, 0.8);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
.field textarea.code-input { font-family: var(--mono); font-size: 0.8rem; min-height: 190px; white-space: pre; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}
.field .err { margin: 0; color: #fca5a5; font-size: 0.76rem; min-height: 0; }
.field.invalid input,
.field.invalid textarea { border-color: rgba(248, 113, 113, 0.6); }

.gen-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.gen-status { display: grid; gap: 6px; margin-bottom: 14px; }
.gen-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 0.84rem; color: var(--text-dim); }
.gen-msg .icon { width: 14px; height: 14px; margin-top: 3px; }
.gen-msg.ok .icon { color: var(--mint); }
.gen-msg.bad .icon { color: #f87171; }
.gen-msg.warn .icon { color: var(--amber); }

.preview-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.preview-tabs .tab { padding: 5px 12px; font-size: 0.78rem; font-family: var(--mono); }

.note-line { color: var(--muted); font-size: 0.78rem; margin: 8px 0 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 999px;
  background: rgba(11, 22, 18, 0.95);
  color: #a7f3d0;
  font-size: 0.85rem;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- language swap ---------- */
.lang-swapping .hero-copy,
.lang-swapping .catalog,
.lang-swapping .how,
.lang-swapping .stats,
.lang-swapping .cta,
.lang-swapping .site-footer,
.lang-swapping .modal-body {
  opacity: 0.35;
  transform: translateY(2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; gap: 24px; }
  .hero-art { min-height: 320px; order: -1; }
  .hero-bat { width: 220px; }
  .ring-1 { width: 230px; height: 230px; }
  .ring-2 { width: 300px; height: 300px; }
  .art-glow { width: 240px; height: 240px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .header-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .site-nav a, .site-nav .linkish { white-space: nowrap; font-size: 0.86rem; }
  .header-tools { margin-left: auto; }
  .page { padding: 0 16px 64px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 52px; }
  .hero { padding: 44px 0 48px; }
  .grid { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; align-items: flex-start; gap: 7px; }
  .filter-label { flex: none; }
  .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 4px; }
  .chip { flex: 0 0 auto; }
  .modal-layer { padding: 0; }
  .modal { max-height: 100%; height: 100%; border-radius: 0; border: 0; }
  .modal-body { padding: 18px 16px 32px; }
  .modal-top { padding: 16px; }
  .gen-grid { grid-template-columns: 1fr; }
  .cta-inner { padding: 24px 20px; }
  .footer-inner { grid-template-columns: 1fr; }
  .float-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}
